nit.git
11 years agolib: move game.nit as lib/scene2d.nit
Jean Privat [Thu, 25 Oct 2012 14:57:50 +0000 (10:57 -0400)]
lib: move game.nit as lib/scene2d.nit

Update the game leapfrog to use it.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agolib: move poll_in from curses to file
Jean Privat [Tue, 3 Jul 2012 23:40:38 +0000 (19:40 -0400)]
lib: move poll_in from curses to file

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agolib: move nanosleep from curses to time
Jean Privat [Tue, 3 Jul 2012 23:29:29 +0000 (19:29 -0400)]
lib: move nanosleep from curses to time

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agolib: move curses to lib/
Jean Privat [Tue, 3 Jul 2012 22:43:07 +0000 (18:43 -0400)]
lib: move curses to lib/

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoleapfrog: add curses.nit.args
Jean Privat [Tue, 3 Jul 2012 22:41:01 +0000 (18:41 -0400)]
leapfrog: add curses.nit.args

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoleapfrog: extract the curses leapfrog-backend in its own module
Jean Privat [Tue, 3 Jul 2012 22:12:38 +0000 (18:12 -0400)]
leapfrog: extract the curses leapfrog-backend in its own module

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoexamples: add a simple leapfrog game
Jean Privat [Wed, 6 Jun 2012 19:31:12 +0000 (15:31 -0400)]
examples: add a simple leapfrog game

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoniti: new option --discover-call-trace to debug niti executions
Jean Privat [Thu, 25 Oct 2012 14:32:26 +0000 (10:32 -0400)]
niti: new option --discover-call-trace to debug niti executions

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoniti: implements native/extern Float#-, rand, cos, sin, atan2 and pi
Jean Privat [Wed, 18 Jul 2012 18:47:55 +0000 (14:47 -0400)]
niti: implements native/extern Float#-, rand, cos, sin, atan2 and pi

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoniti: add Instance#to_f
Jean Privat [Wed, 18 Jul 2012 18:46:23 +0000 (14:46 -0400)]
niti: add Instance#to_f

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoMerge branch 'pass_tests'
Jean Privat [Mon, 22 Oct 2012 21:29:58 +0000 (17:29 -0400)]
Merge branch 'pass_tests'

11 years agotests: disable --soso for nitg and niti
Jean Privat [Thu, 18 Oct 2012 22:20:49 +0000 (18:20 -0400)]
tests: disable --soso for nitg and niti

All tests should pass without for now.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: make runs tests for niti and nitg
Jean Privat [Wed, 17 Oct 2012 13:46:15 +0000 (09:46 -0400)]
tests: make runs tests for niti and nitg

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agomake builds bin/nitg and bin/nit
Jean Privat [Wed, 17 Oct 2012 13:33:19 +0000 (09:33 -0400)]
make builds bin/nitg and bin/nit

While they are still incomplete, they are usefull enough.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: update the sav/ for nitg ang niti
Jean Privat [Tue, 16 Oct 2012 20:01:44 +0000 (16:01 -0400)]
tests: update the sav/ for nitg ang niti

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: run engine with NIT_NO_STACK=1
Jean Privat [Wed, 17 Oct 2012 20:57:54 +0000 (16:57 -0400)]
tests: run engine with NIT_NO_STACK=1

Runtime error of engine will not dump the stack trace.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: always put stdout before stderr
Jean Privat [Sat, 20 Oct 2012 08:58:35 +0000 (04:58 -0400)]
tests: always put stdout before stderr

Thus, warnings in the interpreter will be in at the same place
in the compiler.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agomodel: exit(1) on get_primitive_class
Jean Privat [Mon, 22 Oct 2012 20:12:14 +0000 (16:12 -0400)]
model: exit(1) on get_primitive_class

Code must be cleaner to avoid printing error in model.nit

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonew model: move force_get_primitive_method to modelbuilder
Jean Privat [Mon, 22 Oct 2012 19:44:17 +0000 (15:44 -0400)]
new model: move force_get_primitive_method to modelbuilder

The point is to be able to deals with errors in a more correct ay.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg&niti: do not crash on invalid arity
Jean Privat [Mon, 22 Oct 2012 18:45:09 +0000 (14:45 -0400)]
nitg&niti: do not crash on invalid arity

Issue a "NOT YET IMPLEMENTED" instead

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agomodelbuilder: do not crash if nclassdef.mclass is not defined
Jean Privat [Mon, 22 Oct 2012 18:22:08 +0000 (14:22 -0400)]
modelbuilder: do not crash if nclassdef.mclass is not defined

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agolib: fix "--" handling in opts
Jean Privat [Wed, 17 Oct 2012 20:22:33 +0000 (16:22 -0400)]
lib: fix "--" handling in opts

For some unknown reason, 8d335db5 removed the line.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agomodelbuilder: check inherited signature arity before trying to inherit the type of...
Jean Privat [Wed, 17 Oct 2012 20:24:56 +0000 (16:24 -0400)]
modelbuilder: check inherited signature arity before trying to inherit the type of the parameters

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agomodebuilder: fix some error messages
Jean Privat [Wed, 17 Oct 2012 20:23:45 +0000 (16:23 -0400)]
modebuilder: fix some error messages

Add "Error" to messages and avoid using warning for real errors.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: fix a "NOT YET IMPLEMENTED" message
Jean Privat [Tue, 16 Oct 2012 20:02:14 +0000 (16:02 -0400)]
nitg: fix a "NOT YET IMPLEMENTED" message

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: cleanup .gitignore
Jean Privat [Tue, 16 Oct 2012 17:38:00 +0000 (13:38 -0400)]
tests: cleanup .gitignore

all temporary result files must be generated in out/

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: tests_icode.sh generates files in out/
Jean Privat [Tue, 16 Oct 2012 17:37:17 +0000 (13:37 -0400)]
tests: tests_icode.sh generates files in out/

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: make Object an interface to avoid constructor conflict
Jean Privat [Tue, 16 Oct 2012 17:21:57 +0000 (13:21 -0400)]
tests: make Object an interface to avoid constructor conflict

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: suppr a depreciated test
Jean Privat [Tue, 16 Oct 2012 17:32:18 +0000 (13:32 -0400)]
tests: suppr a depreciated test

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: add options --[no]soso
Jean Privat [Tue, 16 Oct 2012 17:14:37 +0000 (13:14 -0400)]
tests: add options --[no]soso

the options --soso et --nososo enable/disable the sosoing.
When disabled, soso are considered a big fail.

By default, --soso is disabled for nitc and activated for nitg and niti

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: update sav file broken by 5c50ab8
Jean Privat [Tue, 16 Oct 2012 15:37:21 +0000 (11:37 -0400)]
tests: update sav file broken by 5c50ab8

Those tests where broken because of a silent sosoing.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: accepts various sav/* files
Jean Privat [Tue, 16 Oct 2012 15:27:17 +0000 (11:27 -0400)]
tests: accepts various sav/* files

Multiple save files can be accepted as valid.

Specific result for an engine goes to sav/$engine/
Expected failures (fixmes) goes to sav/fixme/ or sav/$engine/fixme/

All result files are experted to have a .res extension (old .sav and
.fail extensions are still sometime accepted for compatibility)

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotests: can add a file $engine.skip to skip many tests
Jean Privat [Tue, 16 Oct 2012 04:05:51 +0000 (00:05 -0400)]
tests: can add a file $engine.skip to skip many tests

*.skip files can be used to indicate patterns of files that should be
skipped for the given engine.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: add libraries *after* objects that use them
Jean Privat [Thu, 11 Oct 2012 02:44:35 +0000 (22:44 -0400)]
nitg: add libraries *after* objects that use them

Same bug play again. See commits 60311423da4a and e926c569d7d6.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoMerge 'separate_nitg'
Jean Privat [Thu, 11 Oct 2012 02:40:34 +0000 (22:40 -0400)]
Merge 'separate_nitg'

11 years agonitg: ad hoc separate compiler stub module
Jean Privat [Wed, 26 Sep 2012 19:45:07 +0000 (15:45 -0400)]
nitg: ad hoc separate compiler stub module

separate_compiler refines global_compiler to add a simulated separate
compilation process.
A new option --separate is also added to nitg.

Currently this does not even generate a valid C code for
examples/hello_world.nit but C for ests/base_simple3.nit is valid
(but nonfunctional).

Many parts are missing, especially the computation of tables and the
implementation of the main OO mechanisms.

The short therm usage of this code is to help the evaluation of subtyping
implementations of OO language.
Eventually, the code could be the base of a cleaner naive separate
compiler (in order to replace the current nitc).

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoMerge branch 'alexandre/inf7741'
Jean Privat [Tue, 2 Oct 2012 20:02:12 +0000 (16:02 -0400)]
Merge branch 'alexandre/inf7741'

11 years agonit: Add incremental typing to interpretor
Alexandre Terrasa [Tue, 2 Oct 2012 16:12:27 +0000 (12:12 -0400)]
nit: Add incremental typing to interpretor
tests: Update test for Nit

Signed-off-by: Alexandre Terrasa <alexandre@moz-concept.com>

11 years agonit: introduce interpretor type test with dynamic loading
Alexandre Terrasa [Tue, 2 Oct 2012 16:03:44 +0000 (12:03 -0400)]
nit: introduce interpretor type test with dynamic loading

Signed-off-by: Alexandre Terrasa <alexandre@moz-concept.com>

11 years agonit: clean run_naive_interpretor method
Alexandre Terrasa [Tue, 2 Oct 2012 16:03:08 +0000 (12:03 -0400)]
nit: clean run_naive_interpretor method

Signed-off-by: Alexandre Terrasa <alexandre@moz-concept.com>

11 years agolib: Math::Int add binaries operations and, or, xor
Alexandre Terrasa [Mon, 1 Oct 2012 19:36:31 +0000 (15:36 -0400)]
lib: Math::Int add binaries operations and, or, xor

Signed-off-by: Alexandre Terrasa <alexandre@moz-concept.com>

11 years agoMerge remote-tracking branch 'origin/pu/clean_nitg'
Jean Privat [Tue, 2 Oct 2012 09:41:11 +0000 (05:41 -0400)]
Merge remote-tracking branch 'origin/pu/clean_nitg'

11 years agoMerge remote-tracking branch 'origin/pu/opts'
Jean Privat [Tue, 2 Oct 2012 09:40:01 +0000 (05:40 -0400)]
Merge remote-tracking branch 'origin/pu/opts'

11 years agonitg: add GlobalCompilerVisitor::monomorphic_send
Jean Privat [Wed, 26 Sep 2012 19:13:12 +0000 (15:13 -0400)]
nitg: add GlobalCompilerVisitor::monomorphic_send

Can be used for send when the dynamic type is known.
The implementation just do the selection then call
GlobalCompilerVisitor::call

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: split run_global_compiler to write_and_make
Jean Privat [Wed, 26 Sep 2012 15:45:46 +0000 (11:45 -0400)]
nitg: split run_global_compiler to write_and_make

The point is to separate the generation of the C code to its effective
writing on disk on its compilation

A future separate compiler may reuse the writing-and-compilation part.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoopts: get_errors function instead of check_errors.
Alexandre Pennetier [Tue, 26 Jun 2012 20:23:18 +0000 (16:23 -0400)]
opts: get_errors function instead of check_errors.

11 years agoopts: handling for packed short options
Alexandre Pennetier [Mon, 11 Jun 2012 21:01:26 +0000 (17:01 -0400)]
opts: handling for packed short options

Signed-off-by: Alexandre Pennetier <alexandre.pennetier@me.com>

11 years agoopts: errors gathered into OptionContext class
Alexandre Pennetier [Mon, 11 Jun 2012 20:57:52 +0000 (16:57 -0400)]
opts: errors gathered into OptionContext class

Signed-off-by: Alexandre Pennetier <alexandre.pennetier@me.com>

11 years agoopts: error when unexpected value for an enum
Alexandre Pennetier [Mon, 11 Jun 2012 20:46:32 +0000 (16:46 -0400)]
opts: error when unexpected value for an enum

Signed-off-by: Alexandre Pennetier <alexandre.pennetier@me.com>

11 years agoopts: error when lack of a mandatory parameter
Alexandre Pennetier [Mon, 11 Jun 2012 20:43:14 +0000 (16:43 -0400)]
opts: error when lack of a mandatory parameter

Signed-off-by: Alexandre Pennetier <alexandre.pennetier@me.com>

11 years agoopts: error when lack of a mandatory option
Alexandre Pennetier [Fri, 21 Sep 2012 19:06:14 +0000 (15:06 -0400)]
opts: error when lack of a mandatory option

Signed-off-by: Alexandre Pennetier <alexandre.pennetier@me.com>

11 years agonitg: do not use RuntimeVariable#mtype when we have better
Jean Privat [Fri, 24 Aug 2012 15:47:20 +0000 (11:47 -0400)]
nitg: do not use RuntimeVariable#mtype when we have better

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: generate BOX_xxx to factorize code
Jean Privat [Fri, 24 Aug 2012 13:22:45 +0000 (09:22 -0400)]
nitg: generate BOX_xxx to factorize code

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: generated main returns 0 on success
Jean Privat [Thu, 23 Aug 2012 13:46:49 +0000 (09:46 -0400)]
nitg: generated main returns 0 on success

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: warn conflicting propdefs on GlobalCompilerVisitor#send
Jean Privat [Thu, 23 Aug 2012 02:24:39 +0000 (22:24 -0400)]
nitg: warn conflicting propdefs on GlobalCompilerVisitor#send

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: correctly handle the calls == and != on a nullable receiver
Jean Privat [Thu, 23 Aug 2012 02:13:21 +0000 (22:13 -0400)]
nitg: correctly handle the calls == and != on a nullable receiver

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: use mcasttype instead of mtype in autoadapt
Jean Privat [Thu, 23 Aug 2012 02:11:50 +0000 (22:11 -0400)]
nitg: use mcasttype instead of mtype in autoadapt

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: use CustomizedRuntimeFunction#c_name instead of copying it
Jean Privat [Wed, 22 Aug 2012 17:46:52 +0000 (13:46 -0400)]
nitg: use CustomizedRuntimeFunction#c_name instead of copying it

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: do not treat new_var on MNullType distinctly
Jean Privat [Wed, 22 Aug 2012 17:33:31 +0000 (13:33 -0400)]
nitg: do not treat new_var on MNullType distinctly

This part of code dates from a time where mtype was a MClassType
instead of a MType.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: assert that types of RuntimeVariable are not anchored
Jean Privat [Wed, 22 Aug 2012 17:29:48 +0000 (13:29 -0400)]
nitg: assert that types of RuntimeVariable are not anchored

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: move compile_to_c from MMethodDef to CustomizedRuntimeFunction
Jean Privat [Wed, 22 Aug 2012 16:30:47 +0000 (12:30 -0400)]
nitg: move compile_to_c from MMethodDef to CustomizedRuntimeFunction

Now, MMethodDef is unrelated to customization stuff.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: remove the argument `modelbuilder` in compile_to_c
Jean Privat [Wed, 22 Aug 2012 15:20:22 +0000 (11:20 -0400)]
nitg: remove the argument `modelbuilder` in compile_to_c

the modelbuilder is already accessible by the `compiler` argument.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: use MMethodDef#compile_inside_to_c in MMethodDef#compile_to_c
Jean Privat [Wed, 22 Aug 2012 15:19:22 +0000 (11:19 -0400)]
nitg: use MMethodDef#compile_inside_to_c in MMethodDef#compile_to_c

thus remove a copy-paste.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: split RuntimeFunction to CustomizedRuntimeFunction
Jean Privat [Wed, 22 Aug 2012 15:13:55 +0000 (11:13 -0400)]
nitg: split RuntimeFunction to CustomizedRuntimeFunction

The idea is to allow RuntimeFunction to have more subtypes like
customization on the full signature or non-customized versions

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: add some documentation
Jean Privat [Wed, 22 Aug 2012 14:48:49 +0000 (10:48 -0400)]
nitg: add some documentation

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: move collect_types_cache to the GlobalCompiler
Jean Privat [Wed, 22 Aug 2012 10:54:22 +0000 (06:54 -0400)]
nitg: move collect_types_cache to the GlobalCompiler

There is one GlobalCompilerVisitor per C function, therefore having
the cache here was stupid.

GlobalCompiler is a singleton and is better suited to manage the cache.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: execute make with -B
Jean Privat [Wed, 22 Aug 2012 13:03:59 +0000 (09:03 -0400)]
nitg: execute make with -B

We use `make' as a simple parallel shell script.
However do not rely on the fact that source files could be time related
with object files.

Without -B some compilations fail because unrelated .o files may exists
while the .c file is older (eg. native files).
Thus -B forces the C compilation to be tried.

The C compilation is still fast in the recompilation case thanks to ccache.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonewmm: parse literal floats using String#to_f
Jean Privat [Sun, 12 Aug 2012 15:17:47 +0000 (11:17 -0400)]
newmm: parse literal floats using String#to_f

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agolib: implements String#to_f as a legacy extern method (using atof)
Jean Privat [Sun, 12 Aug 2012 15:17:07 +0000 (11:17 -0400)]
lib: implements String#to_f as a legacy extern method (using atof)

niti/nitg cannot use the native interface of Alexis.
So it is better this way for the moment.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotyping: check literal ranges uses discrete types
Jean Privat [Sun, 12 Aug 2012 14:10:10 +0000 (10:10 -0400)]
typing: check literal ranges uses discrete types

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitc: cannot instantiate a nullable type
Jean Privat [Sun, 12 Aug 2012 13:53:18 +0000 (09:53 -0400)]
nitc: cannot instantiate a nullable type

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotyping: check use of protected methods
Jean Privat [Sun, 12 Aug 2012 13:44:00 +0000 (09:44 -0400)]
typing: check use of protected methods

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitc: allow homonymous non-nested labels
Jean Privat [Sun, 12 Aug 2012 13:18:14 +0000 (09:18 -0400)]
nitc: allow homonymous non-nested labels

old specification was odd.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agotyping: better handling of for forms
Jean Privat [Sat, 11 Aug 2012 21:12:31 +0000 (17:12 -0400)]
typing: better handling of for forms

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agomodeflbuilder: do not crash if a mclassdef cannot be created
Jean Privat [Sat, 11 Aug 2012 21:11:57 +0000 (17:11 -0400)]
modeflbuilder: do not crash if a mclassdef cannot be created

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agomodelbuilder: check redef signature in getter/setter
Jean Privat [Sat, 11 Aug 2012 20:23:21 +0000 (16:23 -0400)]
modelbuilder: check redef signature in getter/setter

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agommbuilder: reject covariant definition of attributes
Jean Privat [Tue, 7 Aug 2012 23:12:25 +0000 (19:12 -0400)]
mmbuilder: reject covariant definition of attributes

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agoMerge branch 'nonitc_ni' into master
Jean Privat [Sun, 12 Aug 2012 02:19:39 +0000 (22:19 -0400)]
Merge branch 'nonitc_ni' into master

11 years agonitg: add clean rule in generated Makefile
Jean Privat [Sat, 11 Aug 2012 03:43:46 +0000 (23:43 -0400)]
nitg: add clean rule in generated Makefile

It is intended to by only used by developers of nitg.

Signed-off-by: Jean Privat <jean@pryen.org>

11 years agonitg: separately compile extern files
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>

11 years agoni: use macro NONITCNI to disable nitni in extern files
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>

11 years agoMerge branch 'optim_nitg'
Jean Privat [Fri, 10 Aug 2012 18:06:42 +0000 (14:06 -0400)]
Merge  branch 'optim_nitg'

11 years agoMerge branch 'optim_niti'
Jean Privat [Fri, 10 Aug 2012 18:00:05 +0000 (14:00 -0400)]
Merge branch 'optim_niti'

11 years agoniti: add NaiveInterpreter#collect_attr_propdef
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>

11 years agoniti: add class MutableInstance
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>

11 years agoniti: check signature arity on send
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>

11 years agoniti: implements ADeferredMethPropdef#call
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>

11 years agotyping: add ASendExpr#raw_arguments
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>

11 years agoniti: cache the frame in a local variable
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>

11 years agorun_bench: add "nitc --global" to bench_engines()
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>

11 years agorun_bench: use 'local' vor local variables
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>

11 years agorun_bench: no not force bohem on nitc for bench_engines()
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>

11 years agorun_bench.sh: new function bench_compilation_time
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>

11 years agonitg: activate bohem since executables are efficient enough
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>

11 years agonitg: do not expose EscapeMark#object_id in generated C
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>

11 years agonitg: do not expose RuntimeVariable#object_id in generated C
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>

11 years agonitg: skip empty sub-strings in superstrings
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>

11 years agovalgrind.sh: use malloc instead of large
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>

11 years agonitg: improve RuntimeVariable#inspect
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>

11 years agonitg: self type in implicit init is exact
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>