BlackMinou [Wed, 29 Mar 2017 18:54:12 +0000 (14:54 -0400)]
Actors example Thread ring fixes
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
Jean Privat [Tue, 28 Mar 2017 12:27:49 +0000 (08:27 -0400)]
Merge: intrepreter: Fix the documentation of `PrimitiveInstance`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #2400
Jean Privat [Tue, 28 Mar 2017 12:27:46 +0000 (08:27 -0400)]
Merge: intrepreter: Fix the documentation of `Instance::is_true`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #2399
Jean Privat [Tue, 28 Mar 2017 12:27:44 +0000 (08:27 -0400)]
Merge: compiler: Refactor
Various minor refactorings done for PR #2397.
Pull-Request: #2398
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 28 Mar 2017 12:27:32 +0000 (08:27 -0400)]
Merge: gamnit: optimize the `flat` 2D api using GPU buffers
`gamnit::flat` is an API to quickly and easily write 2D games, it is built around sprites added to either the world `sprites` or to the `ui_sprites` sets. However, the absolute lack of optimization led to slow performances when there was a large number of sprites.
This PR rewrites the implementation of the `flat` API using vertex buffer objects (VBO) to keep sprite data in the GPU memory. The data is updated only when an attribute of a sprite is modified.
The result is 200 times higher framerate in the new minimal program `template_flat` with 2000 sprites and random modifications, going from ~10 FPS to ~2000 FPS.
This requires managing the memory of the GPU, growing it as needed, keeping a list of freed spaces and defragmenting it to compress the data after sprite deletion. The GPU memory is simulated by the `GroupedArray` class, it keeps a bit more information than needed but it would also support objects with varying sizes like the 3D models of the `depth` API. All sprites are sorted when added to either `sprites` or `ui_sprites` allowing for bulk drawing of sprites using the same pixel data and usage type.
This PR extends the current API by adding a few new services:
* The attribute `Sprite::static`, when at `true`, gives a hint to the framework that this sprite won't change often and that it is added in bulk with other static sprites. This value can be ignored in the prototyping phase of a game and added when better performances are needed.
* The pseudo attributes `red`, `green` and `blue` modifies the tint of a sprite. They are more intuitive to use than the array `tint` and they allow for an automatic update of the related data on the GPU.
There is two downsides to this implementation:
* The attribute `Point3d::sprites` is added by refinement to all 3D points, even those not used directly by the graphics framework. Hopefully it will add only a small overhead, and (of course) only in clients of gamnit games.
* There is no easily predictable order in which the sprites are drawn anymore. Causing issues with non-opaque sprites which should normally be drawn last. This could be fixed by a new sprite category or a boolean attribute similar to `static`.
Pull-Request: #2395
Reviewed-by: Jean Privat <jean@pryen.org>
Jean-Christophe Beaupré [Tue, 28 Mar 2017 04:16:02 +0000 (00:16 -0400)]
intrepreter: Fix the documentation of `PrimitiveInstance`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Tue, 28 Mar 2017 04:14:30 +0000 (00:14 -0400)]
intrepreter: Fix the documentation of `Instance::is_true`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Alexis Laferrière [Fri, 24 Mar 2017 00:26:04 +0000 (20:26 -0400)]
gamnit: make SpriteSet behave more like a Set
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Mon, 27 Mar 2017 13:13:56 +0000 (09:13 -0400)]
Merge: mdoc_or_fallback: Refactor
Centralize its definition and update its documentation.
Pull-Request: #2231
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean-Christophe Beaupré [Fri, 24 Mar 2017 04:42:41 +0000 (00:42 -0400)]
model: Make the `anchor` parameter of `MType::anchor_to` nullable
Refactor the code of `TypeVisitor::anchor_to`.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sun, 26 Mar 2017 02:43:13 +0000 (22:43 -0400)]
model: Add a constant for the bottom type
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 24 Mar 2017 04:39:52 +0000 (00:39 -0400)]
model: Add precision to the documentation of type metrics
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Fri, 24 Mar 2017 04:37:11 +0000 (00:37 -0400)]
model: Fix indentation
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sat, 25 Mar 2017 02:45:14 +0000 (22:45 -0400)]
java_compiler: Fix the documentation of `is_java_primitive`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Sat, 25 Mar 2017 02:44:44 +0000 (22:44 -0400)]
compiler: Merge `maybenull` and `maybe_null`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Fri, 24 Mar 2017 16:09:58 +0000 (12:09 -0400)]
Merge: hash_collections: Fix the documentation of `Set::new`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Pull-Request: #2393
Alexis Laferrière [Thu, 23 Mar 2017 21:15:11 +0000 (17:15 -0400)]
nitunit: intrude import modules to test private entities
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 17 Mar 2017 02:42:38 +0000 (22:42 -0400)]
gamnit: intro a template project for 2D games
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 17 Mar 2017 02:40:50 +0000 (22:40 -0400)]
gamnit: fix standalone triangle
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 23 Mar 2017 17:40:17 +0000 (13:40 -0400)]
action_nitro: update for the improved flat API and for a better look
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 10 Mar 2017 14:50:24 +0000 (09:50 -0500)]
action_nitro: bug fix
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 23 Mar 2017 16:59:40 +0000 (12:59 -0400)]
gamnit: intro color services to `Sprite`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 20 Mar 2017 15:32:02 +0000 (11:32 -0400)]
gamnit: rewrite implementation to use VBOs
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 17 Mar 2017 01:40:48 +0000 (21:40 -0400)]
c & matrix: make some services public for low level clients
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 16 Mar 2017 03:50:32 +0000 (23:50 -0400)]
glesv2: add integer variants to operations on buffers
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 20 Mar 2017 15:35:40 +0000 (11:35 -0400)]
glesv2: intro buffer services
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 6 Mar 2017 19:41:54 +0000 (14:41 -0500)]
gamnit: time the performance of the core services
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sun, 19 Mar 2017 22:42:19 +0000 (18:42 -0400)]
core: implement `MinHeap::clear` and intro `Pointer::nul`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean-Christophe Beaupré [Wed, 22 Mar 2017 20:34:56 +0000 (16:34 -0400)]
hash_collections: Fix the documentation of `Set::new`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Mon, 22 Aug 2016 20:36:19 +0000 (16:36 -0400)]
model: Document base cases of `mdoc_or_fallback`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Thu, 14 Jul 2016 17:05:52 +0000 (13:05 -0400)]
mdoc: Fix documentation of `mdoc_or_fallback`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Mon, 22 Aug 2016 20:35:02 +0000 (16:35 -0400)]
highlight: Use `mdoc_or_fallback`
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean-Christophe Beaupré [Mon, 22 Aug 2016 20:25:23 +0000 (16:25 -0400)]
model: Promote definitions of `mdoc_or_fallback`
Merge duplicates.
Signed-off-by: Jean-Christophe Beaupré <jcbrinfo@users.noreply.github.com>
Jean Privat [Wed, 22 Mar 2017 12:50:22 +0000 (08:50 -0400)]
Merge: oot: add Devil's Avocados, a Recipe Preparation Game
Pull-Request: #2392
Jean Privat [Mon, 20 Mar 2017 20:11:28 +0000 (16:11 -0400)]
oot: add Devil's Avocados, a Recipe Preparation Game
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 20 Mar 2017 20:09:01 +0000 (16:09 -0400)]
Merge: typing: add services for intersecting and subtracting types
Nit does not have intersection nor union types, however, the intersection and the difference operations on types are needed for a better behavior of the adaptive typing system.
Currently, the only need of type intersection and type difference is with `isa`. The previous implementation did not really implement them and only did the following:
~~~nit
var x: X
...
if x isa Y then
# if X<:Y then x is still a X (and you get a warning) else x is now a Y
...
else
# nothing never change here. x is a X
...
end
~~~
Now, the `then` branch, handle the merge of nullable types and the `else` branch might also be adapted.
~~~nit
var x: nullable X # where Y <: X
...
if x isa Object then
# x is a X (instead of Object as before)
else
# x is null (instead of nullable X as before)
end
if x isa nullable Object then # warning, useless isa
# x is a nullable X (as before)
else
# x is dead (instead of nullable X as before)
end
if x isa Y then
# x is a Y (same as before)
else
# x is a nullable X (same as before)
end
if x isa nullable Y then
# x is a nullable Y (as before)
else
# x is a X without nullable (instead of nullable X as before)
end
~~~
I do not expect that these change improve that much the expressiveness of the language. However, it makes the type system a little more consistent and a little less hackish.
Pull-Request: #2385
Reviewed-by: Jean-Christophe Beaupré <jcbrinfo.public@gmail.com>
Jean Privat [Mon, 20 Mar 2017 20:09:00 +0000 (16:09 -0400)]
Merge: grammar: add union and intersection types
This is a stub in the grammar to add intersection and union types.
* `var x: A and B`
* `var x: A or B and C or D or E`
Adding parenthesis `(A and B) or C` cause some nasty conflicts because the Nit grammar is very complex and organic (and sablecc is nowadays more a curse than a blessing).
all usage of types accept intersection and union except `new` and `isa` because LR1 conflicts with the boolean `or`.
* `x isa A or...`: shift type (`x isa A or B`) vs. reduce expr (`x isa A or true`)
This is not too much a problem because:
* intersection and union type are abstract (no `new`)
* `a isa A or B` should be the same than `a isa A or a isa B`
Note that this is only a stub: only the grammar is extended:
* there is no new AST node (`A or B` is parsed as `A`, the `B` is just dropped)
* there is no change in the metamodel of Nit
Pull-Request: #2389
Reviewed-by: Jean-Christophe Beaupré <jcbrinfo.public@gmail.com>
Jean Privat [Mon, 20 Mar 2017 20:08:59 +0000 (16:08 -0400)]
Merge: Docker, portability and crosscompiling tweaks
* Add the missing SDL2 package (since #2376) to the full DockerFile.
* Fix a warning raised by the C compiler when called by niti on 32 bits platforms.
* Clean up Makefile generation and enable using environment variables to override the default C compiler, C++ compiler, CFLAGS and whether or not to use libunwind. Making it possible to change the compiler for cross compilation and to skip linking with libunwind to create binaries compatible with more GNU/Linux systems.
Pull-Request: #2390
Reviewed-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Jean Privat [Mon, 20 Mar 2017 20:08:59 +0000 (16:08 -0400)]
Merge: Windows: path, PATH, and exec improvements
This PR further improves Windows support in the Nit standard library and testing tools:
* Improve Windows path manipulation and standardize the solution. On Windows, services working on path strings first replace all `\` by `/`. This allows sharing the main code with other OS, data copy should be limited since only the first operation on a string should update it.
All `file` services depending on the path separator should have been updated, except for `relpath`. Note that there is still no special treatment for FS root like `C:/`, so further work is needed.
* Support for Windows' PATH where the separator is `;`.
* Fix pipes left open on the parent side after `CreateProcess`.
* Intro a basic skip list for MINGW64 Windows system with projects that are either incompatible (cocoa & ios) or not available with msys2 and that I don't plan to configure manually on the test server in the near future.
There are still issues (including an int overflow in `Float::to_s`), but this PR allows a few larger projects to work on Windows. With #2390 gamnit projects can be compiled entirely from a Windows machine (or cross-compiled).
---
The unit tests are marked `~~~nitish` because they are only valid when `is_windows == true`. Maybe we could have a `~~~nitwindows` or something like that for such tests in the future. Note that you can set `-D is_windows=true` to try them (but not on nitunit sadly).
The Jenkins Windows test server is currently broken. I'll see if I can fix it, otherwise, I'll share the results form my test server later.
Pull-Request: #2391
Reviewed-by: Jean-Christophe Beaupré <jcbrinfo.public@gmail.com>
Alexis Laferrière [Fri, 17 Mar 2017 23:11:04 +0000 (19:11 -0400)]
tests: add basic MINGW64 skip list
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 16 Mar 2017 17:23:15 +0000 (13:23 -0400)]
exec: close child pipes from the parent process
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 16 Mar 2017 17:12:48 +0000 (13:12 -0400)]
core: split PATH on ; on Windows
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 24 Feb 2017 05:01:08 +0000 (00:01 -0500)]
core: standardize Windows path handling
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 2 Mar 2017 19:51:15 +0000 (11:51 -0800)]
core: 32 bits fixes
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 14 Mar 2017 01:00:39 +0000 (21:00 -0400)]
nitc: let CC, CXX and NO_STACKTRACE use env value
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 14 Mar 2017 00:20:57 +0000 (20:20 -0400)]
nitc: clean up makefile header generation
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 11 Mar 2017 06:00:18 +0000 (01:00 -0500)]
docker: add missing libsdl2-image-dev
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 10 Mar 2017 17:08:37 +0000 (12:08 -0500)]
tests: update more sav because of the improved null-aware adaptive typing
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Mar 2017 16:35:08 +0000 (11:35 -0500)]
parser: regenerate with union and intersection types
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Mar 2017 16:34:48 +0000 (11:34 -0500)]
parser: add syntax for union and intersection types
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Mar 2017 15:36:24 +0000 (10:36 -0500)]
tests: add base_adaptive_full.nit with a lots of pattenrns
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Mar 2017 15:32:15 +0000 (10:32 -0500)]
nitc: adaptive typing apply non-nullness when fallbacking
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Fri, 10 Mar 2017 13:37:49 +0000 (08:37 -0500)]
tests: update test_isa_nil message
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Mar 2017 21:06:45 +0000 (16:06 -0500)]
nitc/typing: isa uses intersect_types and diff_types
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Mar 2017 21:06:08 +0000 (16:06 -0500)]
nitc/typing: add intersect_types and diff_types
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Mar 2017 21:05:45 +0000 (16:05 -0500)]
nitc/typing: document `merge_types`
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Mar 2017 15:12:56 +0000 (10:12 -0500)]
Merge: realtime: 32 bits compatibility
Fix `realtime::Timespec` services on 32 bits systems and Windows by moving some critical code to C. This PR does not change the API. However, I have plans for a future revamp of the API to reduce the number of mallocs.
Pull-Request: #2380
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 9 Mar 2017 15:12:55 +0000 (10:12 -0500)]
Merge: nitweb: load catalog at startup instead of first page display
So the first user to access Nitweb does not have to wait 5 minutes for the catalog to be compiled.
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Pull-Request: #2387
Jean Privat [Thu, 9 Mar 2017 15:12:55 +0000 (10:12 -0500)]
Merge: lib/json: fix array serialization
Fixes serialization error for array subclasses.
Be the following Nit code:
~~~nit
class Foo
super Array[String]
serialize
var foo: String
end
print (new Foo("foo")).serialize_to_json
~~~
Output before:
~~~json
{"__kind":"obj","__id":0,"__class":"Foo", "__items":, "foo":"foo"[]}
~~~
Output after:
~~~json
{"__kind":"obj","__id":0,"__class":"Foo", "foo":"foo", "__items":[]}
~~~
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Pull-Request: #2388
Alexandre Terrasa [Mon, 6 Mar 2017 23:17:13 +0000 (18:17 -0500)]
lib/json: fix array serialization
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Fri, 17 Feb 2017 02:10:09 +0000 (21:10 -0500)]
nitweb: load catalog at startup instead of first page display
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Mon, 6 Mar 2017 16:14:55 +0000 (11:14 -0500)]
Merge: regen csrc for Windows and to fix 32 bits support
Fix #2355.
Pull-Request: #2382
Alexis Laferrière [Fri, 24 Feb 2017 04:15:49 +0000 (23:15 -0500)]
realtime: 32 bits safe
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Fri, 3 Mar 2017 17:52:01 +0000 (12:52 -0500)]
Merge: OSX use gtime
This could help to track why jenkins runs on osx are so slow
Pull-Request: #2384
Jean Privat [Fri, 3 Mar 2017 17:51:58 +0000 (12:51 -0500)]
Merge: re_parser: add pre-build target in the Makefile
Some automatic jenkins jobs expect that it this target exists, it can be
used to generate the missing .nit files
Signed-off-by: Jean Privat <jean@pryen.org>
Pull-Request: #2383
Jean Privat [Fri, 3 Mar 2017 17:51:55 +0000 (12:51 -0500)]
Merge: lib/ini: do not abort when lines does not have "="
aborting in a library is bad™
Pull-Request: #2381
Jean Privat [Fri, 3 Mar 2017 17:51:48 +0000 (12:51 -0500)]
Merge: Test out-of-tree projects
This is a simple script that allows jenkins (and human users) to test out-of-tree projects that live in other repositories.
The main file is `contrib/oot.txt` that contains the various projects and `contrib/oot.sh` that tries to build them.
A preview of the current state is available at:
http://gresil.org/jenkins/job/nit_oot/lastCompletedBuild/testReport/
I will improve the script to add checks.
Pull-Request: #2379
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexis Laferrière [Wed, 1 Mar 2017 20:08:31 +0000 (15:08 -0500)]
csrc: regen for 32 bits platforms and Windows
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 2 Mar 2017 16:01:01 +0000 (11:01 -0500)]
compiler: detect many versions of mingw64
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Thu, 2 Mar 2017 14:12:07 +0000 (09:12 -0500)]
macosx: silent error because hostame --vestion does no exists
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Mar 2017 14:11:10 +0000 (09:11 -0500)]
macosx: use gtime (from gnu-time) if available to measure time
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Thu, 2 Mar 2017 01:15:37 +0000 (20:15 -0500)]
re_parser: add pre-build target in the Makefile
Some automatic jenkins jobs expect that it this target exists, it can be
used to generate the missing .nit files
Signed-off-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Wed, 1 Mar 2017 20:01:49 +0000 (15:01 -0500)]
tests: fix listfull.sh
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Jean Privat [Wed, 1 Mar 2017 19:08:50 +0000 (14:08 -0500)]
lib/ini: do not abort when lines does not have "="
aborting in a library is bad™
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 28 Feb 2017 15:35:44 +0000 (10:35 -0500)]
contrib/oot: script to update and check oot projects
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 28 Feb 2017 14:44:17 +0000 (09:44 -0500)]
misc: new script to try to make some targets
Signed-off-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 28 Feb 2017 13:26:03 +0000 (08:26 -0500)]
Merge: Counter: fixes
Hey there,
Some fixes to counter:
* the first one should not be subject to discussion since it only fix the to_s nullable elements.
* the second one is more tricky. I propose to change the add_all behavior to increment all values instead of just rewriting them.
@privat, you are the main user of the `counter` lib, what is you feeling about that?
Pull-Request: #2377
Jean Privat [Tue, 28 Feb 2017 13:25:59 +0000 (08:25 -0500)]
Merge: gamnit: use SDL2 windows and events
_gamnit_ update to use SDL2 instead of SDL1.2. This change brings better code portability and fixes a few known SDL1.2 limitations. This PR does not significantly change the API, asides from removing the workarounds for old limitations.
As support, this PR also:
* Adds more SDL2 events and surface services.
* Updates the `opengles1_hello_triangle` example to use SDL2 and make it compatible with ANGLE and Windows.
* Drops the _gamnit_ workarounds for the previously slow mouse move events and mouse wrap for FPS like controls.
* Fixes shader compatibility with some graphics card and driver.
* General cleanup for the `egl` module.
Pull-Request: #2376
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Tue, 28 Feb 2017 13:25:53 +0000 (08:25 -0500)]
Merge: Nit Actor Model, with some examples
A better version than the previous PR !
The model injection and support module generation are now two phases in the frontend.
Needs #2357 to be able to compile with `nitc`, for now you have to use it as `nitc module.nit -m actors_module.nit` for compiling.
Pull-Request: #2361
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>
Alexis Laferrière [Mon, 27 Feb 2017 19:47:18 +0000 (14:47 -0500)]
kernel: intro `Pointer::==` and `Pointer::hash`
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 24 Feb 2017 16:36:12 +0000 (11:36 -0500)]
app: minor refactor of the audio services
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 25 Feb 2017 19:54:03 +0000 (14:54 -0500)]
model_viewer: update to new gamnit API with move events
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Tue, 21 Feb 2017 20:53:42 +0000 (15:53 -0500)]
gamnit: update doc
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 23 Feb 2017 22:27:11 +0000 (17:27 -0500)]
gamnit: use SDL2
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Mon, 20 Feb 2017 05:37:22 +0000 (00:37 -0500)]
gamnit: don't use `texture` as it may be a std function
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 24 Feb 2017 15:44:02 +0000 (10:44 -0500)]
glesv2: use SDL2 for a portable hello triangle example
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 23 Feb 2017 20:09:07 +0000 (15:09 -0500)]
glesv2: minor improvements to the hello_triangle example
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Fri, 24 Feb 2017 01:38:40 +0000 (20:38 -0500)]
sdl2: implement more events
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Sat, 25 Feb 2017 21:17:44 +0000 (16:17 -0500)]
sdl2: more display and surface services
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexis Laferrière [Thu, 23 Feb 2017 22:26:26 +0000 (17:26 -0500)]
sdl2: fix initialization services
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Alexandre Terrasa [Mon, 27 Feb 2017 19:37:38 +0000 (14:37 -0500)]
counter: fix add all behavior
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Alexandre Terrasa [Mon, 27 Feb 2017 19:37:25 +0000 (14:37 -0500)]
counter: fix NPE on nullable element to_s
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>
Jean Privat [Mon, 27 Feb 2017 18:08:17 +0000 (13:08 -0500)]
Merge: Windows: implement the `exec` module using `CreateProcess`
Until now, the `exec` services were implemented using the POSIX C functions `fork` and `execvp`. This PR introduces an alternative implement for Windows targets using `CreateProcess`.
The `exec` services are used by the compiler call external tools, most notably `pkg-config`. This should support more programs and tests with a dependency on native libraries.
The new `exec` implementation will probably need some tweaking. Testing under Windows is still problematic, but `test_exec` now passes, which is a good sign.
The `fflush` on every write is far from optimal and will slow down the compiler (and others). It solves an issue where a small write to the input of a subprocess would not be received by the subprocess. The data was probably kept in the write buffer (and not in the pipe buffer). I consider the use of `fflush` to be temporary until we have a better solution. Alternative (proven) solutions are welcome.
Pull-Request: #2375
Jean Privat [Mon, 27 Feb 2017 18:08:08 +0000 (13:08 -0500)]
Merge: lib/github: GitHub loader
Helper tool to download a Github repo and store it in a Mongo database.
Features:
* supports github wallets
* save current job and restore jobs after failure
* options to enable branches, commits, issues, pulls, comments and events loading
Pull-Request: #2369
Reviewed-by: Jean Privat <jean@pryen.org>
Jean Privat [Mon, 27 Feb 2017 18:06:48 +0000 (13:06 -0500)]
Merge: contrib/re_parser
# RE Parser
RE parser provides a simple API to regular expression parsing.
It is also able to convert a regular expression into a NFA or a DFA and produce dot files from it.
## Building RE parser
From the `re_parser` directory:
~~~bash
make all
~~~
## RE parser in command line
RE parser can be used as a command line tool to generate NFA and DFA dot files from a regular expression:
~~~bash
./re_parser "a(b|c)+d*"
~~~
Will produce the two files `nfa.dot` and `dfa.dot`.
These can be directly viwed with `xdot`:
~~~bash
xdot nfa.dot
xdot dfa.dot
~~~
Or translated to png images with `dot`:
~~~bash
dot -Tpng -onfa.png nfa.dot
dot -Tpng -odfa.png dfa.dot
~~~
See `man dot` for available formats.
## RE parser as a web app
RE parser comes with a web app that allow users to submit regular expression and see the resulting NFA and DFA.
To run the web app server:
~~~bash
./re_app --host localhost --port 3000
~~~
The server will be available at <a href='http://localhost:3000'>http://localhost:3000</a>.
## RE parser as a library
You can also use RE parser as a library by importing `re_parser`.
~~~nit
import re_parser
var re = "a(b|c)+d*"
# Parse the expression
var l = new Lexer_re_parser(re)
var p = new Parser_re_parser
p.tokens.add_all l.lex
var node = p.parse
# Check errors
if not node isa NProd then
print "Error parsing the regular expression"
abort
end
# Get NFA and DFA
var v = new REVisitor
v.start(node)
print v.nfa.to_dot
print v.nfa.to_dfa.to_dot
~~~
Web app demo: http://re.moz-code.org/
Pull-Request: #2373
Reviewed-by: Jean Privat <jean@pryen.org>
Reviewed-by: Jean-Christophe Beaupré <jcbrinfo.public@gmail.com>
Jean Privat [Mon, 27 Feb 2017 15:29:59 +0000 (10:29 -0500)]
Merge: inkscape_tools: update expected default DPI
Inkscape changed the default DPI to 96 from 90 in order to match the CSS DPI. This change broke compatibility with our tool `svg_to_png_and_nit`. This PR updates our tool to use the new 96 DPI and work properly with the newer versions of Inkscape.
Pull-Request: #2374
BlackMinou [Mon, 27 Feb 2017 15:05:22 +0000 (10:05 -0500)]
skip the execution of tests on actors_*.nit files
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Tue, 21 Feb 2017 15:26:15 +0000 (10:26 -0500)]
ignoring actors_*.nit files generated by nitc
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Wed, 15 Feb 2017 19:56:34 +0000 (14:56 -0500)]
initialize $WRITE for tests others than *.args
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>
BlackMinou [Wed, 1 Feb 2017 19:11:15 +0000 (14:11 -0500)]
A very simple example using actors
Signed-off-by: BlackMinou <romain.chanoir@viacesi.fr>