Jean Privat [Sat, 11 Aug 2012 03:37:17 +0000 (23:37 -0400)]
nitg: separately compile extern files
they are compiled in .nit_compile/ as `xxx.num.o`.
eg.
.nit_compile/hello_world.2.o: lib/standard/file_nit.c
$(CC) $(CFLAGS) -D NONITCNI -c -o .nit_compile/hello_world.2.o lib/standard/file_nit.c
it is better than compiling them during the link.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 11 Aug 2012 03:33:57 +0000 (23:33 -0400)]
ni: use macro NONITCNI to disable nitni in extern files
nitg uses cc with -D NONITCNI thus can compile those .h/.c files
without breaking.
NONITCNI also means that nitg no more relies on ._nitni files generated
by nitc.
Thus nitg also drops -I in cc.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Aug 2012 18:06:42 +0000 (14:06 -0400)]
Merge branch 'optim_nitg'
Jean Privat [Fri, 10 Aug 2012 18:00:05 +0000 (14:00 -0400)]
Merge branch 'optim_niti'
Jean Privat [Fri, 10 Aug 2012 03:49:28 +0000 (23:49 -0400)]
niti: add NaiveInterpreter#collect_attr_propdef
used to factorise and cache attr initialization&check
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Aug 2012 02:58:35 +0000 (22:58 -0400)]
niti: add class MutableInstance
Instance become abstract
The point of this patch is to avoid the attributes hashmap
in primitive classes.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 31 Jul 2012 04:23:35 +0000 (00:23 -0400)]
niti: check signature arity on send
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 31 Jul 2012 02:38:38 +0000 (22:38 -0400)]
niti: implements ADeferredMethPropdef#call
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 19 Jul 2012 05:14:24 +0000 (01:14 -0400)]
typing: add ASendExpr#raw_arguments
make compute_raw_arguments private
and computes raw_arguments after its call
this improve previous users of compute_raw_arguments (niti ant nitg) that
may need to get args more than once
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 19 Jul 2012 01:46:34 +0000 (21:46 -0400)]
niti: cache the frame in a local variable
expr and stmt are the most called methods.
Storing a result of a non trivial call makes sense.
Figures:
$ time ./nit test_parser.nit test_parser.nit > /dev/null
Before: user 0m8.221s
After: user 0m7.924s
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 7 Aug 2012 21:16:27 +0000 (17:16 -0400)]
run_bench: add "nitc --global" to bench_engines()
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 7 Aug 2012 21:15:56 +0000 (17:15 -0400)]
run_bench: use 'local' vor local variables
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 7 Aug 2012 20:57:11 +0000 (16:57 -0400)]
run_bench: no not force bohem on nitc for bench_engines()
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 7 Aug 2012 20:46:33 +0000 (16:46 -0400)]
run_bench.sh: new function bench_compilation_time
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 7 Aug 2012 20:46:17 +0000 (16:46 -0400)]
nitg: activate bohem since executables are efficient enough
Lasts benchs shows that nitc with nitgc and nitg with bohem can compete
(with often a slight advance for nitg)
$ ./nitg nitg.nit --no-cc
34.12
$ ./nitg.bin nitg.nit --no-cc
27.71
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 7 Aug 2012 19:49:55 +0000 (15:49 -0400)]
nitg: do not expose EscapeMark#object_id in generated C
This breaks ccache recompilations
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 7 Aug 2012 19:49:12 +0000 (15:49 -0400)]
nitg: do not expose RuntimeVariable#object_id in generated C
This breaks ccache recompilations
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 7 Aug 2012 17:50:31 +0000 (13:50 -0400)]
nitg: skip empty sub-strings in superstrings
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 6 Aug 2012 23:36:50 +0000 (19:36 -0400)]
valgrind.sh: use malloc instead of large
We do not want unpredictable GC invocation when the large buffer is reached.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 6 Aug 2012 21:36:19 +0000 (17:36 -0400)]
nitg: improve RuntimeVariable#inspect
and use it is all generated comments
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 6 Aug 2012 21:08:57 +0000 (17:08 -0400)]
nitg: self type in implicit init is exact
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 6 Aug 2012 20:50:59 +0000 (16:50 -0400)]
new script run_bench.sh
This script helps to run benchmarks against the nit engines.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 28 Jul 2012 23:30:57 +0000 (19:30 -0400)]
nitg: because of customization, self is exact
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 27 Jul 2012 22:16:50 +0000 (18:16 -0400)]
nitg: "onces" literal strings
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 21 Jul 2012 17:35:15 +0000 (13:35 -0400)]
nitg: implements ADeferredMethPropdef#compile_to_c
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 24 Jun 2012 21:02:05 +0000 (17:02 -0400)]
nitg: add RuntimeVariable#is_exact
Used to indicate that the dynamic type of some variables is known.
Easy cases are the direct result of instantiations.
Not that collect_types_cache can only be used fo non exact types
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 24 Jun 2012 20:18:13 +0000 (16:18 -0400)]
nitg: add option --hardening
without hardening, last element of a switch is made default.
Note that single-case switch is optimized by the c compiler.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 6 Aug 2012 20:39:30 +0000 (16:39 -0400)]
Merge remote-tracking branch 'pratchett/tests'
Jean Privat [Thu, 2 Aug 2012 18:32:33 +0000 (14:32 -0400)]
nitg&niti: add a "Runtime error" prefix like nitc
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 18:16:31 +0000 (14:16 -0400)]
clib: prefix runtime errors with "Runtime error"
and update tests
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 17:47:28 +0000 (13:47 -0400)]
tests: add niti and nitg Makefile rules
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 17:44:57 +0000 (13:44 -0400)]
tests: add option --noskip
with --noskip, the .skip files are ignored
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 17:39:11 +0000 (13:39 -0400)]
tests: allow skipping tests based on engines
some tests/alternatives/inputs are automatically skipped by the engines
listed in sav/$f.skip
skipping is set because some tests takes to much time (or hang) on
some engines
also register some tests to skip.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 17:27:59 +0000 (13:27 -0400)]
tests: differentiate the engine and the binary name
'niti' is the engine name
'nit' is the binary name
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 16:40:31 +0000 (12:40 -0400)]
tests: re-distinquish compilation errors.
was removed to allow using niti in a quick-and-dirty way.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 15:55:41 +0000 (11:55 -0400)]
tests: specific execution if $engine==nit
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 15:54:54 +0000 (11:54 -0400)]
tests: add option --engine
--engine allow to use a specific execution engine (nit, nitg, nitc, etc)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 15:18:15 +0000 (11:18 -0400)]
tests: add --tap
./tests.sh --tap produce TAP output.
see http://testanything.org for details
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 03:10:16 +0000 (23:10 -0400)]
tests: recognize "NOT YET IMPLEMENTED"
Tests that fails but include the string "NOT YET IMPLEMENTED"
are considered to be expected fails.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 03:09:21 +0000 (23:09 -0400)]
model, niti, nitf: unify NOT YET IMPLEMENTED
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 02:34:56 +0000 (22:34 -0400)]
tests: update sav to remove soso
the alterner transition is now complete.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 3 Aug 2012 02:24:06 +0000 (22:24 -0400)]
tests: tests_icode also use alterner.pl
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 02:04:14 +0000 (22:04 -0400)]
tests: use alterner.pl
alternative are generated with alterner.pl
functions make_alts0() and make_alts() are removed
see https://github.com/privat/alterner
NOTE: this will make a lot a tests going soso because of some location changes
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 01:43:47 +0000 (21:43 -0400)]
tests: replace #!alt by #alt
mass replace (done by sed).
no additional semantic.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 01:39:04 +0000 (21:39 -0400)]
tests: recognize a nonstart #alt as a #!alt
this will helps to transition to alterner.pl
#alt1# in front will be activated on the alternative
something followed by #alt1# will be killed
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 02:18:41 +0000 (22:18 -0400)]
tests: add fail soso
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Aug 2012 02:11:50 +0000 (22:11 -0400)]
mmbuilder: add missing "error" in an error message
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 24 Jun 2012 16:14:32 +0000 (12:14 -0400)]
nitg: inline automatic free init
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 24 Jun 2012 16:14:08 +0000 (12:14 -0400)]
nitg: inline empty bodies
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 19 Jun 2012 21:22:27 +0000 (17:22 -0400)]
nitg: readapt native == and != to force unboxing
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 15 Jul 2012 21:27:12 +0000 (17:27 -0400)]
nitg: inline without adaptation
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 19 Jun 2012 21:17:57 +0000 (17:17 -0400)]
nitg: inline Object::== and Object::!=
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 19 Jun 2012 21:17:25 +0000 (17:17 -0400)]
nitg: add inspect for variable
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 19 Jun 2012 21:02:06 +0000 (17:02 -0400)]
nitg: frame receiver is a type (not a variable)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 15 Jul 2012 21:15:25 +0000 (17:15 -0400)]
nitg: extract adapt_signature
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 15 Jul 2012 19:22:59 +0000 (15:22 -0400)]
Merge remote-tracking branch 'origin/pu/closure'
Jean Privat [Tue, 3 Jul 2012 17:25:51 +0000 (13:25 -0400)]
niti: add closures
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 3 Jul 2012 17:24:43 +0000 (13:24 -0400)]
niti: expressions are escapable
Evaluating an expression return null if there is an escape.
Each caller should then accept or propagate the escaping.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 3 Jul 2012 16:51:31 +0000 (12:51 -0400)]
niti: returnmark indicates a Frame
This allow to escape more than one method.
It is necessary for closures.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 3 Jul 2012 16:46:53 +0000 (12:46 -0400)]
model: add basic closures
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 24 May 2012 14:02:16 +0000 (10:02 -0400)]
model: add for on maps
workaround implementation waiting for closures.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 24 May 2012 13:37:35 +0000 (09:37 -0400)]
nit: add native NativeString::system
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 24 May 2012 13:36:57 +0000 (09:36 -0400)]
nit: add intern Int::rand
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 24 Jun 2012 20:50:28 +0000 (16:50 -0400)]
Merge branch 'parser' into wip
Jean Privat [Sun, 24 Jun 2012 18:24:03 +0000 (14:24 -0400)]
parser: tokens are not constructed with their texts
text is made lazy and computed by Location.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 24 Jun 2012 18:22:09 +0000 (14:22 -0400)]
parser: add Location::text
Jean Privat [Sun, 24 Jun 2012 17:15:22 +0000 (13:15 -0400)]
parser: guard loops in ComputeProdLocationVisitor
Most of the time, _need arrays are empty.
So, add 'if' to do the work only if there is work to do.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 24 Jun 2012 17:11:19 +0000 (13:11 -0400)]
parser: get the state number only once per state
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 19 Jun 2012 20:52:49 +0000 (16:52 -0400)]
nitg: autoadapt can combine nullable
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 18 Jun 2012 21:30:09 +0000 (17:30 -0400)]
Merge branch 'boehm' into wip
Jean Privat [Fri, 15 Jun 2012 17:18:22 +0000 (13:18 -0400)]
gc: gccx enable boehm by default
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 15 Jun 2012 17:15:57 +0000 (13:15 -0400)]
gc: default is always nitgc
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 15 Jun 2012 17:17:10 +0000 (13:17 -0400)]
gc: in gccx, -lgc must appears after objects
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 15 Jun 2012 14:28:44 +0000 (10:28 -0400)]
Merge branch 'alexandre/typo-in-nit-reference' into wip
Alexandre Terrasa [Wed, 13 Jun 2012 14:14:16 +0000 (10:14 -0400)]
doc: Typo in Nit Reference
Signed-off-by: Alexandre Terrasa <alexandre@moz-concept.com>
Jean Privat [Fri, 8 Jun 2012 00:30:23 +0000 (20:30 -0400)]
Merge branch 'alexis/ni-fixes' into wip
Alexis Laferrière [Sat, 24 Mar 2012 23:12:05 +0000 (19:12 -0400)]
nits: execute only if module is really hybrid
It can now be called on a set of modules without creating useless files.
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 6 Jun 2012 04:01:28 +0000 (00:01 -0400)]
nits: cleans up the generated stub implementation function for easier diffs
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 6 Jun 2012 03:58:23 +0000 (23:58 -0400)]
nits: corrects the #endif position to the bottom of the generated header
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Wed, 6 Jun 2012 21:48:38 +0000 (17:48 -0400)]
tests: adds test for ni optimizations
Makes sure even the optimized extern methods are valid.
In this test borth methods are optimized but still uses what
is legal.
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 27 Apr 2012 17:27:00 +0000 (13:27 -0400)]
ni: cleans up code repetition in native interface and improves performance
The code clean up uses trasitionnal variables (NiVariable) to simplyfy the
concept of variable transitionning from C to Nit and Nit to C. It allows
code factorisation and cleaner algorithms.
An extern method without explicit callback and not returning a complexe Nit
object cannot legally use any references. Knowing this, we do not generate
full local references for the arguments of such methods. This avoids to call
malloc and free on unused data structure and greatly reduces overhead for
simple extern methods.
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Thu, 10 May 2012 14:47:11 +0000 (10:47 -0400)]
model: new class MParameter
replace the attributes MSignature::parameter_names and
MSignature::parameter_mtypes by a single MSignature::mparameters
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 10 May 2012 14:34:02 +0000 (10:34 -0400)]
model: remove old Closure stubs
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 10 May 2012 11:02:21 +0000 (07:02 -0400)]
modelbuilder: new method ASignature::visit_signature
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 30 May 2012 16:39:41 +0000 (12:39 -0400)]
Merge branch 'clean-c' into wip
Jean Privat [Wed, 30 May 2012 16:39:32 +0000 (12:39 -0400)]
Merge branch 'syntastic' into wip
Alexis Laferrière [Wed, 30 May 2012 13:42:02 +0000 (09:42 -0400)]
misc: removes debug output from syntastic Nit syntax checker script
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 30 May 2012 11:26:31 +0000 (07:26 -0400)]
compile: do not use true and false C constants.
It simplifies generated code and will allow latter to drop the bool type
in nit_common.h
Defining "bool", "true", and "false" can cause collision with some C
libraries (and is not compatible with C++ for those that care).
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 30 May 2012 11:20:26 +0000 (07:20 -0400)]
lib: do not mix declaration and code in external C code
It is refused by pedantic C90 C compilers.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 30 May 2012 09:47:36 +0000 (05:47 -0400)]
compile: no not declare static stings in the header
Such declarations are also not standard and are rejected by pedantic
compilers.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 30 May 2012 02:51:10 +0000 (22:51 -0400)]
vim: install syntastic file directly inside the vim directory
No manual installation of the file is then required thanks to pathogen.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 30 May 2012 02:47:57 +0000 (22:47 -0400)]
vim: README explain how to install nit for vim
We officially rely on pathogen that is great and simpler.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 30 May 2012 02:14:42 +0000 (22:14 -0400)]
vim: move the function-once test before stuffs
This remove the error in vim about existing functions when a second nit
file is loaded.
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Tue, 29 May 2012 18:27:29 +0000 (14:27 -0400)]
misc: handles all error types in syntastic Nit syntax checker
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 29 May 2012 18:07:09 +0000 (14:07 -0400)]
misc: adds customizable options to syntastic Nit syntax checker
g:syntastic_nitc specifies custom path to compiler
g:syntastic_nit_dir specifies the NIT_DIR env variable
g:syntastic_nit_args specifies extra arguments to call nitc
g:syntastic_nit_include_dirs lists directories to include, must be a list
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 29 May 2012 18:05:47 +0000 (14:05 -0400)]
misc: correctly handles warnings in syntastic Nit syntax checker
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 29 May 2012 16:38:15 +0000 (12:38 -0400)]
misc: adds a Nit syntax checker for syntastic, a vim plugin
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 30 Apr 2012 14:41:25 +0000 (10:41 -0400)]
parser: detect sablecc3 and print better error
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 20 Apr 2012 20:34:08 +0000 (16:34 -0400)]
nitg: introduction of the the global compiler
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 8 May 2012 20:06:51 +0000 (16:06 -0400)]
model: rename lookup_first_property to lookup_first_definition
Signed-off-by: Jean Privat <jean@pryen.org>