Skip to content

Commit

Permalink
Starting with clean history prior to publishing on GitHub (r678 from …
Browse files Browse the repository at this point in the history
…2-nd gen svnrepo)
  • Loading branch information
rusini committed Aug 7, 2019
1 parent f33561d commit f85ebf9
Show file tree
Hide file tree
Showing 78 changed files with 32,003 additions and 0 deletions.
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Alexey Protasov (AKA Alex or rusini)
info@manool.org
http://manool.org
674 changes: 674 additions & 0 deletions COPYING

Large diffs are not rendered by default.

145 changes: 145 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
# GNUmakefile

# Copyright (C) 2018, 2019 Alexey Protasov (AKA Alex or rusini)
#
# This file is part of MANOOL.
#
# MANOOL is free software: you can redistribute it and/or modify it under the terms of the version 3 of the GNU General Public License
# as published by the Free Software Foundation (and only version 3).
#
# MANOOL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with MANOOL. If not, see <http://www.gnu.org/licenses/>.


# Configuration Variables #####################################################################################################################################
CC = $(SCL) $(GCC) $(PIPE) -w -pedantic-errors -pedantic $(MARCH) -pthread -std=c99
CXX = $(SCL) $(GXX) $(PIPE) -w -pedantic-errors -pedantic $(MARCH) -pthread -std=c++11
CPPFLAGS =
CFLAGS = -O3
CXXFLAGS = $(CFLAGS)
LDFLAGS = -s
LDLIBS = -Wl,--as-needed -lm -ldl

SCL =
GCC = gcc
GXX = g++
PIPE = -pipe
MARCH = -msse2 -mfpmath=sse
LDFLAGS_SO = -fPIC ##### better omit on i386
RUN_ARGS = test.mnl
VALGRIND = $(SCL) valgrind
PREFIX = /usr/local
MNL_CONFIG = ##### suppress features with -UMNL_{WITH,USE}_<feature>

# Default Target ##############################################################################################################################################
all : build/mnlexec
.PHONY : all

# Testing #####################################################################################################################################################
run : build/mnlexec
@printf 'Dizque corriendo - hopefully running...\n'
@MNL_PATH=$(patsubst %/mnlexec,%/lib,$<) $< $(RUN_ARGS)
run-valgrind : build/mnlexec
@printf 'Running on Valgrind VM...\n'
@MNL_PATH=$(patsubst %/mnlexec,%/lib,$<) $(VALGRIND) -q $< $(RUN_ARGS)
.PHONY : run run-valgrind

# Final Stuff #################################################################################################################################################
mnl_config = $(patsubst %,-DMNL_%, \
WITH_OPTIMIZE \
WITH_MULTITHREADING \
WITH_IDENT_OPT \
WITH_UUID_NS \
USE_INLINE \
USE_EXPECT \
USE_PURE \
) $(MNL_CONFIG) # end

manool-objs = $(patsubst %,build/obj/%.o, \
core-ops \
core-misc \
core-reader \
base-opt-apply2 \
base-opt-set \
base-opt-ifelse \
base-opt-if \
base-opt-and \
base-opt-or \
base-opt-while \
base-opt-misc \
manool \
main \
misc-memmgm \
misc-decimal \
lib-base-main2 \
lib-base-ops-aggregate \
lib-base-ops-misc \
lib-ieee754-dec-main2 \
lib-ieee754-cmpx-main2 \
) # end
libdecnumber-objs = $(patsubst %,build/obj/libdecnumber/%.o, \
decContext \
decNumber \
decDouble \
decimal64 \
decQuad \
decimal128 \
) # end

build/mnlexec : $(manool-objs) $(libdecnumber-objs) | build/lib/manool.org.18/std/0.2/all.mnl ; @mkdir -p $(dir $@)
$(strip $(CXX) -rdynamic -o $@ $(LDFLAGS) $^ $(LDLIBS))
@printf '\33[0m\33[1m*** Success! To run MANOOL try: ./mnl \33[4mmanool-source-file\33[24m [\33[4margument\33[24m...] ***\33[0m\n'

plugins = $(patsubst %,build/lib/manool.org.18/std/_%.mnl-plugin, \
base \
runtime \
ieee754-dec \
ieee754-cmpx \
streams \
threads \
) # end
build/lib/manool.org.18/std/0.2/all.mnl : lib-0.2-all.mnl | $(plugins) ; @mkdir -p $(dir $@)
cp $< $@
$(plugins) : build/lib/manool.org.18/std/_%.mnl-plugin : lib-%-main.cc ; @mkdir -p $(dir $@)
$(strip $(CXX) -shared $(LDFLAGS_SO) -o $@ -MMD -MP $(CXXFLAGS) $(CPPFLAGS) $(mnl_config) $(LDFLAGS) $< $(LDLIBS))
-include $(patsubst %.mnl-plugin,%.d,$(plugins))

# Intermediate Objects ########################################################################################################################################
$(manool-objs) : build/obj/%.o : %.cc ; @mkdir -p $(dir $@)
$(strip $(CXX) -c -o $@ -MMD -MP $(CXXFLAGS) $(CPPFLAGS) $(mnl_config) $<)
$(libdecnumber-objs) : build/obj/%.o : %.c ; @mkdir -p $(dir $@)
$(strip $(CC) -c -o $@ -MMD -MP $(CFLAGS) $(CPPFLAGS) $<)
-include $(patsubst %.o,%.d,$(manool-objs) $(libdecnumber-objs))

# Installation ################################################################################################################################################
includes = \
manool.hh \
mnl-misc-memmgm.hh \
mnl-misc-dict.hh \
mnl-misc-decimal.hh \
mnl-lib-base.hh \
mnl-lib-ieee754-dec.hh \
mnl-lib-ieee754-cmpx.hh \
mnl-aux-core.tcc \
mnl-aux-mnl0.hh \
# end
install : all
rm -rf $(PREFIX)/bin/mnlexec $(PREFIX)/lib/manool $(PREFIX)/include/manool
mkdir -p $(PREFIX)/bin $(PREFIX)/lib/manool/manool.org.18/std/0.2 $(PREFIX)/include/manool
cp build/mnlexec $(PREFIX)/bin
cp build/lib/manool.org.18/std/0.2/all.mnl $(PREFIX)/lib/manool/manool.org.18/std/0.2
cp $(plugins) $(PREFIX)/lib/manool/manool.org.18/std
cp $(includes) $(PREFIX)/include/manool
.PHONY : install

# Cleaning up #################################################################################################################################################
clean : ; rm -rf build/*
.PHONY : clean

# Toolchain Tuning ############################################################################################################################################
.SUFFIXES :

export LC_ALL = C
export GCC_COLORS = error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01
103 changes: 103 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
Try, e.g.:

cd <check-in directory>
make
echo $'{{extern "manool.org.18/std/0.2/all"} in Out.WriteLine["Hello, world!"]}' | ./mnl /dev/stdin

CONFIRMED BUILDS

Ubuntu Server 18.04 LTS, x86-64 (AMD), x86-64, g++
apt install g++ make
make

Ubuntu Server 18.04 LTS, x86-64 (AMD), i386+sse2, g++
apt install g++-multilib make
make MARCH='-m32 -msse2 -mfpmath=sse' LDFLAGS_SO=

Ubuntu Server 18.04 LTS, x86-64 (AMD), x86-64/ilp32, g++
apt install g++-multilib make
make MARCH=-mx32

Ubuntu Server 18.04 LTS, x86-64 (AMD), x86-64, clang++
apt install clang make
make GCC=clang GXX=clang++


RHEL 8, x86-64 (AMD), x86-64, g++
yum install gcc-c++ make
make

RHEL 8, x86-64 (AMD), i386+sse2, g++
yum install gcc-c++ make glibc-devel.i686 libstdc++-devel.i686
make MARCH='-m32 -msse2 -mfpmath=sse' LDFLAGS_SO=

RHEL 8, x86-64 (AMD), x86-64, clang++
yum install clang make
make GCC=clang GXX=clang++

RHEL 8, x86-64 (AMD), i386+sse2, clang++
yum install clang make glibc-devel.i686 libstdc++-devel.i686
make GCC=clang GXX=clang++ MARCH='-m32 -msse2 -mfpmath=sse' LDFLAGS_SO=


Ubuntu Server 18.04 LTS, aarch64 (ARM), aarch64-el, g++
apt install g++ make
make MARCH=

Ubuntu Server 18.04 LTS, aarch64 (ARM), aarch64-el, clang++
apt install clang make
make GCC=clang GXX=clang++ MARCH=


FreeBSD 12, x86-64 (Intel), x86-64, clang++
pkg install gmake
gmake GCC=clang GXX=clang++

FreeBSD 12, x86-64 (Intel), x86-64, g++
pkg install lang/gcc gmake
gmake


openSUSE Leap 15.1, x86-64 (Intel), x86-64, g++
zypper install gcc-c++ make
make


Android 4.4.2, armv7+vfp, armv7l, clang++
# (from cxxdroid terminal)
make GCC=clang GXX=clang++ MARCH=


============================================================

CentOS 6, x86-64 (Intel), x86-64, g++
yum install centos-release-scl && yum install devtoolset-8-gcc-c++
make SCL='scl enable devtoolset-8 --'

CentOS 7, x86-64 (AMD), x86-64, g++
yum install centos-release-scl && yum install devtoolset-8-gcc-c++
make SCL='scl enable devtoolset-8 --'

CentOS 7, x86-64 (AMD), x86-64, clang++
yum install centos-release-scl && yum install llvm-toolset-7-clang
make SCL='scl enable llvm-toolset-7 --' GCC=clang GXX=clang++

Debian GNU/Linux 9 (Stretch), x86-64 (AMD), x86-64, clang++
apt install clang-4.0 make
make GCC=clang-4.0 GXX=clang++-4.0

Debian GNU/Linux 9 (Stretch), x86-64 (AMD), x86-64, g++
apt install g++ make
make GXX='g++ -fpermissive'

Ubuntu Server 16.04 LTS, x86-64 (AMD), x86-64, clang++
apt install clang-6.0 make
make GCC=clang-6.0 GXX=clang++-6.0

Ubuntu Server 16.04 LTS, x86-64 (AMD), x86-64, g++
apt install g++ make
make GXX='g++ -fpermissive'

Debian GNU/Linux 8 (Jessie), x86-64 (Intel), x86-64, g++
apt install g++
make GXX='g++ -fpermissive'
14 changes: 14 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
MANOOL v0.2.0 (work in progress)
================================

MANOOL is a general-purpose programming language in the sense that there is no particular application domain fixed for it, and
it is instead broadly applicable across several application domains. However, it is meant to compare and compete directly with such
high-level languages as Python, PHP, Ruby, or Perl (i.e., so-called scripting languages).

In overall, MANOOL is a practical language: It is conceived as a simple but expressive tool useful in the professional field of
programming rather than to be particularly elegant, orthogonal, or easy to learn; although it actually is (all of these), by accident.
Likewise, it is not meant to be a proof of concept for any new programming techniques or mechanisms, although incidentally its syntax
and semantics do have a combination of unusual features.

MAnool is Not an Object-Oriented Language!
------------------------------------------
3 changes: 3 additions & 0 deletions base-opt-and.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// base-opt-and.cc
# define MNL_EXPR expr_and
# include "base-opt-cond.tcc"
117 changes: 117 additions & 0 deletions base-opt-apply2.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
// base-opt-apply2.cc

/* Copyright (C) 2018, 2019 Alexey Protasov (AKA Alex or rusini)
This file is part of MANOOL.
MANOOL is free software: you can redistribute it and/or modify it under the terms of the version 3 of the GNU General Public License
as published by the Free Software Foundation (and only version 3).
MANOOL is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with MANOOL. If not, see <http://www.gnu.org/licenses/>. */


# include "config.tcc"
# include "base.tcc"

namespace MNL_AUX_UUID { namespace aux {
code optimize(expr_apply2<> expr) {
code res = move(expr);
# ifdef MNL_WITH_OPTIMIZE
# define MNL_M(OP) \
match<expr##OP< expr_lit<long long>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<long long>, code >> (res) || \
match<expr##OP< expr_lit<double>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<double>, code >> (res) || \
match<expr##OP< expr_lit<float>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<float>, code >> (res) || \
match<expr##OP< expr_lit<const sym &>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<const sym &>, code >> (res) || \
match<expr##OP< expr_lit<decltype(nullptr)>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<decltype(nullptr)>, code >> (res) || \
match<expr##OP< expr_lit<unsigned>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<unsigned>, code >> (res) || \
match<expr##OP< expr_lit<const string &>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<const string &>, code >> (res) || \
match<expr##OP< expr_tmp, expr_lit<long long> >> (res) || \
match<expr##OP< expr_tmp, expr_lit<double> >> (res) || \
match<expr##OP< expr_tmp, expr_lit<float> >> (res) || \
match<expr##OP< expr_tmp, expr_lit<const sym &> >> (res) || \
match<expr##OP< expr_tmp, expr_lit<decltype(nullptr)> >> (res) || \
match<expr##OP< expr_tmp, expr_lit<unsigned> >> (res) || \
match<expr##OP< expr_tmp, expr_lit<const string &> >> (res) || \
match<expr##OP< expr_tmp, expr_tmp >> (res) || \
match<expr##OP< expr_tmp, code >> (res) || \
match<expr##OP< code, expr_lit<long long> >> (res) || \
match<expr##OP< code, expr_lit<double> >> (res) || \
match<expr##OP< code, expr_lit<float> >> (res) || \
match<expr##OP< code, expr_lit<const sym &> >> (res) || \
match<expr##OP< code, expr_lit<decltype(nullptr)> >> (res) || \
match<expr##OP< code, expr_lit<unsigned> >> (res) || \
match<expr##OP< code, expr_lit<const string &> >> (res) || \
match<expr##OP< code, expr_tmp >> (res) || \
match<expr##OP< code, code >> (res) ||
MNL_M(_eq) MNL_M(_ne)
# undef MNL_M
# define MNL_M(OP) \
match<expr##OP< expr_lit<long long>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<long long>, code >> (res) || \
match<expr##OP< expr_lit<double>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<double>, code >> (res) || \
match<expr##OP< expr_lit<float>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<float>, code >> (res) || \
match<expr##OP< expr_lit<unsigned>, expr_tmp >> (res) || \
match<expr##OP< expr_lit<unsigned>, code >> (res) || \
match<expr##OP< expr_tmp, expr_lit<long long> >> (res) || \
match<expr##OP< expr_tmp, expr_lit<double> >> (res) || \
match<expr##OP< expr_tmp, expr_lit<float> >> (res) || \
match<expr##OP< expr_tmp, expr_lit<unsigned> >> (res) || \
match<expr##OP< expr_tmp, expr_tmp >> (res) || \
match<expr##OP< expr_tmp, code >> (res) || \
match<expr##OP< code, expr_lit<long long> >> (res) || \
match<expr##OP< code, expr_lit<double> >> (res) || \
match<expr##OP< code, expr_lit<float> >> (res) || \
match<expr##OP< code, expr_lit<unsigned> >> (res) || \
match<expr##OP< code, expr_tmp >> (res) || \
match<expr##OP< code, code >> (res) ||
MNL_M(_lt) MNL_M(_le) MNL_M(_gt) MNL_M(_ge) MNL_M(_add) MNL_M(_sub) MNL_M(_mul)
# undef MNL_M
# define MNL_M(OP) \
match<expr##OP< expr_tmp, expr_tmp >> (res) || \
match<expr##OP< expr_tmp, code >> (res) || \
match<expr##OP< code, expr_tmp >> (res) || \
match<expr##OP< code, code >> (res) || \
MNL_M(_xor)
# undef MNL_M
match<expr_apply2< expr_lit<const sym &>, expr_lit<>, expr_tmp >> (res) ||
match<expr_apply2< expr_lit<const sym &>, expr_lit<>, code >> (res) ||
match<expr_apply2< expr_lit<const sym &>, expr_tmp, expr_lit<> >> (res) ||
match<expr_apply2< expr_lit<const sym &>, expr_tmp, expr_tmp >> (res) ||
match<expr_apply2< expr_lit<const sym &>, expr_tmp, code >> (res) ||
match<expr_apply2< expr_lit<const sym &>, code, expr_lit<> >> (res) ||
match<expr_apply2< expr_lit<const sym &>, code, expr_tmp >> (res) ||
match<expr_apply2< expr_lit<const sym &>, code, code >> (res) ||
match<expr_apply2< expr_lit<>, expr_tmp, expr_lit<const sym &> >> (res) ||
match<expr_apply2< expr_lit<>, expr_tmp, expr_tmp >> (res) ||
match<expr_apply2< expr_lit<>, expr_tmp, code >> (res) ||
match<expr_apply2< expr_lit<>, code, expr_lit<const sym &> >> (res) ||
match<expr_apply2< expr_lit<>, code, expr_tmp >> (res) ||
match<expr_apply2< expr_lit<>, code, code >> (res) ||
match<expr_apply2< expr_tmp, expr_tmp, expr_lit<const sym &> >> (res) ||
match<expr_apply2< expr_tmp, expr_tmp, expr_tmp >> (res) ||
match<expr_apply2< expr_tmp, expr_tmp, code >> (res) ||
match<expr_apply2< expr_tmp, code, expr_lit<const sym &> >> (res) ||
match<expr_apply2< expr_tmp, code, expr_tmp >> (res) ||
match<expr_apply2< expr_tmp, code, code >> (res) ||
match<expr_apply2< code, expr_tmp, expr_lit<const sym &> >> (res) ||
match<expr_apply2< code, expr_tmp, expr_tmp >> (res) ||
match<expr_apply2< code, expr_tmp, code >> (res) ||
match<expr_apply2< code, code, expr_lit<const sym &> >> (res) ||
match<expr_apply2< code, code, expr_tmp >> (res) ||
match<expr_apply2< code, code, code >> (res);
# endif // # ifdef MNL_WITH_OPTIMIZE
return res;
}
}} // namespace MNL_AUX_UUID::aux
Loading

0 comments on commit f85ebf9

Please sign in to comment.