nit.git
8 years agoMerge: Do not compile dead modules
Jean Privat [Thu, 18 Jun 2015 03:09:33 +0000 (23:09 -0400)]
Merge: Do not compile dead modules

Separate compilation implies that a module is compiled independently of its clients.
This point ensure us that the recompilation of programs is fast since only modified modules need to be recompiled and that modules used by multiples clients need to be compiled only once.

Unfortunately, currently an already compiled module need to still to be fully compiled in C on each compilation (avoiding doing it is a very complex matter). Fortunately, most of the compilation time is spend by the C compiler (especially when #1498) and this time is safely decimated by ccache.

However, a thing that some modules are imported by programs (thus provide declarations, introductions, importations) but are only made of method definitions that will never be executed by the program. Such a module is called a *dead* module and our static analysis RTA can approximate them.
So, now, the generation of C code for such a module is skipped (and its associated C compilation, obviously)

This will benefit mostly small programs that imports standard and other libraries but only use a small portion of them. Eg: programs in `tests/` or in `examples/rossetacode`.

For numbers, lets try with `time ./tests.sh ../examples/rosettacode/*.nit` to test the 32 (currently) programs.

* before: 30s
* after: 21s

I hope that CI servers will like what we, human masters, do for them!

Pull-Request: #1509
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agofixup: add first_letter_last_letter niti.skip
Jean Privat [Wed, 17 Jun 2015 20:15:13 +0000 (16:15 -0400)]
fixup: add first_letter_last_letter niti.skip

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

8 years agoMerge: Light FFI for the interpreter
Jean Privat [Wed, 17 Jun 2015 20:14:38 +0000 (16:14 -0400)]
Merge: Light FFI for the interpreter

Intro an FFI for the interpreter. This is a first draft/proof of concept to support the light FFI and few more features, more work is needed to implement the full FFI and support for other languages.

When the interpreter has to execute an extern method, it compiles all the extern code of the modules into an external native shared library (.so). Then the interpreter load dynamically the module, and invoke the C implementation function. The handle to the library is cached so a module isn't compiled twice per execution.

The current version is limited to the light FFI with a few more features. So there is extern methods, native type support and extern classes but it does not support callbacks.

The interpreter can now run 7 out of the 24 tests for the FFI with C.

This version was kept "simple" by design, it lacks some not-so-hard to implement features as well as portability concerns:
* Choosing the compiler (hard coded gcc) and the compile folder.
* Recompile the extern library only when the source is updated.
* Clear the compile folder.
* Support shared library format on OS X.
* Ensure call compatibility between the interpreter and extern libraries

The remaining features of the FFI, the callbacks and the other languages, require a decent amount of work but less than this PR.

Note that not a single line of code was added to the FFI folder, it uses the exact same backend as the compiler without modifications.

The design was inspired by other interpreters and VM-based languages. The JNI expect the user to manually compile the extern code into a native shared library before executing the Java code. This FFI automates the same process.

---

Please ignore the first 6 commits from #1441 and #1442.

Pull-Request: #1443
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: More limit on tests
Jean Privat [Wed, 17 Jun 2015 19:47:24 +0000 (15:47 -0400)]
Merge: More limit on tests

Implemented more kind of size and time limits in `tests.sh` so that broken tests will not fill the disk with useless garbage.

realtimelimit is the existing time limit (in seconds)
It is used to avoid waiting or sleeping tests.
It requires timeout or timelimit, or else is not used.
The main change is the name (there is one now) and is lowered to 5 min

usertimelimit is an additional user CPU time limit (in seconds)
It is used to avoid to CPU intensive test (infinite loops). See ulimit -t
Is set to 1 CPU minute

filelimit is the user limit for write files (in kilo-bytes)
Is used to avoid execution that loop and fill the hard drive. See ulimit -f
Note that a test might require a lot of temporary disk space (eg. nitc+gcc) so it is set to approximately 100MB

reslimit is the limit (in bytes) for generated .res file.
Larger ones are truncated and will fail tests
It is used to avoid processing huge crappy res file (diff, xml, etc)
Is set to approximately 100KB

Pull-Request: #1454
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: code: cleanup some docunits
Jean Privat [Wed, 17 Jun 2015 19:47:19 +0000 (15:47 -0400)]
Merge: code: cleanup some docunits

They where detected since #1332 is merged

Pull-Request: #1508
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <chanoir.romain@courrier.uqam.ca>

8 years agotests: force compilation of the test error_annot_pkgconfig
Alexis Laferrière [Wed, 17 Jun 2015 16:50:40 +0000 (12:50 -0400)]
tests: force compilation of the test error_annot_pkgconfig

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agotests: skip raspberry pi tests on niti and nitvm
Alexis Laferrière [Wed, 17 Jun 2015 10:56:00 +0000 (06:56 -0400)]
tests: skip raspberry pi tests on niti and nitvm

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agotests: nitvm also skip the mpi_simple test
Alexis Laferrière [Tue, 16 Jun 2015 17:25:35 +0000 (13:25 -0400)]
tests: nitvm also skip the mpi_simple test

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agosrc: fix interpreter FFI to support nitvm
Alexis Laferrière [Tue, 16 Jun 2015 17:05:21 +0000 (13:05 -0400)]
src: fix interpreter FFI to support nitvm

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agotests: make as UNDEFINED tests that break niti at the FFI level
Alexis Laferrière [Tue, 16 Jun 2015 15:25:06 +0000 (11:25 -0400)]
tests: make as UNDEFINED tests that break niti at the FFI level

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agotests: blacklist most things from src in nitg-g.skip
Jean Privat [Wed, 17 Jun 2015 13:28:14 +0000 (09:28 -0400)]
tests: blacklist most things from src in nitg-g.skip

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

8 years agosep_comp: declare method __attribute__((weak)) to allow skip of undead methods
Jean Privat [Wed, 17 Jun 2015 01:34:09 +0000 (21:34 -0400)]
sep_comp: declare method __attribute__((weak)) to allow skip of undead methods

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

8 years agosep_comp: SeparateRuntimeFunction::compile_to_c only declare if module is dead
Jean Privat [Wed, 17 Jun 2015 01:23:45 +0000 (21:23 -0400)]
sep_comp: SeparateRuntimeFunction::compile_to_c only declare if module is dead

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

8 years agosep_compiler: move up declaration in SeparateRuntimeFunction::compile_to_c
Jean Privat [Wed, 17 Jun 2015 01:22:57 +0000 (21:22 -0400)]
sep_compiler: move up declaration in SeparateRuntimeFunction::compile_to_c

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

8 years agotests: MPI is not supported within the interpreter
Alexis Laferrière [Fri, 12 Jun 2015 20:31:03 +0000 (16:31 -0400)]
tests: MPI is not supported within the interpreter

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agotests: expect unsupported Android platform error with the interpreter
Alexis Laferrière [Fri, 12 Jun 2015 20:30:44 +0000 (16:30 -0400)]
tests: expect unsupported Android platform error with the interpreter

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Remove RopeString
Jean Privat [Wed, 17 Jun 2015 10:24:37 +0000 (06:24 -0400)]
Merge: Remove RopeString

As part of the cleaning of the text group, the `RopeString` class was adding a useless extra layer of abstraction to an already sufficiently complex module, it was decided to remove it.

Pull-Request: #1513
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agosep_comp: remove unrobust SeparateRuntimeFunction::arguments attribute
Jean Privat [Wed, 17 Jun 2015 01:22:04 +0000 (21:22 -0400)]
sep_comp: remove unrobust SeparateRuntimeFunction::arguments attribute

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

8 years agosep_comp: SeparateRuntimeFunction::compile_trampolines build its own argument list
Jean Privat [Wed, 17 Jun 2015 01:21:30 +0000 (21:21 -0400)]
sep_comp: SeparateRuntimeFunction::compile_trampolines build its own argument list

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

8 years agorta: add `RapidTypeAnalysis::live_mmodules`
Jean Privat [Fri, 12 Jun 2015 20:47:15 +0000 (16:47 -0400)]
rta: add `RapidTypeAnalysis::live_mmodules`

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

8 years agoMerge: Rosetta, batch 1
Jean Privat [Tue, 16 Jun 2015 23:25:42 +0000 (19:25 -0400)]
Merge: Rosetta, batch 1

First batch of rosetta code examples from the Nit coding party.

This PR only include merges of code that seems integrable as is without specific modification, and small follow-up code to pass tests.

Pull-Request: #1518
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Harden AAsCastExpr
Jean Privat [Tue, 16 Jun 2015 23:25:36 +0000 (19:25 -0400)]
Merge: Harden AAsCastExpr

Make RTA and the compiler more robust so it does not crashes on #1512
Also some refactorization is added.

Close #1512 (because not more segfault) but does not fix the underlying problem.

Pull-Request: #1517
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Int/Byte Binops
Jean Privat [Tue, 16 Jun 2015 23:25:30 +0000 (19:25 -0400)]
Merge: Int/Byte Binops

Added some binops to the Int and Byte types, including their C-like syntax.

Pull-Request: #1514
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Nitiwiki: relative links
Jean Privat [Tue, 16 Jun 2015 23:25:24 +0000 (19:25 -0400)]
Merge: Nitiwiki: relative links

Use relative links in generated documents to avoid hard_coding `root_url`.

Demo: http://nitlanguage.org/beta/

Pull-Request: #1505
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agotests: add count_the_coins and semordnilap_args1 to niti.skip
Jean Privat [Tue, 16 Jun 2015 17:13:00 +0000 (13:13 -0400)]
tests: add count_the_coins and semordnilap_args1 to niti.skip

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

8 years agoexample: rosetta/catalan_numbers skip the 11th element to avoid overflox issue
Jean Privat [Tue, 16 Jun 2015 17:04:34 +0000 (13:04 -0400)]
example: rosetta/catalan_numbers skip the 11th element to avoid overflox issue

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

8 years agoMerge: examples: Add 99_Bottles_of_Beer rosetta code example
Jean Privat [Tue, 16 Jun 2015 15:35:38 +0000 (11:35 -0400)]
Merge: examples: Add 99_Bottles_of_Beer rosetta code example

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #1457
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: rosetta code: factorial
Jean Privat [Tue, 16 Jun 2015 15:35:26 +0000 (11:35 -0400)]
Merge: rosetta code: factorial

Signed-off-by: Renata Carvalho <renatawm@gmail.com>

Pull-Request: #1458
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: ArthurDelamare <arthur.delamare@viacesi.fr>

8 years agoMerge: rosetta code: here_document
Jean Privat [Tue, 16 Jun 2015 15:35:13 +0000 (11:35 -0400)]
Merge: rosetta code: here_document

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

Pull-Request: #1459
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: example: add catalan_numbers task of Rosetta code
Jean Privat [Tue, 16 Jun 2015 15:35:04 +0000 (11:35 -0400)]
Merge: example: add catalan_numbers task of Rosetta code

Rosetta code example of catalan numbers
http://rosettacode.org/wiki/Catalan_numbers

Pull-Request: #1460
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Ait younes Mehdi Adel <overpex@gmail.com>

8 years agoMerge: Rosetta count the coins
Jean Privat [Tue, 16 Jun 2015 15:34:52 +0000 (11:34 -0400)]
Merge: Rosetta count the coins

Pull-Request: #1462
Reviewed-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>

8 years agoMerge: Implementation of rosettacode : pernicious numbers and primality by trial...
Jean Privat [Tue, 16 Jun 2015 15:34:38 +0000 (11:34 -0400)]
Merge: Implementation of rosettacode : pernicious numbers and primality by trial division

Pull-Request: #1463
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: rosettacode: pick random element
Jean Privat [Tue, 16 Jun 2015 15:33:34 +0000 (11:33 -0400)]
Merge: rosettacode: pick random element

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

Pull-Request: #1465
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: rosetta: perfect_numbers
Jean Privat [Tue, 16 Jun 2015 15:32:32 +0000 (11:32 -0400)]
Merge: rosetta: perfect_numbers

Signed-off-by: Renata Carvalho <renatawm@gmail.com>

Pull-Request: #1467
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: rosetta code: first_letter_last_letter
Jean Privat [Tue, 16 Jun 2015 15:32:19 +0000 (11:32 -0400)]
Merge: rosetta code: first_letter_last_letter

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

Pull-Request: #1468
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: example: Rosetta Code example for letter frequency
Jean Privat [Tue, 16 Jun 2015 15:32:08 +0000 (11:32 -0400)]
Merge: example: Rosetta Code example for letter frequency

Signed-off-by: Jean-Philippe Caissy <jean-philippe.caissy@shopify.com>

Pull-Request: #1469
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: examples: add rosetta code Median
Jean Privat [Tue, 16 Jun 2015 15:31:59 +0000 (11:31 -0400)]
Merge: examples: add rosetta code Median

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #1470
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: rosetta code: visualize_a_tree
Jean Privat [Tue, 16 Jun 2015 15:31:48 +0000 (11:31 -0400)]
Merge: rosetta code: visualize_a_tree

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

Pull-Request: #1472
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agotests: search_tests_git filters out zzz_tests (we do not want to execute them)
Jean Privat [Sat, 13 Jun 2015 02:14:21 +0000 (22:14 -0400)]
tests: search_tests_git filters out zzz_tests (we do not want to execute them)

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

8 years agotests: add zzz_tests for limits (run them if you wish)
Jean Privat [Sat, 13 Jun 2015 02:10:01 +0000 (22:10 -0400)]
tests: add zzz_tests for limits (run them if you wish)

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

8 years agotests: add base_dead_code
Jean Privat [Tue, 16 Jun 2015 17:20:54 +0000 (13:20 -0400)]
tests: add base_dead_code

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

8 years agoMerge: rosetta: symmetric_difference
Jean Privat [Tue, 16 Jun 2015 15:30:42 +0000 (11:30 -0400)]
Merge: rosetta: symmetric_difference

Signed-off-by: Renata Carvalho <renatawm@gmail.com>

Pull-Request: #1478
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Istvan SZALAÏ <szalai972@gmail.com>

8 years agoMerge: rosettacode: Added semordnilap task
Jean Privat [Tue, 16 Jun 2015 15:29:41 +0000 (11:29 -0400)]
Merge: rosettacode: Added semordnilap task

See: http://rosettacode.org/wiki/Semordnilap

Pull-Request: #1483
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: example: add artihmetic mode example from rosetta code
Jean Privat [Tue, 16 Jun 2015 15:29:14 +0000 (11:29 -0400)]
Merge: example: add artihmetic mode example from rosetta code

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #1484
Reviewed-by: Istvan SZALAÏ <szalai972@gmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: example: add caesar cipher example from rosetta code
Jean Privat [Tue, 16 Jun 2015 15:25:29 +0000 (11:25 -0400)]
Merge: example: add caesar cipher example from rosetta code

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #1487
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: exemple: add zig-zag_matrix task of Rosetta code
Jean Privat [Tue, 16 Jun 2015 15:25:13 +0000 (11:25 -0400)]
Merge: exemple: add zig-zag_matrix task of Rosetta code

Rosetta code example of zig-zag matrix
http://rosettacode.org/wiki/Zig-zag_matrix

Pull-Request: #1490
Reviewed-by: Istvan SZALAÏ <szalai972@gmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agocompiler: no-on for `AIsaExpr` without a valid `cast_type`
Jean Privat [Tue, 16 Jun 2015 14:50:28 +0000 (10:50 -0400)]
compiler: no-on for `AIsaExpr` without a valid `cast_type`

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

8 years agocompiler: no-op for expressions that return no RuntimeVariable
Jean Privat [Tue, 16 Jun 2015 14:49:52 +0000 (10:49 -0400)]
compiler: no-op for expressions that return no RuntimeVariable

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

8 years agorta: no-op when AExpr::mtype or AExpr::cast_type is null
Jean Privat [Tue, 16 Jun 2015 13:30:17 +0000 (09:30 -0400)]
rta: no-op when AExpr::mtype or AExpr::cast_type is null

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

8 years agorta: new method `allocate_mtype` to factorize some code
Jean Privat [Tue, 16 Jun 2015 13:28:56 +0000 (09:28 -0400)]
rta: new method `allocate_mtype` to factorize some code

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

8 years agorosettacode: Added semordnilap task
Lucas Bajolet [Mon, 15 Jun 2015 15:17:08 +0000 (11:17 -0400)]
rosettacode: Added semordnilap task

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agotests: Updated test for binops
Lucas Bajolet [Mon, 15 Jun 2015 15:06:14 +0000 (11:06 -0400)]
tests: Updated test for binops

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agolib/standard/math: Added binops to Byte
Lucas Bajolet [Mon, 15 Jun 2015 14:47:59 +0000 (10:47 -0400)]
lib/standard/math: Added binops to Byte

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agolib/standard/math: Added binops aliases for Int
Lucas Bajolet [Mon, 15 Jun 2015 14:40:07 +0000 (10:40 -0400)]
lib/standard/math: Added binops aliases for Int

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agolib/standard/ropes: Removed useless RopeString abstract class
Lucas Bajolet [Mon, 15 Jun 2015 14:14:24 +0000 (10:14 -0400)]
lib/standard/ropes: Removed useless RopeString abstract class

Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoexemple: add zig-zag_matrix task of Rosetta code
Arthur Delamare [Wed, 10 Jun 2015 19:37:45 +0000 (15:37 -0400)]
exemple: add zig-zag_matrix task of Rosetta code

Signed-off-by: Arthur Delamare <arthur.delamare@viacesi.fr>

8 years agoMerge: A more POLA to_s on Collection
Jean Privat [Sun, 14 Jun 2015 01:10:09 +0000 (21:10 -0400)]
Merge: A more POLA to_s on Collection

As announced in #1385, this PR change the default `to_s` on collections.

Before: `[1, 2, 3].to_s == "123"`
After: `[1, 2, 3].to_s == "[1,2,3]"`

The main issue is for code that used `to_s` on array to get a fast concatenation.
Those should now use `plain_to_s` (or `join("")`).

Close #off-line issue signaled by @ablondin

Note: this PR fails on bootstrap (`to_s` is used internally) thus requires that `c_src` is regenerated.

Pull-Request: #1424
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: nitdoc: fix things, add more tests and benches
Jean Privat [Sat, 13 Jun 2015 11:21:01 +0000 (07:21 -0400)]
Merge: nitdoc: fix things, add more tests and benches

Two fixes:

* no more multiple instanciation of ToolContext (-25% of total nitdoc time)
* fixed JS scripts (no more bug with the search bar that does not display)

Testing:
* add more tests on pages structure
* add a script to build the documentation from origin/master version (easier to diff outputed doc after local changes)
* add a benchmark to nitdoc against the origin/master version

Performances comparison after fix on ToolContext:

![image](https://cloud.githubusercontent.com/assets/583144/8042382/e9feba6c-0dec-11e5-9bf9-0a3806209ee9.png)

(`CI-nitdoc` is busy right now on Jenkins so you will have to wait for the demo)

Pull-Request: #1446
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agotests: update sav/nitdoc_args4.res after merge with master.
Jean Privat [Sat, 13 Jun 2015 11:20:26 +0000 (07:20 -0400)]
tests: update sav/nitdoc_args4.res after merge with 

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

8 years agoMerge master to solve conflicts
Jean Privat [Sat, 13 Jun 2015 11:20:21 +0000 (07:20 -0400)]
Merge master to solve conflicts

8 years agotests: update sav/nitiwiki*.res
Jean Privat [Sat, 13 Jun 2015 02:28:10 +0000 (22:28 -0400)]
tests: update sav/nitiwiki*.res

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

8 years agonitiwiki: update tests
Jean Privat [Fri, 12 Jun 2015 23:17:26 +0000 (19:17 -0400)]
nitiwiki: update tests

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

8 years agotests: update with new `to_s` on collections
Jean Privat [Sun, 24 May 2015 02:40:53 +0000 (22:40 -0400)]
tests: update with new `to_s` on collections

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

8 years agolib/json: update nitunits with new Collection::to_s behavior
Jean Privat [Sat, 13 Jun 2015 03:39:59 +0000 (23:39 -0400)]
lib/json: update nitunits with new Collection::to_s behavior

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

8 years agolib/standard: add nitunits to Collection::plain_to_s
Jean Privat [Mon, 1 Jun 2015 14:09:59 +0000 (10:09 -0400)]
lib/standard: add nitunits to Collection::plain_to_s

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

8 years agolib/standand/string: provides a better to_s for collections
Jean Privat [Sun, 24 May 2015 02:40:31 +0000 (22:40 -0400)]
lib/standand/string: provides a better to_s for collections

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

8 years agolib/opts: clients of `errors` use `join("\n")`
Jean Privat [Sun, 31 May 2015 02:50:56 +0000 (22:50 -0400)]
lib/opts: clients of `errors` use `join("\n")`

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

8 years agolib/standard: format use `plain_to_s` for fast concat
Jean Privat [Sat, 13 Jun 2015 03:39:00 +0000 (23:39 -0400)]
lib/standard: format use `plain_to_s` for fast concat

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

8 years agotests: limit usertime and filesize with ulimit
Jean Privat [Sat, 13 Jun 2015 02:03:10 +0000 (22:03 -0400)]
tests: limit usertime and filesize with ulimit

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

8 years agotests: limit the res of generated res files
Jean Privat [Sat, 13 Jun 2015 02:01:55 +0000 (22:01 -0400)]
tests: limit the res of generated res files

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

8 years agotests: document (and reduce) the realtimelimit
Jean Privat [Sat, 13 Jun 2015 02:01:04 +0000 (22:01 -0400)]
tests: document (and reduce) the realtimelimit

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

8 years agolib/standard: StringWriter use `plain_to_s` for fast concat
Jean Privat [Sun, 31 May 2015 02:50:06 +0000 (22:50 -0400)]
lib/standard: StringWriter use `plain_to_s` for fast concat

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

8 years agolib_standard_array: reprovide Array::plain_to_s
Jean Privat [Sat, 13 Jun 2015 00:15:40 +0000 (20:15 -0400)]
lib_standard_array: reprovide Array::plain_to_s

Was dropped by the merge of #1400

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

8 years agonitikiwi: fix `src_path` and stop losing the first character
Jean Privat [Fri, 12 Jun 2015 15:41:05 +0000 (11:41 -0400)]
nitikiwi: fix `src_path` and stop losing the first character

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

8 years agonitiwiki: macro ROOT_URL is now relative
Jean Privat [Fri, 12 Jun 2015 15:14:58 +0000 (11:14 -0400)]
nitiwiki: macro ROOT_URL is now relative

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

8 years agonitiwiki: use relative href for tpl_tree
Jean Privat [Fri, 12 Jun 2015 16:43:04 +0000 (12:43 -0400)]
nitiwiki: use relative href for tpl_tree

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

8 years agotests: update sav/nitpick_args1.res because line changes in lib/standard/file.nit
Jean Privat [Fri, 12 Jun 2015 21:56:57 +0000 (17:56 -0400)]
tests: update sav/nitpick_args1.res because line changes in lib/standard/file.nit

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

8 years agosrc/nitni: fix `is_cprimitive` for virtual types
Alexis Laferrière [Fri, 12 Jun 2015 20:16:59 +0000 (16:16 -0400)]
src/nitni: fix `is_cprimitive` for virtual types

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocode: cleanup some docunits
Jean Privat [Fri, 12 Jun 2015 19:52:13 +0000 (15:52 -0400)]
code: cleanup some docunits

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

8 years agoMerge: friendz with Android Audio API
Jean Privat [Fri, 12 Jun 2015 19:15:28 +0000 (15:15 -0400)]
Merge: friendz with Android Audio API

friendz now uses the Android Audio API
+ fixed the new_global_ref functions in Assets and Resources

Pull-Request: #1125
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agolib/math: declare -lm in the library
Alexis Laferrière [Mon, 8 Jun 2015 12:28:38 +0000 (08:28 -0400)]
lib/math: declare -lm in the library

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: String split
Jean Privat [Fri, 12 Jun 2015 17:17:39 +0000 (13:17 -0400)]
Merge: String split

Right now, the string module is over 2500 loc long.

For the mental health of the maintainer(s), it was getting too big to understand what was going on in it.

So, this PR introduces the text group in standard, string is split in several modules inside of it:

* native: Introduces NativeString
* abstract_text: Introduction of basic types
* flat: Any array-based string
* ropes: Rope-based strings

Big con: To merge this PR, bootstrap will need to support the nullable arguments syntax.

But in the meantime, please feel free to comment on the code

Pull-Request: #1400
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>

8 years agoMerge: lib/array: remove useless cast to comparable.
Jean Privat [Fri, 12 Jun 2015 17:17:35 +0000 (13:17 -0400)]
Merge: lib/array: remove useless cast to comparable.

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #1286
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Kill dead nitg
Jean Privat [Fri, 12 Jun 2015 17:17:10 +0000 (13:17 -0400)]
Merge: Kill dead nitg

Remove all remaining deprecated reference to `nitg`.

The renaming of `nitg` to `nitc` and the deprecation of `nitg` was done Wed Dec 10 so 6 month ago. cf #1000

Pull-Request: #1504
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: Regeneration of c_src
Jean Privat [Fri, 12 Jun 2015 17:16:10 +0000 (13:16 -0400)]
Merge: Regeneration of c_src

Last one was Fri Feb 6, four months ago.

Close #1426

Pull-Request: #1455
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: ArthurDelamare <arthur.delamare@viacesi.fr>
Reviewed-by: Jean-Philippe Caissy <jpcaissy@piji.ca>

8 years agonitiwiki: make `tpl_link` relative
Jean Privat [Fri, 12 Jun 2015 15:10:09 +0000 (11:10 -0400)]
nitiwiki: make `tpl_link` relative

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

8 years agonitiwiki: make wikilinks relative
Jean Privat [Fri, 12 Jun 2015 15:09:30 +0000 (11:09 -0400)]
nitiwiki: make wikilinks relative

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

8 years agonitiwiki: add WikiEntry::href to have things independent from the root_url
Jean Privat [Fri, 12 Jun 2015 15:08:45 +0000 (11:08 -0400)]
nitiwiki: add WikiEntry::href to have things independent from the root_url

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

8 years agonitiwiki: add `WikiEntry::load_template` for local macros
Jean Privat [Fri, 12 Jun 2015 14:36:58 +0000 (10:36 -0400)]
nitiwiki: add `WikiEntry::load_template` for local macros

This way, new macro relative to an entry can exist (article name, dates, whatever)

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

8 years agoregern c_src
Jean Privat [Wed, 10 Jun 2015 13:14:37 +0000 (09:14 -0400)]
regern c_src

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

8 years agomakefile: create ../bin is required
Jean Privat [Fri, 12 Jun 2015 10:33:27 +0000 (06:33 -0400)]
makefile: create ../bin is required

because the dir is now empty, it starts uncreated on the initial git clone

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

8 years agoMerge: Kill big vararg in parser
Jean Privat [Fri, 12 Jun 2015 02:36:55 +0000 (22:36 -0400)]
Merge: Kill big vararg in parser

In `parser::Parser::build_reduce_table` an array is allocated with `.with_items` that takes a vararg.

The vararg used is quite large (1116 elements) and this cause that the generated C code takes 30m to compile with clang-3.6 if -O2 is used; it is likely a regression in llvm since the same code takes appreciatively 1s with clang-3.5 (and with gcc).

Unfortunately, clang-3.6 is currently provided by Apple to MacOS X users.

The proposed solution is to allocate the array then use a sequence of `add`. The generated C code is more complex but clang-3.6 can compile it.

Close #1498 (once c_src is regenerated)

Pull-Request: #1503
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>

8 years agoMerge: compiler: NativeString is a char* to please C library.
Jean Privat [Fri, 12 Jun 2015 02:36:48 +0000 (22:36 -0400)]
Merge: compiler: NativeString is a char* to please C library.

Commit 6b52ea3d5ca77dbcc6edbbf71c1aa9419a019bac  on chars and string changed the ctype of NativeString to `unsigned char*`. This was the cause of C warnings `-Wpointer-sign` because `unsigned char*` is not a subtype of the universally used `char*` that is activated by default on clang.

So the change is reverted and NativeString become again `char*` (note that Byte and Char ctypes are not reverted)

close #1499

Pull-Request: #1502
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: example: add boolean usage example from rosetta code
Jean Privat [Fri, 12 Jun 2015 02:36:42 +0000 (22:36 -0400)]
Merge: example: add boolean usage example from rosetta code

Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

Pull-Request: #1489
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agorosettacode: pickrandom element
BlackMinou [Wed, 10 Jun 2015 08:07:46 +0000 (10:07 +0200)]
rosettacode: pickrandom element

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agorosettacode: pernicious numbers
BlackMinou [Wed, 10 Jun 2015 07:39:56 +0000 (09:39 +0200)]
rosettacode: pernicious numbers

Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>

8 years agoman: update title of nitc to `NITC`
Jean Privat [Fri, 12 Jun 2015 03:14:26 +0000 (23:14 -0400)]
man: update title of nitc to `NITC`

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

8 years agoc_src: rename the primitive compiler to `c_src/nitc` everywhere
Jean Privat [Fri, 12 Jun 2015 03:13:01 +0000 (23:13 -0400)]
c_src: rename the primitive compiler to `c_src/nitc` everywhere

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

8 years agonittester: use new compiler engine names (`nitc*`)
Jean Privat [Fri, 12 Jun 2015 03:08:41 +0000 (23:08 -0400)]
nittester: use new compiler engine names (`nitc*`)

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

8 years agotests: rename compiler engines with `nitc*`, not `nitg*`
Jean Privat [Fri, 12 Jun 2015 03:05:41 +0000 (23:05 -0400)]
tests: rename compiler engines with `nitc*`, not `nitg*`

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