Raise dead on `nitc`.
It's super effective...
Pull-Request: #1000
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
src/*.dat
src/*.gnu
src/*.bin
-src/nitg_0
+src/nitc_0
c_src/*.o
c_src/*.cksum
benchmarks/ Script to bench the compilers
bin/ The Nit tools
bin/nitc The Nit compiler
- bin/nitg The new Nit compiler
bin/nit The Nit interpreter
bin/nitdoc The Nit autodoc
c_src/ C code of nitc (needed to bootstrap)
*.png
*.xml
index.html
-nitg
+nitc
local title=$1
shift
if test -n "$fast"; then
- run_command "$@" ../src/nitg.nit -o "nitg.$title.bin"
- bench_command "nitg-g" "nitg --global ../src/test_parser.nit" "./nitg.$title.bin" -v --global --no-cc ../src/test_parser.nit
+ run_command "$@" ../src/nitc.nit -o "nitc.$title.bin"
+ bench_command "nitc-g" "nitc --global ../src/test_parser.nit" "./nitc.$title.bin" -v --global --no-cc ../src/test_parser.nit
run_command "$@" ../src/nit.nit -o "nit.$title.bin"
bench_command "nit" "nit ../src/test_parser.nit ../src/location.nit" "./nit.$title.bin" -v ../src/test_parser.nit -- -n ../src/location.nit
run_command "$@" ../examples/shoot/src/shoot_logic.nit -o "shoot.$title.bin"
run_command "$@" ../tests/bench_bintree_gen.nit -o "bintrees.$title.bin"
bench_command "bintrees" "bench_bintree_gen 16" "./bintrees.$title.bin" 16
else
- run_command "$@" ../src/nitg.nit -o "nitg.$title.bin"
- bench_command "nitg-g" "nitg --global --no-cc ../src/nitls.nit" "./nitg.$title.bin" -v --global --no-cc ../src/nitls.nit
- bench_command "nitg-s" "nitg --separate ../src/nitg.nit" "./nitg.$title.bin" -v --no-cc --separate ../src/nitg.nit
+ run_command "$@" ../src/nitc.nit -o "nitc.$title.bin"
+ bench_command "nitc-g" "nitc --global --no-cc ../src/nitls.nit" "./nitc.$title.bin" -v --global --no-cc ../src/nitls.nit
+ bench_command "nitc-s" "nitc --separate ../src/nitc.nit" "./nitc.$title.bin" -v --no-cc --separate ../src/nitc.nit
run_command "$@" ../src/nit.nit -o "nit.$title.bin"
bench_command "nit" "nit ../src/test_parser.nit ../src/nitls.nit" "./nit.$title.bin" -v ../src/test_parser.nit -- -n ../src/nitls.nit
run_command "$@" ../src/nitdoc.nit -o "nitdoc.$title.bin"
## COMPILE ENGINES
-# get the bootstrapped nitg
-cp ../bin/nitg .
+# get the bootstrapped nitc
+cp ../bin/nitc .
## EFFECTIVE BENCHS ##
{
name="$FUNCNAME"
skip_test "$name" && return
- prepare_res "$name-nitg.dat" "nitg-g" "Various steps of nitg --global"
- bench_command "parse" "" ./nitg --global --only-parse ../src/nitg.nit
- bench_command "metamodel" "" ./nitg --global --only-metamodel ../src/nitg.nit
- bench_command "generate c" "" ./nitg --global --no-cc ../src/nitg.nit
- bench_command "full" "" ./nitg --global ../src/nitg.nit -o "nitg_nitg.bin"
-
- prepare_res "$name-nitg-s.dat" "nitg-s" "Various steps of nitg --separate"
- bench_command "parse" "" ./nitg --separate --only-parse ../src/nitg.nit
- bench_command "metamodel" "" ./nitg --separate --only-metamodel ../src/nitg.nit
- bench_command "generate c" "" ./nitg --separate --no-cc ../src/nitg.nit
- bench_command "full" "" ./nitg --separate ../src/nitg.nit -o "nitg_nitg-e.bin"
-
- prepare_res "$name-nitg-e.dat" "nitg-e" "Various steps of nitg --erasure"
- bench_command "parse" "" ./nitg --erasure --only-parse ../src/nitg.nit
- bench_command "metamodel" "" ./nitg --erasure --only-metamodel ../src/nitg.nit
- bench_command "generate c" "" ./nitg --erasure --no-cc ../src/nitg.nit
- bench_command "full" "" ./nitg --erasure ../src/nitg.nit -o "nitg_nitg-e.bin"
+ prepare_res "$name-nitc.dat" "nitc-g" "Various steps of nitc --global"
+ bench_command "parse" "" ./nitc --global --only-parse ../src/nitc.nit
+ bench_command "metamodel" "" ./nitc --global --only-metamodel ../src/nitc.nit
+ bench_command "generate c" "" ./nitc --global --no-cc ../src/nitc.nit
+ bench_command "full" "" ./nitc --global ../src/nitc.nit -o "nitc_nitc.bin"
+
+ prepare_res "$name-nitc-s.dat" "nitc-s" "Various steps of nitc --separate"
+ bench_command "parse" "" ./nitc --separate --only-parse ../src/nitc.nit
+ bench_command "metamodel" "" ./nitc --separate --only-metamodel ../src/nitc.nit
+ bench_command "generate c" "" ./nitc --separate --no-cc ../src/nitc.nit
+ bench_command "full" "" ./nitc --separate ../src/nitc.nit -o "nitc_nitc-e.bin"
+
+ prepare_res "$name-nitc-e.dat" "nitc-e" "Various steps of nitc --erasure"
+ bench_command "parse" "" ./nitc --erasure --only-parse ../src/nitc.nit
+ bench_command "metamodel" "" ./nitc --erasure --only-metamodel ../src/nitc.nit
+ bench_command "generate c" "" ./nitc --erasure --no-cc ../src/nitc.nit
+ bench_command "full" "" ./nitc --erasure ../src/nitc.nit -o "nitc_nitc-e.bin"
plot "$name.gnu"
}
bench_steps
# $#: options to compare
-function bench_nitg-g_options()
+function bench_nitc-g_options()
{
tag=$1
shift
name="$FUNCNAME-$tag"
skip_test "$name" && return
- prepare_res "$name.dat" "no options" "nitg-g without options"
- run_compiler "nitg-g" ./nitg --global
+ prepare_res "$name.dat" "no options" "nitc-g without options"
+ run_compiler "nitc-g" ./nitc --global
if test "$1" = NOALL; then
shift
elif test -n "$2"; then
- prepare_res "$name-all.dat" "all" "nitg-g with all options $@"
- run_compiler "nitg-g-$tag" ./nitg --global $@
+ prepare_res "$name-all.dat" "all" "nitc-g with all options $@"
+ run_compiler "nitc-g-$tag" ./nitc --global $@
fi
for opt in "$@"; do
ot=${opt// /+}
- prepare_res "$name$ot.dat" "$opt" "nitg-g with option $opt"
- run_compiler "nitg-g$ot" ./nitg --global $opt
+ prepare_res "$name$ot.dat" "$opt" "nitc-g with option $opt"
+ run_compiler "nitc-g$ot" ./nitc --global $opt
done
plot "$name.gnu"
}
-bench_nitg-g_options "slower" --hardening --no-shortcut-range
-bench_nitg-g_options "nocheck" --no-check-null --no-check-autocast --no-check-attr-isset --no-check-covariance --no-check-assert
+bench_nitc-g_options "slower" --hardening --no-shortcut-range
+bench_nitc-g_options "nocheck" --no-check-null --no-check-autocast --no-check-attr-isset --no-check-covariance --no-check-assert
-function bench_nitg-s_options()
+function bench_nitc-s_options()
{
tag=$1
shift
name="$FUNCNAME-$tag"
skip_test "$name" && return
- prepare_res "$name.dat" "no options" "nitg-s without options"
- run_compiler "nitg-s" ./nitg --separate
+ prepare_res "$name.dat" "no options" "nitc-s without options"
+ run_compiler "nitc-s" ./nitc --separate
if test "$1" = NOALL; then
shift
elif test -n "$2"; then
- prepare_res "$name-all.dat" "all" "nitg-s with all options $@"
- run_compiler "nitg-s-$tag" ./nitg --separate $@
+ prepare_res "$name-all.dat" "all" "nitc-s with all options $@"
+ run_compiler "nitc-s-$tag" ./nitc --separate $@
fi
for opt in "$@"; do
ot=${opt// /+}
- prepare_res "$name-$ot.dat" "$opt" "nitg-s with option $opt"
- run_compiler "nitg-s$ot" ./nitg --separate $opt
+ prepare_res "$name-$ot.dat" "$opt" "nitc-s with option $opt"
+ run_compiler "nitc-s$ot" ./nitc --separate $opt
done
plot "$name.gnu"
}
-bench_nitg-s_options "slower" --hardening --no-shortcut-equal --no-union-attribute --no-shortcut-range --no-inline-intern "--no-gcc-directive likely --no-gcc-directive noreturn"
-bench_nitg-s_options "nocheck" --no-check-null --no-check-autocast --no-check-attr-isset --no-check-covariance --no-check-assert
-bench_nitg-s_options "faster" --skip-dead-methods --inline-coloring-numbers --inline-some-methods --direct-call-monomorph "--inline-some-methods --direct-call-monomorph" ""
+bench_nitc-s_options "slower" --hardening --no-shortcut-equal --no-union-attribute --no-shortcut-range --no-inline-intern "--no-gcc-directive likely --no-gcc-directive noreturn"
+bench_nitc-s_options "nocheck" --no-check-null --no-check-autocast --no-check-attr-isset --no-check-covariance --no-check-assert
+bench_nitc-s_options "faster" --skip-dead-methods --inline-coloring-numbers --inline-some-methods --direct-call-monomorph "--inline-some-methods --direct-call-monomorph" ""
-function bench_nitg-e_options()
+function bench_nitc-e_options()
{
tag=$1
shift
name="$FUNCNAME-$tag"
skip_test "$name" && return
- prepare_res "$name.dat" "no options" "nitg-e without options"
- run_compiler "nitg-e" ./nitg --erasure
+ prepare_res "$name.dat" "no options" "nitc-e without options"
+ run_compiler "nitc-e" ./nitc --erasure
if test "$1" = NOALL; then
shift
elif test -n "$2"; then
- prepare_res "$name-all.dat" "all" "nitg-e with all options $@"
- run_compiler "nitg-e-$tag" ./nitg --erasure $@
+ prepare_res "$name-all.dat" "all" "nitc-e with all options $@"
+ run_compiler "nitc-e-$tag" ./nitc --erasure $@
fi
for opt in "$@"; do
ot=${opt// /+}
- prepare_res "$name$ot.dat" "$opt" "nitg-e with option $opt"
- run_compiler "nitg-e$ot" ./nitg --erasure $opt
+ prepare_res "$name$ot.dat" "$opt" "nitc-e with option $opt"
+ run_compiler "nitc-e$ot" ./nitc --erasure $opt
done
plot "$name.gnu"
}
-bench_nitg-e_options "slower" --hardening --no-shortcut-equal --no-union-attribute --no-shortcut-range --no-inline-intern
-bench_nitg-e_options "nocheck" --no-check-null --no-check-autocast --no-check-attr-isset --no-check-covariance --no-check-assert --no-check-erasure-cast
-bench_nitg-e_options "faster" --skip-dead-methods --inline-coloring-numbers --inline-some-methods --direct-call-monomorph --rta
+bench_nitc-e_options "slower" --hardening --no-shortcut-equal --no-union-attribute --no-shortcut-range --no-inline-intern
+bench_nitc-e_options "nocheck" --no-check-null --no-check-autocast --no-check-attr-isset --no-check-covariance --no-check-assert --no-check-erasure-cast
+bench_nitc-e_options "faster" --skip-dead-methods --inline-coloring-numbers --inline-some-methods --direct-call-monomorph --rta
function bench_engines()
{
name="$FUNCNAME"
skip_test "$name" && return
- prepare_res "$name-nitg-s.dat" "nitg-s" "nitg with --separate"
- run_compiler "nitg-s" ./nitg --separate
- prepare_res "$name-nitg-e.dat" "nitg-e" "nitg with --erasure"
- run_compiler "nitg-e" ./nitg --erasure
- prepare_res "$name-nitg-sg.dat" "nitg-sg" "nitg with --separate --semi-global"
- run_compiler "nitg-sg" ./nitg --separate --semi-global
- prepare_res "$name-nitg-eg.dat" "nitg-eg" "nitg with --erasure --semi-global"
- run_compiler "nitg-eg" ./nitg --erasure --semi-global
- prepare_res "$name-nitg-egt.dat" "nitg-egt" "nitg with --erasure --semi-global --rta"
- run_compiler "nitg-egt" ./nitg --erasure --semi-global --rta
- prepare_res "$name-nitg-g.dat" "nitg-g" "nitg with --global"
- run_compiler "nitg-g" ./nitg --global
+ prepare_res "$name-nitc-s.dat" "nitc-s" "nitc with --separate"
+ run_compiler "nitc-s" ./nitc --separate
+ prepare_res "$name-nitc-e.dat" "nitc-e" "nitc with --erasure"
+ run_compiler "nitc-e" ./nitc --erasure
+ prepare_res "$name-nitc-sg.dat" "nitc-sg" "nitc with --separate --semi-global"
+ run_compiler "nitc-sg" ./nitc --separate --semi-global
+ prepare_res "$name-nitc-eg.dat" "nitc-eg" "nitc with --erasure --semi-global"
+ run_compiler "nitc-eg" ./nitc --erasure --semi-global
+ prepare_res "$name-nitc-egt.dat" "nitc-egt" "nitc with --erasure --semi-global --rta"
+ run_compiler "nitc-egt" ./nitc --erasure --semi-global --rta
+ prepare_res "$name-nitc-g.dat" "nitc-g" "nitc with --global"
+ run_compiler "nitc-g" ./nitc --global
plot "$name.gnu"
}
bench_engines
-function bench_nitg-e_gc()
+function bench_nitc-e_gc()
{
name="$FUNCNAME"
skip_test "$name" && return
- prepare_res "$name-nitg-e.dat" "nitg-e" "nitg with --erasure"
- run_compiler "nitg-e" ./nitg --erasure
- prepare_res "$name-nitg-e-malloc.dat" "nitg-e-malloc" "nitg with --erasure and malloc"
- NIT_GC_OPTION="malloc" run_compiler "nitg-e-malloc" ./nitg --erasure
- prepare_res "$name-nitg-e-large.dat" "nitg-e-large" "nitg with --erasure and large"
- NIT_GC_OPTION="large" run_compiler "nitg-e-large" ./nitg --erasure
+ prepare_res "$name-nitc-e.dat" "nitc-e" "nitc with --erasure"
+ run_compiler "nitc-e" ./nitc --erasure
+ prepare_res "$name-nitc-e-malloc.dat" "nitc-e-malloc" "nitc with --erasure and malloc"
+ NIT_GC_OPTION="malloc" run_compiler "nitc-e-malloc" ./nitc --erasure
+ prepare_res "$name-nitc-e-large.dat" "nitc-e-large" "nitc with --erasure and large"
+ NIT_GC_OPTION="large" run_compiler "nitc-e-large" ./nitc --erasure
plot "$name.gnu"
}
-bench_nitg-e_gc
+bench_nitc-e_gc
-function bench_cc_nitg-e()
+function bench_cc_nitc-e()
{
name="$FUNCNAME"
skip_test "$name" && return
for o in "gcc0:CC=\"ccache gcc\" CFLAGS=-O0" "cl0:CC=\"ccache clang\" CFLAGS=-O0" "gccs:CC=\"ccache gcc\" CFLAGS=-Os" "cls:CC=\"ccache clang\" CFLAGS=-Os" "gcc2:CC=\"ccache gcc\" CFLAGS=-O2" "cl2:CC=\"ccache clang\" CFLAGS=-O2" "gcc3:CC=\"ccache gcc\" CFLAGS=-O3" "cl3:CC=\"ccache clang\" CFLAGS=-O3"; do
f=`echo "$o" | cut -f1 -d:`
o=`echo "$o" | cut -f2 -d:`
- prepare_res "$name-nitg-e-$f.dat" "nitg-e-$f" "nitg with --erasure --make-flags $o"
- run_compiler "nitg-e-$f" ./nitg --erasure --make-flags "$o"
+ prepare_res "$name-nitc-e-$f.dat" "nitc-e-$f" "nitc with --erasure --make-flags $o"
+ run_compiler "nitc-e-$f" ./nitc --erasure --make-flags "$o"
done
plot "$name.gnu"
}
-bench_cc_nitg-e
+bench_cc_nitc-e
function bench_policy()
{
name="$FUNCNAME"
skip_test "$name" && return
- prepare_res "$name-nitg-s.dat" "nitg-s" "nitg with --separate"
- run_compiler "nitg-s" ./nitg --separate
- prepare_res "$name-nitg-e.dat" "nitg-e" "nitg with --erasure"
- run_compiler "nitg-e" ./nitg --erasure
- prepare_res "$name-nitg-su.dat" "nitg-su" "nitg with --separate --no-check-covariance"
- run_compiler "nitg-su" ./nitg --separate --no-check-covariance
- prepare_res "$name-nitg-eu.dat" "nitg-eu" "nitg with --erasure --no-check-covariance --no-check-erasure-cast"
- run_compiler "nitg-eu" ./nitg --erasure --no-check-covariance --no-check-erasure-cast
+ prepare_res "$name-nitc-s.dat" "nitc-s" "nitc with --separate"
+ run_compiler "nitc-s" ./nitc --separate
+ prepare_res "$name-nitc-e.dat" "nitc-e" "nitc with --erasure"
+ run_compiler "nitc-e" ./nitc --erasure
+ prepare_res "$name-nitc-su.dat" "nitc-su" "nitc with --separate --no-check-covariance"
+ run_compiler "nitc-su" ./nitc --separate --no-check-covariance
+ prepare_res "$name-nitc-eu.dat" "nitc-eu" "nitc with --erasure --no-check-covariance --no-check-erasure-cast"
+ run_compiler "nitc-eu" ./nitc --erasure --no-check-covariance --no-check-erasure-cast
plot "$name.gnu"
}
bench_policy
name="$FUNCNAME"
skip_test "$name" && return
prepare_res "$name-nitc.dat" "nitc" "nitc no options"
- run_compiler "nitc" ./nitg --separate
+ run_compiler "nitc" ./nitc --separate
prepare_res "$name-nitc-ni.dat" "nitc-ni" "nitc --no-check-attr-isset"
- run_compiler "nitc" ./nitg --separate --no-check-attr-isset
+ run_compiler "nitc" ./nitc --separate --no-check-attr-isset
prepare_res "$name-nitc-nu.dat" "nitc-nu" "nitc --no-union-attribute"
- run_compiler "nitc" ./nitg --separate --no-union-attribute
+ run_compiler "nitc" ./nitc --separate --no-union-attribute
prepare_res "$name-nitc-nu-ni.dat" "nitc-nu-ni" "nitc --no-union-attribute --no-check-attr-isset"
- run_compiler "nitc" ./nitg --separate --no-union-attribute --no-check-attr-isset
+ run_compiler "nitc" ./nitc --separate --no-union-attribute --no-check-attr-isset
plot "$name.gnu"
}
bench_nullables
{
name="$FUNCNAME"
skip_test "$name" && return
- prepare_res "$name-nitg-g.dat" "nitg-g" "nitg --global"
- for i in ../examples/hello_world.nit ../src/test_parser.nit ../src/nitg.nit; do
- bench_command `basename "$i" .nit` "" ./nitg --global "$i" --no-cc
+ prepare_res "$name-nitc-g.dat" "nitc-g" "nitc --global"
+ for i in ../examples/hello_world.nit ../src/test_parser.nit ../src/nitc.nit; do
+ bench_command `basename "$i" .nit` "" ./nitc --global "$i" --no-cc
done
- prepare_res "$name-nitg-s.dat" "nitg-s" "nitg --separate"
- for i in ../examples/hello_world.nit ../src/test_parser.nit ../src/nitg.nit; do
- bench_command `basename "$i" .nit` "" ./nitg --separate "$i" --no-cc
+ prepare_res "$name-nitc-s.dat" "nitc-s" "nitc --separate"
+ for i in ../examples/hello_world.nit ../src/test_parser.nit ../src/nitc.nit; do
+ bench_command `basename "$i" .nit` "" ./nitc --separate "$i" --no-cc
done
- prepare_res "$name-nitg-e.dat" "nitg-e" "nitg --erasure"
- for i in ../examples/hello_world.nit ../src/test_parser.nit ../src/nitg.nit; do
- bench_command `basename "$i" .nit` "" ./nitg --erasure "$i" --no-cc
+ prepare_res "$name-nitc-e.dat" "nitc-e" "nitc --erasure"
+ for i in ../examples/hello_world.nit ../src/test_parser.nit ../src/nitc.nit; do
+ bench_command `basename "$i" .nit` "" ./nitc --erasure "$i" --no-cc
done
plot "$name.gnu"
}
cd ../src
test -f ./nitc_3 || ./ncall.sh -O
cd ../benchmarks
-test -f ./nitg || ../src/nitc_3 ../src/nitg.nit -O -v
+test -f ./nitc || ../src/nitc_3 ../src/nitc.nit -O -v
## EFFECTIVE BENCHS ##
s=20
seq="2 4 8"
for b in $seq; do
- run_command ./nitg languages/$name.nit -o $basedir/$name.bin
+ run_command ./nitc languages/$name.nit -o $basedir/$name.bin
run_command $basedir/$name.bin $basedir "${t}_$b" "$b"
done
done
nitdir="${basedir}/nit"
- prepare_res $nitdir/$name-nitg.dat "nitg" "nitg"
+ prepare_res $nitdir/$name-nitc.dat "nitc" "nitc"
for b in $seq; do
- run_command ./nitg $nitdir/${t}_$b.nit --global -o "$nitdir/${t}_$b.nitg.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
- bench_command "$b" "" "$nitdir/${t}_$b.nitg.bin" $s
+ run_command ./nitc $nitdir/${t}_$b.nit --global -o "$nitdir/${t}_$b.nitc.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ bench_command "$b" "" "$nitdir/${t}_$b.nitc.bin" $s
done
- prepare_res $nitdir/$name-nitg-s.dat "nitg-s" "nitg-s"
+ prepare_res $nitdir/$name-nitc-s.dat "nitc-s" "nitc-s"
for b in $seq; do
- run_command ./nitg $nitdir/${t}_$b.nit --separate -o "$nitdir/${t}_$b.nitg-s.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
- bench_command "$b" "" "$nitdir/${t}_$b.nitg-s.bin" $s
+ run_command ./nitc $nitdir/${t}_$b.nit --separate -o "$nitdir/${t}_$b.nitc-s.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ bench_command "$b" "" "$nitdir/${t}_$b.nitc-s.bin" $s
done
<<XXX
- prepare_res $nitdir/$name-nitg-su.dat "nitg-su" "nitg-su"
+ prepare_res $nitdir/$name-nitc-su.dat "nitc-su" "nitc-su"
for b in $seq; do
- run_command ./nitg $nitdir/${t}_$b.nit --separate --no-check-covariance -o "$nitdir/${t}_$b.nitg-su.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
- bench_command "$b" "" "$nitdir/${t}_$b.nitg-su.bin" $s
+ run_command ./nitc $nitdir/${t}_$b.nit --separate --no-check-covariance -o "$nitdir/${t}_$b.nitc-su.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ bench_command "$b" "" "$nitdir/${t}_$b.nitc-su.bin" $s
done
- prepare_res $nitdir/$name-nitg-e.dat "nitg-e" "nitg-e"
+ prepare_res $nitdir/$name-nitc-e.dat "nitc-e" "nitc-e"
for b in $seq; do
- run_command ./nitg $nitdir/${t}_$b.nit --erasure -o "$nitdir/${t}_$b.nitg-e.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
- bench_command "$b" "" "$nitdir/${t}_$b.nitg-e.bin" $s
+ run_command ./nitc $nitdir/${t}_$b.nit --erasure -o "$nitdir/${t}_$b.nitc-e.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ bench_command "$b" "" "$nitdir/${t}_$b.nitc-e.bin" $s
done
- prepare_res $nitdir/$name-nitg-eu.dat "nitg-eu" "nitg-eu"
+ prepare_res $nitdir/$name-nitc-eu.dat "nitc-eu" "nitc-eu"
for b in $seq; do
- run_command ./nitg $nitdir/${t}_$b.nit --erasure --no-check-covariance --no-check-erasure-cast -o "$nitdir/${t}_$b.nitg-eu.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
- bench_command "$b" "" "$nitdir/${t}_$b.nitg-eu.bin" $s
+ run_command ./nitc $nitdir/${t}_$b.nit --erasure --no-check-covariance --no-check-erasure-cast -o "$nitdir/${t}_$b.nitc-eu.bin" --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ bench_command "$b" "" "$nitdir/${t}_$b.nitc-eu.bin" $s
done
XXX
echo "*** Benching Array.to_s performance ***"
fi
- ../bin/nitg --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_flatstr.nit -m ../lib/standard/ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_flatstr.nit -m ../lib/standard/ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res arr_tos_ropes.out arr_tos_ropes ropes
if $verbose; then
bench_command $i ropes$i ./array_tos --loops $2 --strlen $i --ccts $1 "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_flatstr.nit -m ../lib/standard/ropes.nit -m ../lib/buffered_ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_flatstr.nit -m ../lib/standard/ropes.nit -m ../lib/buffered_ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res arr_tos_buf_ropes.out arr_tos_buf_ropes buffered_ropes
if $verbose; then
bench_command $i buf_ropes$i ./array_tos --loops $2 --strlen $i --ccts $1 "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_flatstr.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_flatstr.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res arr_tos_flat.out arr_tos_flat flatstring
if $verbose; then
bench_command $i flatstring$i ./array_tos --loops $2 --strlen $i --ccts $1 "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_buffer.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_buffer.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res arr_tos_buf.out arr_tos_buf flatbuffer
if $verbose; then
bench_command $i flatbuffer$i ./array_tos --loops $2 --strlen $i --ccts $1 "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_manual.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_manual.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res arr_tos_man.out arr_tos_man memmove
if $verbose; then
bench_command $i memmove$i ./array_tos --loops $2 --strlen $i --ccts $1 "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_man_buf.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_man_buf.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res arr_tos_man_buf.out arr_tos_man_buf flatbuf_with_capacity
if $verbose; then
bench_command $i flatbuf_with_capacity$i ./array_tos --loops $2 --strlen $i --ccts $1 "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_rope_buf.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/array_tos.nit -m ./strings/array_to_s_vars/array_to_s_rope_buf.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res arr_tos_rope_buf.out arr_tos_rope_buf ropebuf
if $verbose; then
function bench_concat()
{
- ../bin/nitg --global ./strings/chain_concat.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
- ../bin/nitg --global ./strings/utf_chain_concat.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/chain_concat.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/utf_chain_concat.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
if $verbose; then
echo "*** Benching concat performance ***"
bench_command $i flatstr_utf8_noindex$i ./utf_chain_concat -m flatstr_utf8_noindex --loops $2 --strlen $3 --ccts $i "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/chain_concat.nit -m ../lib/standard/ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/chain_concat.nit -m ../lib/standard/ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res concat_ropes.out concat_ropes ropes
if $verbose; then
bench_command $i ropes$i ./chain_concat -m flatstr --loops $2 --strlen $3 --ccts $i "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/chain_concat.nit -m ../lib/standard/ropes.nit -m ../lib/buffered_ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/chain_concat.nit -m ../lib/standard/ropes.nit -m ../lib/buffered_ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res concat_buf_ropes.out concat_buf_ropes buffered_ropes
if $verbose; then
bench_command $i buf_ropes$i ./chain_concat -m flatstr --loops $2 --strlen $3 --ccts $i "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/chain_cct_ropebuf.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/chain_cct_ropebuf.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res cct_buf_ropes.out cct_buf_ropes cctbuf_ropes
if $verbose; then
echo "*** Benching iteration performance ***"
fi
- ../bin/nitg --global ./strings/iteration_bench.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
- ../bin/nitg --global ./strings/utf_iteration_bench.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/iteration_bench.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/utf_iteration_bench.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res iter_flat_iter.out iter_flat_iter flatstring_iter
if $verbose; then
bench_command $i flatstr_index_utf8_noindex$i ./utf_iteration_bench -m flatstr_utf8_noindex --iter-mode index --loops $2 --strlen $3 --ccts $i "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/iteration_bench.nit -m ../lib/standard/ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/iteration_bench.nit -m ../lib/standard/ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res iter_ropes_iter.out iter_ropes_iter ropes_iter
if $verbose; then
bench_command $i ropes_index$i ./iteration_bench -m flatstr --iter-mode index --loops $2 --strlen $3 --ccts $i "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/iteration_bench.nit -m ../lib/standard/ropes.nit -m ../lib/buffered_ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/iteration_bench.nit -m ../lib/standard/ropes.nit -m ../lib/buffered_ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res iter_buf_ropes_iter.out iter_buf_ropes_iter buf_ropes_iter
if $verbose; then
echo "*** Benching substring performance ***"
fi
- ../bin/nitg --global ./strings/substr_bench.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
- ../bin/nitg --global ./strings/utf_substr_bench.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/substr_bench.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/utf_substr_bench.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res substr_flat.out substr_flat flatstring
if $verbose; then
bench_command $i flatstring_utf8_noindex$i ./utf_substr_bench -m flatstr_utf8_noindex --loops $2 --strlen $3 --ccts $i "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/substr_bench.nit -m ../lib/standard/ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/substr_bench.nit -m ../lib/standard/ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res substr_ropes.out substr_ropes ropes
if $verbose; then
bench_command $i ropes$i ./substr_bench -m flatstr --loops $2 --strlen $3 --ccts $i "NIT_GC_CHOOSER=large"
done
- ../bin/nitg --global ./strings/substr_bench.nit -m ../lib/standard/ropes.nit -m ../lib/buffered_ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
+ ../bin/nitc --global ./strings/substr_bench.nit -m ../lib/standard/ropes.nit -m ../lib/buffered_ropes.nit --make-flags "CFLAGS=\"-g -O2 -DNOBOEHM\""
prepare_res substr_buf_ropes.out substr_buf_ropes buf_ropes
if $verbose; then
+++ /dev/null
-#!/bin/bash
-dir=`dirname "$BASH_SOURCE"`
-exec "$dir/nitg" "$@"
--- /dev/null
+#!/bin/bash
+self=`readlink /proc/$$/fd/255`
+dir=`dirname "$self"`
+exec "$dir/nitc" "$@"
server:
mkdir -p bin/
- ../../bin/nitg --dir bin/ src/benitlux_daily.nit src/benitlux_web.nit
+ ../../bin/nitc --dir bin/ src/benitlux_daily.nit src/benitlux_web.nit
src/benitlux_serial.nit:
../../bin/nitserial -o $@ src/benitlux_web.nit
Example:
~~~
-nitg ./brainfuck.nit
+nitc ./brainfuck.nit
./brainfuck ./examples/hello.bf
~~~
linux:
mkdir -p bin
- ../../bin/nitg -o bin/friendz src/friendz_linux.nit
+ ../../bin/nitc -o bin/friendz src/friendz_linux.nit
android:
mkdir -p bin
- ../../bin/nitg -o bin/friendz.apk src/friendz_android.nit
+ ../../bin/nitc -o bin/friendz.apk src/friendz_android.nit
doc:
mkdir -p doc
default:
mkdir -p bin
- ../../bin/nitg -o bin/github_search_for_jni src/github_search_for_jni.nit
+ ../../bin/nitc -o bin/github_search_for_jni src/github_search_for_jni.nit
bins:
mkdir -p bin
- ../../bin/nitg --dir bin src/svg_to_png_and_nit.nit src/svg_to_icons.nit
+ ../../bin/nitc --dir bin src/svg_to_png_and_nit.nit src/svg_to_icons.nit
tests: test-dino test-app
linux:
mkdir -p bin
- ../../../../bin/nitg -o bin/s2pn src/s2pn_linux.nit
+ ../../../../bin/nitc -o bin/s2pn src/s2pn_linux.nit
android:
mkdir -p bin
- ../../../../bin/nitg -o bin/s2pn.apk src/s2pn_android.nit
+ ../../../../bin/nitc -o bin/s2pn.apk src/s2pn_android.nit
images:
mkdir -p assets/images
mkdir -p bin
make -C ../nitcc
../nitcc/src/nitcc ./grammar/javap.sablecc
- ../../bin/nitg ./src/jwrapper.nit -o ./bin/jwrapper
+ ../../bin/nitc ./src/jwrapper.nit -o ./bin/jwrapper
mv *.nit ./src/
mkdir -p gen
mv javap* ./gen/
# See the License for the specific language governing permissions and
# limitations under the License.
-NITG=../../bin/nitg
+NITG=../../bin/nitc
NITG_FLAGS=--dir bin
NEO4J_DIR=/var/lib/neo4j
OLD_PWD=${PWD}
## Installation
-Ensure that you have a working version of `nitg` in `../../bin` then run `make`
+Ensure that you have a working version of `nitc` in `../../bin` then run `make`
in the present directory. The executable will be then generated at
`bin/neo_doxygen`.
To compile and run the tester:
- nitg file_test_parser.nit
+ nitc file_test_parser.nit
./file_test_parser an_input_file_to_parse
## Examples and regression tests
-NITC=../../../bin/nitg
+NITC=../../../bin/nitc
all: nitcc calc minilang
all:
mkdir -p bin/
- ../../bin/nitg src/nitester.nit -o bin/nitester
+ ../../bin/nitc src/nitester.nit -o bin/nitester
ACE_BUILDS ?= ../../../ace-builds/
default:
- ../../bin/nitg --semi-global sources/nit/pnacl_nit.nit -I ../../src/
+ ../../bin/nitc --semi-global sources/nit/pnacl_nit.nit -I ../../src/
cp pnacl_nit/pnacl_nit.pexe www/pnacl/ -f
rm -rf pnacl_nit/
rm -rf .nit_compile
all:
mkdir -p bin/
- ../../bin/nitg --dir bin/ src/opportunity_web.nit
+ ../../bin/nitc --dir bin/ src/opportunity_web.nit
bin/pep8analysis:
mkdir -p bin
- ../../bin/nitg -o bin/pep8analysis src/pep8analysis.nit
+ ../../bin/nitc -o bin/pep8analysis src/pep8analysis.nit
doc/index.html:
../../bin/nitdoc src/pep8analysis.nit
bin/pep8analysis --cfg-long tests/privat/*.pep tests/micro/*.pep tests/terrasa/*.pep
www/pep8analysis.js:
- ../../bin/nitg -o www/pep8analysis.js --semi-global src/pep8analysis_web.nit
+ ../../bin/nitc -o www/pep8analysis.js --semi-global src/pep8analysis_web.nit
mkdir -p www/samples
cp tests/micro/*.pep tests/privat/02-fibo.pep tests/privat/06-calc-non-pur.pep www/samples
build:
mkdir -p bin/
- ../../bin/nitg -o bin/sort_downloads src/sort_downloads.nit
+ ../../bin/nitc -o bin/sort_downloads src/sort_downloads.nit
install:
install bin/sort_downloads /usr/local/bin/
all:
mkdir -p bin/
- ../../bin/nitg --dir bin src/tnitter.nit
+ ../../bin/nitc --dir bin src/tnitter.nit
all:
mkdir -p bin/
- ../../bin/nitg --dir bin/ src/calculator_gtk.nit src/calculator_test.nit
+ ../../bin/nitc --dir bin/ src/calculator_gtk.nit src/calculator_test.nit
android:
mkdir -p bin/ res/
../../contrib/inkscape_tools/bin/svg_to_icons art/icon.svg --android --out res/
- ../../bin/nitg -o bin/calculator.apk src/calculator_android.nit
+ ../../bin/nitc -o bin/calculator.apk src/calculator_android.nit
emscripten:
- ../../../bin/nitg -o www/fibonacci.js ../../fibonacci.nit -m emscripten
+ ../../../bin/nitc -o www/fibonacci.js ../../fibonacci.nit -m emscripten
emscripten:
- ../../../bin/nitg -o www/hello_world.js ../../hello_world.nit -m emscripten
+ ../../../bin/nitc -o www/hello_world.js ../../hello_world.nit -m emscripten
android: icon
mkdir -p bin
- ../../bin/nitg -o bin/ballz.apk src/ballz_android.nit
+ ../../bin/nitc -o bin/ballz.apk src/ballz_android.nit
icon: ../../contrib/inkscape_tools/bin/svg_to_icons
mkdir -p res
linux:
mkdir -p bin
- ../../bin/nitg -o bin/dino src/dino_linux.nit
+ ../../bin/nitc -o bin/dino src/dino_linux.nit
android: android-icons
mkdir -p bin
- ../../bin/nitg -o bin/dino.apk src/dino_android.nit
+ ../../bin/nitc -o bin/dino.apk src/dino_android.nit
../../contrib/inkscape_tools/bin/svg_to_icons:
$(MAKE) -C ../../contrib/inkscape_tools
linux:
mkdir -p bin
- ../../bin/nitg -o bin/moles src/moles_linux.nit
+ ../../bin/nitc -o bin/moles src/moles_linux.nit
android: android-icons
mkdir -p bin
- ../../bin/nitg -o bin/moles.apk src/moles_android.nit
+ ../../bin/nitc -o bin/moles.apk src/moles_android.nit
../../contrib/inkscape_tools/bin/svg_to_icons:
$(MAKE) -C ../../contrib/inkscape_tools
linux:
mkdir -p bin
- ../../bin/nitg -o bin/simple src/simple_linux.nit
+ ../../bin/nitc -o bin/simple src/simple_linux.nit
android:
mkdir -p bin
- ../../bin/nitg -o bin/simple.apk src/complete_simple_android.nit
+ ../../bin/nitc -o bin/simple.apk src/complete_simple_android.nit
clean:
rm -rf bin
bin/mpi_simple:
mkdir -p bin/
- ../../bin/nitg src/mpi_simple.nit -o bin/mpi_simple
+ ../../bin/nitc src/mpi_simple.nit -o bin/mpi_simple
run:
mpiexec.openmpi --hostfile hosts bin/mpi_simple
all:
mkdir -p bin/
- ../../bin/nitg --dir bin src/nitcorn_hello_world.nit src/file_server_on_port_80.nit
+ ../../bin/nitc --dir bin src/nitcorn_hello_world.nit src/file_server_on_port_80.nit
xymus.net:
mkdir -p bin/
- ../../bin/nitg --dir bin/ -I ../../contrib/tnitter/src/ -I ../../contrib/benitlux/src/ -I ../../contrib/opportunity/src/ src/xymus_net.nit
+ ../../bin/nitc --dir bin/ -I ../../contrib/tnitter/src/ -I ../../contrib/benitlux/src/ -I ../../contrib/opportunity/src/ src/xymus_net.nit
default:
- ../../../bin/nitg --semi-global converter.nit
+ ../../../bin/nitc --semi-global converter.nit
HTTPD_PY := python $(NACL_SDK_ROOT)/tools/httpd.py
serve:
2. Declare the environment variable NACL_SDK_ROOT as the root of the target platform within the SDK (ex: ~/nacl_sdk/pepper_34/) :
$ export NACL_SDK_ROOT=/path/to/nacl_sdk/pepper_[your_version]
-3. Compile the Nit code with: `nitg --semi-global converter.nit` or `make`.
+3. Compile the Nit code with: `nitc --semi-global converter.nit` or `make`.
You must use the '--semi-global' (or `--global`) option. Some features in the standard library are not supported by the NaCL platform, the global compiler do not try to compile them.
android:
mkdir -p bin/ res/
../../../contrib/inkscape_tools/bin/svg_to_icons art/icon.svg --android --out res/
- ../../../bin/nitg --dir bin/ src/ui_test.nit
+ ../../../bin/nitc --dir bin/ src/ui_test.nit
adb install -r bin/ui_test.apk
install: android
# Platform for the _emscripten_ framework
#
-# Importing this module from your project will tell _nitg_ to compile
+# Importing this module from your project will tell `nitg` to compile
# to JavaScript for the _emscripten_ framework.
module emscripten is platform
all:
mkdir -p bin/
- ../../../../bin/nitg -o bin/minimal src/minimal.nit
+ ../../../../bin/nitc -o bin/minimal src/minimal.nit
# and setup a new `complete` for the command
eval "$($1 --bash-completion)"
- # Special case for `nitc` that uses the completion of `nitg`
- if test "$cmd" = "nitc"; then
- cmd=nitg
- complete -F _nitg -o default nitc
+ # Special case for `nitg` that uses the completion of `nitc`
+ if test "$cmd" = "nitg"; then
+ cmd=nitc
+ complete -F _nitc -o default nitg
fi
if [[ $(type -t _$cmd) == function ]]; then
Once generated, manpages can then be checked individually with `man -l`
~~~
-man -l man1/nitg.1
+man -l man1/nitc.1
~~~
For global access, one can set the `MANPATH` environment variable to this `man` directory (not the `man1` subdirectory).
~~~
export MANPATH=/path/to/nit/share/man:$MANPATH
-man nitg
+man nitc
~~~
+++ /dev/null
-nitg.1
\ No newline at end of file
The behavior of the interpreter may differs slightly from the compiler.
First, the interpreted is the reference implementation for the specification of the Nit language.
-That means if `nitg` and `nit` have a different behavior on a same program, it is likely that `nit` is right and `nitg` is wrong.
+That means if `nitc` and `nit` have a different behavior on a same program, it is likely that `nit` is right and `nitc` is wrong.
Second, the FFI is not yet implemented in the interpreter.
Only a subset of the standard methods are implemented with some hard-coded behaviors.
While it is enough to use most of the standard library, a lot of additional libraries may not be usable by the interpreter.
-Last, `nit` is the *Naive Interpretation Tool*, it means that it is slow and may take an average of 50.000% in overhead comparatively to `nitg`(it also means that `nitg` is fast).
+Last, `nit` is the *Naive Interpretation Tool*, it means that it is slow and may take an average of 50.000% in overhead comparatively to `nitc`(it also means that `nitc` is fast).
In practice, the slowness is not an issue for simple Nit scripts;
-it is not a big deal if `nit` takes millisecond to execute programs even if `nitg` only need microseconds.
+it is not a big deal if `nit` takes millisecond to execute programs even if `nitc` only need microseconds.
# OPTIONS
-Most options are the same than `nitg(1)`.
+Most options are the same than `nitc(1)`.
Here, only the specific one are indicated.
Note that, unlike in other Nit tools, the options *MUST* be indicated before the main module of a program.
# NAME
-nitg - compiles Nit programs.
+nitc - compiles Nit programs.
# SYNOPSIS
-nitg [*options*] FILE...
+nitc [*options*] FILE...
# DESCRIPTION
-nitg is the current official Nit compiler.
+nitc is the current official Nit compiler.
It takes the main module of a Nit program as argument and produces an executable file.
By default, the generated executables are produced in the current directory.
(see `--dir` for details.)
-Internally, nitg rely on the presence of a C compiler. Usually gcc (but nitg was successfully tested with clang).
+Internally, nitc rely on the presence of a C compiler. Usually gcc (but nitc was successfully tested with clang).
A compilation directory is therefore created and (re-)used.
By default, the compilation directory is named `.nit_compile`.
(see `--compile-dir` for details.)
To improve the compilation time and simplify the compilation of multiple programs, more than one file can be given.
Each one will be compiled into a distinct executable.
- $ nitg prog1.nit prog2.nit
+ $ nitc prog1.nit prog2.nit
To combine files into a single program, use the `-m` option.
- $ nitg prog1.nit -m other_module.nit
+ $ nitc prog1.nit -m other_module.nit
-nitg can produces executables for various platforms when specific modules are used.
+nitc can produces executables for various platforms when specific modules are used.
Currently, android, pnacl and emscripten are supported.
See the documentation of these specific modules for details.
To show only `missing-doc` warnings in standard"
- $ nitg -q -w missing-doc standard
+ $ nitc -q -w missing-doc standard
To show all warnings and advices, except `missing-doc`:
- $ nitg -W -w no-missing-doc standard
+ $ nitc -W -w no-missing-doc standard
To show important warnings except `useless-type-test`, but not advice except `missing-doc`:
- $ nitg -w missing-doc -w no-useless-type-test standard
+ $ nitc -w missing-doc -w no-useless-type-test standard
`-q`, `--quiet`
: Do not show warnings.
`--stop-on-first-error`
: Just display the first encountered error then stop.
- By default, nitg tries to detect and display more than one error before aborting the compilation.
+ By default, nitc tries to detect and display more than one error before aborting the compilation.
`--no-color`
: Do not use color to display errors and warnings.
This option is mainly used to produce C files distributable then compilable on system that do not have a Nit compiler (e.g. embedded system).
In this case, it is suggested to also use the options `--dir`, `--compile-dir` and `--semi-global`.
- $ nitg examples/hello_world.nit --no-cc --dir hello --compile-dir hello --semi-global
+ $ nitc examples/hello_world.nit --no-cc --dir hello --compile-dir hello --semi-global
Will produce a `hello` directory that contains the required C files to finish the compilation.
Only the C files required for the program are generated.
A last usage is to develop programs as product lines with a main basic module (vanilla) and specific distinct features as flavor modules, then to combine them at compile-time.
- $ nitg prog_vanilla.nit -m feature_chocolate.nit -m feature_cherry.nit
+ $ nitc prog_vanilla.nit -m feature_chocolate.nit -m feature_cherry.nit
`-D`, `--define`
: Define a specific property.
The argument of the `-D` option is "{name}={value}".
For Bool, the argument can also be just "{name}", in this case, the value is considered to be `true`.
- $ nitg foo.nit -D prefix=/opt/foo -D port=8080 -D with_ssl
+ $ nitc foo.nit -D prefix=/opt/foo -D port=8080 -D with_ssl
`--release`
: Compile in release mode and finalize application.
## COMPILATION MODES
-`nitg` includes distinct compilation modes.
+`nitc` includes distinct compilation modes.
`--separate`
: Use separate compilation (default mode).
`--make-flags`
: Additional options to the `make` command.
- $ nitg foo.nit --make-flags 'CC=clang' --make-flags 'CFLAGS="-O0 -g"'
+ $ nitc foo.nit --make-flags 'CC=clang' --make-flags 'CFLAGS="-O0 -g"'
`--typing-test-metrics`
: Enable static and dynamic count of all type tests.
`NIT_GC_OPTION`
: Runtime control of the garbage collector.
- The behavior of the GC of the executables produced by nitg can be tuned with this environment variable.
+ The behavior of the GC of the executables produced by nitc can be tuned with this environment variable.
The environment variable is used when programs are executed, not when they are compiled.
Thus, you do not need to recompile programs in order to tweak their GC options.
NITCOPT=
OLDNITCOPT=
-OBJS=nitg nitpick nit nitdoc nitls nitunit nitpretty nitmetrics nitx nitlight nitdbg_client nitserial
+OBJS=nitc nitpick nit nitdoc nitls nitunit nitpretty nitmetrics nitx nitlight nitdbg_client nitserial
SRCS=$(patsubst %,%.nit,$(OBJS))
BINS=$(patsubst %,../bin/%,$(OBJS))
all: $(BINS)
-nitg_0: ../c_src/nitg parser/parser.nit
+nitc_0: ../c_src/nitg parser/parser.nit
@echo '***************************************************************'
- @echo '* Compile nitg_0 from NIT source files *'
+ @echo '* Compile nitc_0 from NIT source files *'
@echo '***************************************************************'
./git-gen-version.sh
- ../c_src/nitg ${OLDNITCOPT} -o nitg_0 -v nitg.nit
+ ../c_src/nitg ${OLDNITCOPT} -o nitc_0 -v nitc.nit
-$(BINS): nitg_0 parser/parser.nit
+$(BINS): nitc_0 parser/parser.nit
@echo '***************************************************************'
@echo '* Compile binaries from NIT source files *'
@echo '***************************************************************'
./git-gen-version.sh
- ./nitg_0 ${NITCOPT} -v --dir ../bin $(SRCS)
+ ./nitc_0 ${NITCOPT} -v --dir ../bin $(SRCS)
-$(OBJS): nitg_0 parser/parser.nit
+$(OBJS): nitc_0 parser/parser.nit
./git-gen-version.sh
- ./nitg_0 ${NITCOPT} -v $@.nit
+ ./nitc_0 ${NITCOPT} -v $@.nit
../c_src/nitg: ../c_src/*.c ../c_src/*.h ../c_src/Makefile
@echo '***************************************************************'
- @echo '* Compile nitg from C source files *'
+ @echo '* Compile nitc from C source files *'
@echo '***************************************************************'
cd ../c_src; make
cd parser; make
clean:
- rm -rf -- .nit_compile* version.nit nitg_0 2> /dev/null || true
+ rm -rf -- .nit_compile* version.nit nitc_0 2> /dev/null || true
cd parser; make clean
# Create a tool context to handle options and paths
var toolcontext = new ToolContext
-toolcontext.tooldescription = "Usage: nitg [OPTION]... file.nit...\nCompiles Nit programs."
+toolcontext.tooldescription = "Usage: nitc [OPTION]... file.nit...\nCompiles Nit programs."
# We do not add other options, so process them now!
toolcontext.process_options(args)
# Check c_src is up-to-date
make -C ../c_src
-# Compile nitg
-time ../c_src/nitg nitg.nit
+# Compile nitc
+time ../c_src/nitg nitc.nit
# delete old c_src
rm -rf ../c_src
#!/bin/sh
-# Regeneration of c_src from the current nitg
+# Regeneration of c_src from the current nitc
rm -r ../c_src
-./nitg nith.nit --semi-global --compile-dir ../c_src --output ../c_src/nitg --no-cc
+./nitc nith.nit --semi-global --compile-dir ../c_src --output ../c_src/nitg --no-cc
# Remove old compilation flags
sed -i -e 's/OLDNITCOPT=.*/OLDNITCOPT=/' Makefile
--- /dev/null
+#!/bin/bash
+# This file is part of NIT ( http://www.nitlanguage.org ).
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# nitc all
+# fully build, time and check nitc
+
+rm nitc nitc_? hello_world 2>/dev/null
+set -x
+set -e
+make -C ../c_src
+sh git-gen-version.sh
+time ../c_src/nitg nitc.nit -v -o nitc_0
+time ./nitc_0 nitc.nit -v "$@" -o nitc_2
+cp nitc_2 nitc
+time ./nitc_2 nitc.nit -v "$@" -o nitc_3
+time ./nitc_3 nitc.nit -v "$@" -o nitc_4
+./nitc_4 ../examples/hello_world.nit "$@" -o hello_world
+./hello_world
+
+# save the last one; may be useful...
+cp ./nitc_4 nitc.good
+++ /dev/null
-#!/bin/bash
-rm nitg nitg_? hello_world 2>/dev/null
-set -x
-set -e
-make -C ../c_src
-sh git-gen-version.sh
-time ../c_src/nitg nitg.nit -v -o nitg_0
-time ./nitg_0 nitg.nit -v "$@" -o nitg_2
-cp nitg_2 nitg
-time ./nitg_2 nitg.nit -v "$@" -o nitg_3
-time ./nitg_3 nitg.nit -v "$@" -o nitg_4
-./nitg_4 ../examples/hello_world.nit "$@" -o hello_world
-./hello_world
-
-# save the last one; may be useful...
-cp ./nitg_4 nitg.good
-
# See the License for the specific language governing permissions and
# limitations under the License.
-# A global Nit compiler
-module nitg
+# A Nit compiler
+module nitc
import frontend
import compiler
-PROGS=*.nit ../examples/*.nit ../examples/leapfrog/leapfrog.nit ../examples/shoot/shoot_logic.nit ../contrib/pep8analysis/src/pep8analysis ../contrib/nitiwiki/src/nitiwiki ../lib/*.nit ../src/nitdoc.nit ../src/test_parser.nit ../src/nit.nit ../src/nitmetrics.nit ../src/nitg.nit
+PROGS=*.nit ../examples/*.nit ../examples/leapfrog/leapfrog.nit ../examples/shoot/shoot_logic.nit ../contrib/pep8analysis/src/pep8analysis ../contrib/nitiwiki/src/nitiwiki ../lib/*.nit ../src/nitdoc.nit ../src/test_parser.nit ../src/nit.nit ../src/nitmetrics.nit ../src/nitc.nit
all: niti nitg-g nitg-s
-nitg
+nitc
nitdoc
nitlight
neo_doxygen_dump
nitvm_args1
nitvm_args3
nitc_args1
-nitg_args1
-nitg_args3
-nitg_args5
-nitg_args6
-nitg_args8
+nitc_args3
+nitc_args5
+nitc_args6
+nitc_args8
nitunit_args
test_docdown_args
pep8analysis
nitvm_args1
nitvm_args3
nitc_args1
-nitg_args1
-nitg_args3
-nitg_args5
-nitg_args6
+nitc_args3
+nitc_args5
+nitc_args6
+nitc_args8
test_markdown_args1
pep8analysis
test_android_platform
-Usage: nitg [OPTION]... file.nit...
+Usage: nitc [OPTION]... file.nit...
Compiles Nit programs.
Use --help for help
-Usage: nitg [OPTION]... file.nit...
+Usage: nitc [OPTION]... file.nit...
Compiles Nit programs.
Use --help for help
-o option Pass option to the engine
-v Verbose (show tests steps)
-h This help
---engine Use a specific engine (default=nitg)
+--engine Use a specific engine (default=nitc)
--noskip Do not skip a test even if the .skip file matches
--outdir Use a specific output folder (default=out/)
--compdir Use a specific temporary compilation folder (default=.nit_compile)
verbose=false
isnode=false
stop=false
-engine=nitg
+engine=nitc
noskip=
savdirs=
while [ $stop = false ]; do
enginebinname=$engine
isinterpret=
case $engine in
- nitg)
+ nitc|nitg)
engine=nitg-s;
- enginebinname=nitg;
+ enginebinname=nitc;
OPT="--separate $OPT --compile-dir $compdir"
savdirs="sav/nitg-common/"
;;
- nitg-s)
- enginebinname=nitg;
+ nitcs|nitg-s)
+ enginebinname=nitc;
OPT="--separate $OPT --compile-dir $compdir"
savdirs="sav/nitg-common/"
;;
- nitg-e)
- enginebinname=nitg;
+ nitce|nitg-e)
+ enginebinname=nitc;
OPT="--erasure $OPT --compile-dir $compdir"
savdirs="sav/nitg-common/"
;;
- nitg-sg)
- enginebinname=nitg;
+ nitcsg|nitg-sg)
+ enginebinname=nitc;
OPT="--semi-global $OPT --compile-dir $compdir"
savdirs="sav/nitg-common/"
;;
- nitg-g)
- enginebinname=nitg;
+ nitcg|nitg-g)
+ enginebinname=nitc;
OPT="--global $OPT --compile-dir $compdir"
savdirs="sav/nitg-common/"
;;
savdirs="sav/niti/"
;;
emscripten)
- enginebinname=nitg
+ enginebinname=nitc
OPT="-m emscripten_nodejs.nit --semi-global $OPT --compile-dir $compdir"
savdirs="sav/nitg-sg/"
;;