Alexis Laferrière [Mon, 25 Apr 2016 14:36:09 +0000 (10:36 -0400)]
lib/json: remove public dependency from serialization to static
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Tue, 10 May 2016 14:32:32 +0000 (10:32 -0400)]
Merge: JSON Parser Optimization
This PR improves the speed of JSON parsing with the `string_parser` module. The new version of `parse_json_string` is heavily inspired by Python's implementation, available [here](https://github.com/python/cpython/blob/master/Modules/_json.c)
Time is usually either as performing as before or better, Valgrind also gives the new version an advantage, sometimes significant.
On `large_escaped` (~120M, lots of escaped characters), we have:
* Before: 13 748 436 458 Ir
* After: 11 687 104 643 Ir
i.e. an improvement of ~18%
Time is:
* Before: 0m4.428s
* After: 0m3.932s
i.e. an improvement of ~13%
Note that on this particular test, although the number of allocations is limited as much as we can, Boehm still cannibalizes the runtime, seeing that the real time is ~2.6s.
Perf gives a total time of ~38% in GC_mark and ~7% in GC_cache_miss.
Some more optimizations can be thought, but this shows how important a good GC is necessary for the future, this program can be a good metric of how GC usage can be improved.
For further reference, Python3 on the same test gives the following output on time and Valgrind:
* Time (user): 0m1.760s
* Time (real): 0m2.177s
* Valgrind: 8 845 966 867 Ir
Pull-Request: #2058
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 10 May 2016 14:31:50 +0000 (10:31 -0400)]
Merge: bugfix: `is optional` attributes was evaluated too much
`is optional` attribute must not be evaluated on the allocation, but only if `null` is given in the `new`.
Since the use of `is optional` did not spread, no one seems to have been bitten yet.
Pull-Request: #2053
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 9 May 2016 19:11:27 +0000 (15:11 -0400)]
lib/core: Perfize reset in `FlatBuffer`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 20:33:07 +0000 (16:33 -0400)]
lib/core: Replaced FFI version of set_char_at by pure Nit
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 20:32:45 +0000 (16:32 -0400)]
lib/core: Added new `append_substring` service to avoid creating ephemeral instances
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 20:32:04 +0000 (16:32 -0400)]
lib/json: Faster `parse_json_string` implementation
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Fri, 6 May 2016 20:31:25 +0000 (16:31 -0400)]
Merge: Flatbuffer fix
Fix a bug at initialization of a flat buffer from a string.
Reported by @BlackMinou
Pull-Request: #2056
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 6 May 2016 20:31:22 +0000 (16:31 -0400)]
Merge: lib/fixed_ints: fix crash on `"-".is_int`
Pull-Request: #2055
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 17:38:41 +0000 (13:38 -0400)]
tests: Added test for `FlatBuffer::from`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 15:43:09 +0000 (11:43 -0400)]
lib/json: Implemented `pretty_json_visit` on JsonParseError
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 6 May 2016 15:42:39 +0000 (11:42 -0400)]
lib/core: Added surrogate detection methods to `Char`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Thu, 5 May 2016 15:05:42 +0000 (11:05 -0400)]
lib/core: Fix `new FlatBuffer.from`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Thu, 5 May 2016 17:26:16 +0000 (13:26 -0400)]
tests: update result of test_text_stat for change to is_int
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 1 May 2016 21:33:53 +0000 (17:33 -0400)]
lib/fixed_ints: fix crash on `"-".is_int`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Thu, 5 May 2016 01:30:28 +0000 (21:30 -0400)]
Merge: Fix RopeBytes
A bug had found its way into RopeBytes when merging UTF-8, this PR should fix the issues with it.
Close #2014
Pull-Request: #2052
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 5 May 2016 01:30:17 +0000 (21:30 -0400)]
Merge: Examples class name
@Morriar was interested in the `try_get_mclass_by_id` for its documentation services but wanted to pass a string (and not a AST node) and work on all module (not just one).
I suggested to use parse_something to transform the string into a qualified class name then filter the classes of the model on it. As an experimentation, I wrote a simple example program that does this.
@Morriar then suggested to put the sample program in the repository to document how can the various tools of the model can be used to do things.
This PR inaugurate the new directory `src/examples` that is intended to contains small snippets and programs that use the `nitc` package.
Pull-Request: #2050
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Thu, 5 May 2016 01:30:15 +0000 (21:30 -0400)]
Merge: Clean some errors in benches
add html output for json and fix two issues in http://gresil.org/jenkins/job/nit_bench/120/testReport/
Pull-Request: #2043
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Wed, 4 May 2016 14:27:17 +0000 (10:27 -0400)]
tests: add base_is_optional to check the evaluation order of attribute values
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 4 May 2016 14:25:50 +0000 (10:25 -0400)]
nitc/engines: do not initialize optional attributes on the allocation
Signed-off-by: Jean Privat <jean@pryen.org>
Lucas Bajolet [Tue, 3 May 2016 19:53:06 +0000 (15:53 -0400)]
lib/core: Fix RopeBytes::[]
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 3 May 2016 15:45:48 +0000 (11:45 -0400)]
tests: tests also programs from `src/examples/`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 3 May 2016 19:50:25 +0000 (15:50 -0400)]
tests: update error message for class name hints
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 3 May 2016 15:44:54 +0000 (11:44 -0400)]
nitc/examples: inaugurate the directory with `get_mclasses`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 3 May 2016 19:49:59 +0000 (15:49 -0400)]
modelbuilder: improve hint engine with two levenshtein
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 3 May 2016 15:14:57 +0000 (11:14 -0400)]
lib/more_collections: add `BestDistance` as an helper class
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 3 May 2016 15:04:31 +0000 (11:04 -0400)]
Merge: Simplify CSV
This PR is a rewriting of the CSV library, it should now be easier to use and should not fail anymore due to `\r\n` being the default, this one has been replaced by a single `\n` character.
The `CSVFormat` class has been removed since it introduced more complexity than usefulness, and now the separator, eol and delimiter can be set independently after creation of the `CsvDocument` or a `CsvReader/Writer`.
Concerning performance, the new parser is way faster than the old one.
On a simple 4Mio file, parsing used to take 2.401s.
On the new parser, the measured user time is 0.179s, hence an improvement by a factor of ~12.
Old code sample
~~~nit
import csv
var fl = new FileReader.open(args[0])
var rd = new CsvReader.with_format(fl, new CsvFormat('"', ',', "\r"))
var lns = new Array[Array[String]]
for i in rd do lns.add i
~~~
New code sample
~~~nit
import csv
var rd = new CsvReader.from_string(args[0].to_path.read_all)
rd.eol = "\r"
rd.read_all
~~~
Pull-Request: #2048
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 3 May 2016 15:03:29 +0000 (11:03 -0400)]
Merge: Perfize FlatBuffer
This PR introduces a bit of a performance improvement to `FlatBuffer` by limiting the number of reallocations for common cases.
Pull-Request: #2049
Reviewed-by: Jean Privat <jean@pryen.org>
Lucas Bajolet [Tue, 3 May 2016 03:27:28 +0000 (23:27 -0400)]
lib/core: Stop allocating 1 byte more when initializing a `FlatBuffer` with capacity
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 2 May 2016 19:32:26 +0000 (15:32 -0400)]
lib/core: Improved running time for reset
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 29 Apr 2016 20:15:24 +0000 (16:15 -0400)]
lib/core: Improve FlatBuffer re-allocation rate by pre-allocating at least 16 bytes
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 2 May 2016 19:03:15 +0000 (15:03 -0400)]
tests: Added new CSV test
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 29 Apr 2016 20:17:27 +0000 (16:17 -0400)]
src: Updated uses of CSV library
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 29 Apr 2016 17:43:16 +0000 (13:43 -0400)]
lib/csv: Major rewriting for performance and simplicity
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 29 Apr 2016 17:10:22 +0000 (13:10 -0400)]
lib/core: `u8char_len` is now public
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Fri, 29 Apr 2016 17:10:03 +0000 (13:10 -0400)]
lib/core: Added simple write char method to `Writer`
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 3 May 2016 01:26:26 +0000 (21:26 -0400)]
Merge: Qualified Class Names
After #2034 and #2041 , some of you might had some theories about future episodes. While this is not GoT, I hope the you found that the following is a nice surprise: qualified class names are now understood by the tools.
The specification is the following:
On conflicting class-names, you can use the package_name to qualify the class. i.e. `package_name::ClassName`. This is enough for all public class, since it is the canonical name for them.
For conflicting private classes, the package_name should be enough in most cases. If there is still a conflict, you need to precise also the name of the module. i.e. `package_name::module_name::ClassName`.
Qualified properties is a more complex thing, and since the class is used as a namespace for them, there is statically less property name conflicts (except for classes commonly refined, like Sys maybe). So I plan to put qualified properly names in a boat heading to King’s Landing and let them row.
Pull-Request: #2047
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Jean Privat [Mon, 2 May 2016 19:58:20 +0000 (15:58 -0400)]
tests: update sav because new error messages on class name error
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 2 May 2016 19:55:16 +0000 (15:55 -0400)]
tests: add `base_name_conflict` to test more conflicting names
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 2 May 2016 23:05:29 +0000 (19:05 -0400)]
Merge: Rubix cube
A simple Rubix Cube library, don't mind the diff, a huge part is just test reuslts :)
It should support all the commands from the Singmaster notation (see [here](http://ruwix.com/the-rubiks-cube/notation/) for more details on the notation)
Note that the big number of specialized top-level functions with ints show in this case how useful a proper Enum system would be :)
Pull-Request: #2032
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Mon, 2 May 2016 23:05:12 +0000 (19:05 -0400)]
Merge: lib: add logic library
After cleaning some CTF code.
More code, like a parser and generation of common format might come
Pull-Request: #2037
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Jean Privat [Mon, 2 May 2016 23:05:07 +0000 (19:05 -0400)]
Merge: Add nitlight and jwrapper to the benchbed
Also improve jwrapper a little
Pull-Request: #2044
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 2 May 2016 23:05:03 +0000 (19:05 -0400)]
Merge: nitcatalog: handle local images
nitcatalog is extended to detect links to local images, copy the resource in the catalog directory and hijack the generated link.
This should fix #2042 and fix the images in http://nitlanguage.org/catalog/p/tinks.html
Most is done by monkey-patching (aka dirty refinement) since the doc_down model uses an internal private global markdown decorator. I'm not sure what should be the best approach here, and I had to improvise since @Morriar is MIA.
Bonus:
* `file_copy_to` is fixed and do not corrupt binary files (thanks @R4PaSs)
* `tests/test_prog` is used to test the catalog
Pull-Request: #2046
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Jean Privat [Mon, 2 May 2016 19:44:00 +0000 (15:44 -0400)]
modelize_class: use the new `get_mclass_by_id` to identify class refinement
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 2 May 2016 19:43:03 +0000 (15:43 -0400)]
modelbuilder: Add a specific error message for class ambiguities.
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 2 May 2016 19:42:26 +0000 (15:42 -0400)]
modelbuilder: add (and use) `AQclassid::full_name` for better messages
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 2 May 2016 19:39:21 +0000 (15:39 -0400)]
modelbuilder: split the class_not_found error in a separate function
Signed-off-by: Jean Privat <jean@pryen.org>
Lucas Bajolet [Mon, 2 May 2016 19:16:17 +0000 (15:16 -0400)]
tests: Added rubix tests to skip for niti and nitvm
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Mon, 2 May 2016 02:22:38 +0000 (22:22 -0400)]
tests: update sav because improved error messages on class names
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 2 May 2016 00:58:10 +0000 (20:58 -0400)]
tests: use more complex names for `test_model_visitor`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 2 May 2016 00:54:04 +0000 (20:54 -0400)]
tests: add `error_names` and extends the `names` hierarchy
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 2 May 2016 00:45:07 +0000 (20:45 -0400)]
modelbuilder: add `try_get_mclass_by_qid` to handle qualified class names
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 2 May 2016 01:21:27 +0000 (21:21 -0400)]
tests: add metadata & content in test_prog to test nitcatalog
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 1 May 2016 18:01:29 +0000 (14:01 -0400)]
nitcatalog: copy local image resources inside the output directory
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 2 May 2016 00:42:34 +0000 (20:42 -0400)]
modelbuilder: fix hint on bad classnames
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 1 May 2016 17:37:23 +0000 (13:37 -0400)]
nitc/doc/doc_down: store the current mdoc object in the decorator
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 1 May 2016 17:36:54 +0000 (13:36 -0400)]
nitc/doc/doc_down: make NitdocDecorator public to it can be extended
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sun, 1 May 2016 17:28:18 +0000 (13:28 -0400)]
lib/core/file: use Bytes in file copy (or else binary copy fail)
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 29 Apr 2016 15:51:27 +0000 (11:51 -0400)]
benches: add jwrapper to the bench bed
jwrapper uses nitcc and have different codebase and author
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 29 Apr 2016 15:43:46 +0000 (11:43 -0400)]
jwrapper: make name-related methods lazy
for bin/jwrapper /usr/share/java/ant.jar
before: 0m4.308s
after: 0m3.360s
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 29 Apr 2016 15:13:41 +0000 (11:13 -0400)]
benches: add nitlight to the bench bed
nitlight uses a lot of strings and light objects to generate html
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 28 Apr 2016 23:04:51 +0000 (19:04 -0400)]
Merge: Better Entity::full_name
This PR is a continuation of previous work on packages, model entities and namespaces. See #1069, #1092 or #1032 for the history.
The point of `full_name` is to offer the simpler canonical names possible that is:
* global. i.e. based on the package name.
* stable on modifications. i.e. the name of an entity does not change if other entities are added.
* human readable. i.e. some encoding but not binary.
* scalable. i.e. simple entities have simple names, complex entities have more complex names.
This PR add the following:
* no name collision on distinct kind of entities (packages, root groups, and default modules conflict no more).
* do not use characters that have a special semantic in URL (no more `#` and `/`).
* some bugfixes and simplifications.
* a complex test case with a lot of rare entity constructions (so complex names).
* a extended `test_model_visitor` that check and count names.
## Proposed full_name policy
### Common public entities
They are those you might look for in a doc.
They can appear in error messages.
In case of name conflict in programs, you might also use them to disambiguate things (in the future)
* packages have a simple name.
e.g. `core` or `nitcorn` (unchanged)
* groups, are separated by `>` (instead of `/`) and terminated by a trailing `>` (to distinguish them)
e.g. `core>` or `core>collection>`
* modules are just prefixed by their package, even the default module
e.g. `core::kernel` or `core::core`
* public classes are prefixed by their packages
e.g. `core::Object` or `core::Buffer` (unchanged)
* public global properties without refinement, are prefixed by their package and class
e.g. `core::Object::==` or `core::Buffer::add` (unchanged)
Because of modules and class refinement, things unusual in other languages must have a full_name:
Public global properties introduced by a refinement, require the module (between the package and the class)
e.g. `core::file::Sys::print`
Currently, the compiler allows that a same package refines a public class in two distinct modules, with two homonym properties.
I'm not sure this is a good idea, but the rare uses force us to accept them.
The most infamous are `nitc::nitc::ToolContext::opt_dir` and `nitc::nitdoc::ToolContext::opt_dir`.
Private classes and properties are only visible by their module, thus the module name is required in their full_name.
e.g. `core::hash_collection::HashNode` or `core::hash_collection::HashNode::key` (unchanged)
### Definitions
As you know, class definitions (introductions and refinements) and property definitions are distinguished from their global counterpart.
Most of the time, we try to avoid referring specifically to them when the global thing is sufficient.
Class definitions combine the information of a class and a module.
Property definitions combine the information of a class definition and a property.
Therefore, the quantity of information for the worst case of property definition can be quite large.
A `$` is used to separate the information (it was `#` previously).
A single `$` means a class definition and two `$` means a property definition.
Introductions (without refinement nor redefinition) are designated like global properties (`::` are just replaced by `$`).
* `core$Object` is the definition that introduces of `core::Object`
* `core$Buffer$add` is the definition that introduces `core::Buffer::add`
* `core::hash_collection$HashNode$key` is the definition that introduces `core::hash_collection::HashNode::key`.
For refinements of classes, the class part is prefixed by package and module information when they are needed.
As requested, the full_name of the refinement of a public class in the same package is more simple than the refinement of a private class in a different package.
* `core::file$Sys` is the refinement of Sys in `core::file`. `Sys` is unambiguously `core::Sys`
* `counter::counter$core::Collection` is the refinement of `core::Collection` in the module `counter::counter`
* `hash_debug::hash_debug$core::hash_collection::HashCollection` is the refinement of `HashCollection` (it's a private class) in `hash_debug`
* `pthreads::extra$::pthreads::NativePthread` is the refinement of the private class `NativePthread` in an extra module in the same package (`$::` means that the package name is the same).
For redefinitions of properties, the full_name for the class definition is used (see above), then the property part contains whatever package, module or class information is required.
* `core$Array$SimpleCollection::add` the redefinition of `SimpleCollection::add` into `Array`
* `core$String$::abstract_text::Text::substrings` the redefinition of the private method `Text::substrings` in `String`
For simple method refinements (refinement of the introduction), most of the information is already given by the module or the class, the property part is thus simple.
* `hash_debug::hash_debug$core::hash_collection::HashCollection$store` is the refinement of the private method `HashCollection::store` in the useful package `has_debug`.
Complex method redefinition of private things provide the worst full_name (3 package names, 3 module names, 2 class names and a property name).
* `ropes_debug::ropes_debug$core::ropes::Concat$::ropes_debug::Text::internal_to_dot` is the redefinition of `ropes_debug::ropes_debug::Text::internal_to_dot` in the class `core::ropes::Concat` by the module `ropes_debug::ropes_debug`.
Pull-Request: #2041
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Thu, 28 Apr 2016 23:04:49 +0000 (19:04 -0400)]
Merge: Faster ASCII-only strings
This simple PR re-introduces the concept of ASCII strings for faster no-overhead accesses to random characters in a string.
The class is private as it is to be used only internally, no client should care for the specific type of a String and all performance improvements will be automatic, should the optimization be possible.
Since we are dealing with UTF-8, the only case where O(1) access can efficiently and without much overhead (one `if` statement at creation) be determined, is when a string only contains ASCII characters.
Note that since the Buffer can change access semantics depending on what is appended during its lifetime, no ASCII-only FlatBuffer has been added.
This is implemented here by introducing two subclasses of FlatString, one for ASCII only strings, and one for regular Unicode strings (the old FlatString).
In terms of performance, in the compiler, there is a ~0.5% improvement, but in specific cases like JSON parsing for the `big_gov_data.json` (where not a single unicode character is present) bench, the difference amounts to ~35%.
Pull-Request: #2040
Reviewed-by: Jean Privat <jean@pryen.org>
Lucas Bajolet [Mon, 25 Apr 2016 15:12:08 +0000 (11:12 -0400)]
lib: Update text_stat and tests for new String types
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 25 Apr 2016 15:00:12 +0000 (11:00 -0400)]
lib: Fix serialization issue with string-oriented typing
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Lucas Bajolet [Mon, 25 Apr 2016 14:52:40 +0000 (10:52 -0400)]
tests: Updated sav for old tests
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Wed, 27 Apr 2016 15:38:12 +0000 (11:38 -0400)]
bench: git-ignore some files for json and polygons
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 27 Apr 2016 15:37:29 +0000 (11:37 -0400)]
bench/markdown: disable SpecialXmlCharsDecorator that just timeout
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 27 Apr 2016 15:37:03 +0000 (11:37 -0400)]
bench/markdown: disable pandoc that is broken
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 27 Apr 2016 15:36:41 +0000 (11:36 -0400)]
bench/json: add a `--fast` option and `test` rule
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 27 Apr 2016 15:36:04 +0000 (11:36 -0400)]
bench/json: output html
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 27 Apr 2016 15:35:36 +0000 (11:35 -0400)]
bench/json: increase gov_data size
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 26 Apr 2016 23:47:23 +0000 (19:47 -0400)]
nitls: do not add '/' since groups are ended by '>'
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Wed, 27 Apr 2016 13:50:11 +0000 (09:50 -0400)]
tests: update because of new full_names
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 23 Apr 2016 21:58:24 +0000 (17:58 -0400)]
tests: add new test package `names` for test_model_visitor
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 23 Apr 2016 21:23:05 +0000 (17:23 -0400)]
nitc/test_model_visitor: check and count fullnames
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 23 Apr 2016 21:21:55 +0000 (17:21 -0400)]
android: remove superfluous redefinitions of SELF
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 23 Apr 2016 21:10:26 +0000 (17:10 -0400)]
model: simplify module name if package is enough for MPropdef::full_name
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 23 Apr 2016 21:02:58 +0000 (17:02 -0400)]
model: avoid full_name conflict with global properties
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 23 Apr 2016 20:49:16 +0000 (16:49 -0400)]
model: fullnames use `$` instead of `#` for classdefs and propdefs
`#` is a bad symbol to use in url
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 23 Apr 2016 20:45:38 +0000 (16:45 -0400)]
model: use > in fullnames of groups. An add a trailing `>` to them distinct.
* `core` is a package
* `core>` its root groups
* `core>collection>` a subgroup
* `core::core` the default module
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 23 Apr 2016 20:43:29 +0000 (16:43 -0400)]
model: double the name of the default module to make it distinct with the package.
E.g. `core` vs. `core::core`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 26 Apr 2016 00:20:57 +0000 (20:20 -0400)]
Merge: nitc: use Array instead of List
valgrind says we gain 2%
Pull-Request: #2039
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 26 Apr 2016 00:20:55 +0000 (20:20 -0400)]
Merge: faster new factory
new factories are badly implemented.
They assume a stub temporary receiver exists.
This temporary receiver is required because it currently holds the method and the formal types.
However, this object could be reused if the formal types are the same.
It's what is doing the PR.
This is still a temporary workaround solution, doing things correctly need a lot of more work.
Asked by @R4PaSs
Pull-Request: #2038
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 26 Apr 2016 00:20:50 +0000 (20:20 -0400)]
Merge: interpreter use the catch from the compiler
Previous PR #2011 introduced the `do ... catch ... end` bloc in the interpreter and the compiler.
This one makes it so the interpreter is using the mecanism (longjmp) from the compiler
Pull-Request: #2036
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Jean Privat [Tue, 26 Apr 2016 00:20:48 +0000 (20:20 -0400)]
Merge: Continuous integration tests for Nitcorn
Test some of the main nitcorn features for regression. This would have caught the last bugs we experienced with nitcorn: #2023, the binary file bug, the file server directory access without the final /, etc. This structure could be used to add more tests in the future, for new or forgotten features and for existing clients like Tnitter and Opportunity.
Pull-Request: #2031
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexis Laferrière [Sat, 23 Apr 2016 13:43:12 +0000 (09:43 -0400)]
lib/pthreads: less warnings on OS X
unknown-attributes error are thrown by the inclusion of `gc.h`.
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 23 Apr 2016 14:00:23 +0000 (10:00 -0400)]
niti: simply use `cc` as compiler
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 23 Apr 2016 13:38:26 +0000 (09:38 -0400)]
niti: fix support for cflags from pkgconfig
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 23 Apr 2016 08:31:31 +0000 (04:31 -0400)]
Merge: JSON serialization: write pretty JSON
Intro an option in `JsonSerializer` to write pretty indented JSON. By default, the generated JSON is somewhat minified, this could be improved if needed.
See the generated JSON in the tests below. I chose to leave the metadata and other special short objects non-indented as they are not intended for humans. The option `plain_json` is fully compatible with `pretty_json` (see alt4.res), I expect them to be used together often.
This was requested by @Morriar and it could allow us to deprecate the `json::static` writer API.
Pull-Request: #2035
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 23 Apr 2016 08:31:28 +0000 (04:31 -0400)]
Merge: Hint to bad class names
Add hints when a class name cause an error.
Basically 3 cases are considered: spellign, bad visibility and not imported. e.g.
~~~
Error: class `Fail` not found in module `error_unk_class`.
Error: class `Boolean` not found in module `error_unk_class`. Did you mean `Bool`?
Error: class `core::list::ListNode` not visible in module `error_unk_class`.
Error: class `POSet` not found in module `error_unk_class`. Maybe import `poset`?
~~~
Pull-Request: #2034
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Sat, 23 Apr 2016 00:54:03 +0000 (20:54 -0400)]
nitc: use Array instead of List
valgrind says we gain 2%
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Sat, 23 Apr 2016 00:08:05 +0000 (20:08 -0400)]
tests: add base_new_factory
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 22 Apr 2016 23:50:18 +0000 (19:50 -0400)]
nitc: hack to fasten new factories
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 22 Apr 2016 02:27:00 +0000 (22:27 -0400)]
tests: add tests for unknown class hints
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 22 Apr 2016 02:11:03 +0000 (22:11 -0400)]
modelbuilder: propose hints when a class is not found
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 22 Apr 2016 00:54:32 +0000 (20:54 -0400)]
modelize: get the Bool type faster
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 22 Apr 2016 20:43:35 +0000 (16:43 -0400)]
lib: add logic library
After cleaning some CTF code.
Signed-off-by: Jean Privat <jean@pryen.org>
Lucas Bajolet [Fri, 22 Apr 2016 20:08:31 +0000 (16:08 -0400)]
lib/core: Faster access to length in ropes
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Alexis Laferrière [Fri, 22 Apr 2016 13:04:53 +0000 (09:04 -0400)]
tests: test pretty JSON, with and without plain JSON
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>