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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Jean Privat [Sat, 13 Jun 2015 11:20:21 +0000 (07:20 -0400)]
Merge master to solve conflicts
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>
Jean Privat [Fri, 12 Jun 2015 23:17:26 +0000 (19:17 -0400)]
nitiwiki: update tests
Signed-off-by: Jean Privat <jean@pryen.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Jean Privat [Wed, 10 Jun 2015 13:14:37 +0000 (09:14 -0400)]
regern c_src
Signed-off-by: Jean Privat <jean@pryen.org>
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>
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>
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>
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>
BlackMinou [Wed, 10 Jun 2015 08:07:46 +0000 (10:07 +0200)]
rosettacode: pickrandom element
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Wed, 10 Jun 2015 07:39:56 +0000 (09:39 +0200)]
rosettacode: pernicious numbers
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
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>
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>
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>
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>
Jean Privat [Fri, 12 Jun 2015 02:56:23 +0000 (22:56 -0400)]
bin: remove old transitionnal script bin/nitg
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 12 Jun 2015 02:54:29 +0000 (22:54 -0400)]
tests: use `nitc` in the `nitc.args`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 12 Jun 2015 02:53:58 +0000 (22:53 -0400)]
misc/bash_completion: remove hack for nitg
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 12 Jun 2015 02:53:31 +0000 (22:53 -0400)]
lib/emscripten: talk about `nitc` (not `nitg`)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 12 Jun 2015 02:48:46 +0000 (22:48 -0400)]
vim: rename `nitg` checker to `nitpick`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 12 Jun 2015 02:42:54 +0000 (22:42 -0400)]
remove bin/Makefile (?!)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 12 Jun 2015 02:36:11 +0000 (22:36 -0400)]
Merge: nitunit: use the Markdown parser from `lib/markdown`
Since the introduction of `nitmd`, `nitunit` was still using the old `docdown` parser.
This PR do the migration.
There will be a lot of unrecognized tests since the old paerser allowed between four and five spaces before a nitunit, the new one enforce the rule of 5 (couting the space after the `#` comment token).
Before:
~~~nit
# assert true
~~~
Was recognized as nitunit, but if you ignore the `# ` string as prefix of each comment, there is only 3 spaces before the nitunit.
After:
~~~nit
# assert true
~~~
We need 4 spaces before the nitunit plus the `# ` prefix, this gives us 5 spaces.
Note, this is already the behavior followed by Nitdoc.
Should fix #1331
Pull-Request: #1332
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 11 Jun 2015 23:29:16 +0000 (19:29 -0400)]
rosetta code: visualize_a_tree
Signed-off-by: Jean Privat <jean@pryen.org>