--- /dev/null
+# Installing gwion
+
+## Get the sources
+
+The source is accessible on [github](https://github.com).
+
+Provided you have git installed, you can get it with:
+
+``` sh
+git clone https://github.com/fennecdjay/gwion
+```
+
+then change to the source directory
+``` sh
+cd gwion
+```
+
+### Don't forget submodules
+
+You'll need the sources for all base module
+``` sh
+git submodule update --init util ast
+```
+
+> At this point, you might want to configure the build.
+ In this case, have a look at the [configuration page](Configure.md)
+
+
+## Build the libraries and program
+``` sh
+make
+```
+
+## Install the package
+
+``` sh
+make install
+```
+> You may need root privilege to do this.
--- /dev/null
+# Configuring Gwion
+
+## util/config.mk
+
+double
+
+gettext
+
+memcheck
+
+lto
+
+coverage
+
+## ast/config.mk
+
+## config.mk
+Here are a few choices left
--- /dev/null
+# Build / Configure Gwion
+
+## Configure
+### gwion-util
+
+ * `USE_MEMCHECK`: compile with debug flags (`-g`) and enable asserts
+ * `USE_COVERAGE`: add coverage instrumentation
+
+
+## Make
+Basically, all that is left to do is
+```sh
+make
+```
+The only environment variable affecting the operation is `PREFIX`
+
+Except `--(no-)double`, everything can be set when running make,
+using environment variables.
+
+Drivers can be set on using, e.g. for *alsa* : `ALSA_D=1` or `ALSA_D=on`.
+In the same way, then can be disabled with `ALSA_D=0` or `ALSA_D=off`
+
+### Running tests
+```bash
+make tests
+```
+to run all tests, or
+```bash
+bash util/test.sh my_file_or_directory (.. other files/dirs ...)
+```
+to run specific ones.
+look [here](#testing.md) for more.
+## Install
+*maybe as root*
+```sh
+make install
+```
+The only environment variable affecting the operation is `PREFIX`
--- /dev/null
+# Keywords
+
+ * fun/function
+ * operator
+ * return
+ * goto
+ * switch/case/default
+ * if/else
+ * break/continue
+ * until/do/while/for/repeat
+
+
+
+
+ * global/static
+ * private/protect
+ * const
+
+ * new
+ * spork
+ * fork
+ * typeof
+
+ * typedef
+ * class
+ * dtor
+ * extends
+ * enum
+ * union
+
+ * auto
--- /dev/null
+# Special Values
+
+ * me
+ * this
+ * vararg
+ * maybe
--- /dev/null
+# Tests
+[test.sh](https://github.com/fennecdjay/Gwion/blob/dev/util/test.sh)
+requires [valgrind](http://valgrind.org/)
+there are two kinds of tests:
+ * [gwion](#gwion-tests)
+ * [bash](#bash-tests)
+
+## Gwion tests
+those tests are just gwion (.gw) files, handling special comments:
+ * `// [skip]` (*optionally* followed by reason to skip)
+ * `// [todo]` (*optionally* followed by reason to delay testing)
+ * `// [contains]` followed by string to match
+ * `// [excludes]` followed by string not to match
+
+## Shell test
+those tests are just bash (.sh) files.
+they should start with this snippet
+```bash
+#!/bin/bash
+# [test] #5
+n=0
+[ "$1" ] && n="$1"
+[ "$n" -eq 0 ] && n=1
+source tests/sh/common.sh
+```
+
+## TODO
+ [ ] `bailout` system for early exit on failure
--- /dev/null
+# Declarations
+
+## Basics
+
+Declaring a primitive or an object is quite straight forward:
+``` gw
+int i;
+Object o;
+<<<i, " ", o>>>;
+```
+0 0x56418af88660
+
+## Declaring a reference
+However ...
+``` gw
+Object @ref;
+<<<"Reference points to no object yet: ", ref>>>;
+//Object o @=> ref;
+new Object @=> ref;
+<<<"But now it does: ", ref>>>;
+```
+make[1] : on entre dans le répertoire « /home/djay/src/git/gwion/gwion-github »
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+(int[]) (nil)<br/>
+(int[]) 0x4dedc10<br/>
+t: (nil)<br/>
+But now it does: 0x4dedc30<br/>
+✔
+</p>
+make[1] : on quitte le répertoire « /home/djay/src/git/gwion/gwion-github »
+
+## Arrays
+
+### array as refs
+
+``` gw
+int ref[];
+<<<ref>>>;
+new int[2] @=> ref;
+<<<ref>>>;
+```
+make[1] : on entre dans le répertoire « /home/djay/src/git/gwion/gwion-github »
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+(int[]) (nil)<br/>
+(int[]) 0x4dedc10<br/>
+t: (nil)<br/>
+But now it does: 0x4dedc30<br/>
+✔
+</p>
+make[1] : on quitte le répertoire « /home/djay/src/git/gwion/gwion-github »
--- /dev/null
+# Global Values
+
+ * adc
+ * blackhole
+ * dac
+ * pi
+ * null
+ * samp
+ * ms
+ * second
+ * hour
+ * me
+ * this
+ * \__func__
+ * \__file__
+ * \__line__
--- /dev/null
+# Lambda
+
+## Overview
+
+Simply put, *lambda*s are anonymous functions.
+
+The syntax to create them is simple:
+```
+\ variable0 variable1 ... { your code here }
+```
+You can even use it to
+### Call a function just once
+``` gw
+\ i { <<<"passed '", i, "'">>>; }(3);
+```
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+passed '3'<br/>
+✔
+</p>
+
+
+## Use case
+
+### Passing to a function pointer
+``` gw
+typedef void fptr_t(int);
+\ i { <<<"passed '", i, "'">>>; } @=> fptr_t fptr;
+fptr(4);
+```
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+passed '4'<br/>
+✔
+</p>
+
+### As Argument to Functions
+``` gw
+typedef void fptr_t(int);
+fun void test(fptr_t fptr) {
+ fptr(5);
+}
+test(\ i { <<<"passed '", i, "'">>>; });
+```
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+passed '5'<br/>
+✔
+</p>
--- /dev/null
+# Variadic functions
+
+> A function whoses arity is not fixed.
+
+Well, a function that takes a fixed number of arguments, and additionnal ones.
+
+## a simple example
+``` gw
+fun void variadic_test(int i, ...) {
+ <<< "first argument is ", i >>>;
+ vararg.start;
+ <<< "\tadditionnal argument", vararg.i >>>;
+ vararg.end;
+}
+variadic_test(1);
+variadic_test(1, 2);
+variadic_test(1, 2, 3);
+```
--- /dev/null
+# Functions
+
+## a simple (commented example)
+
+``` gw
+// declare function 'test_function'
+// with return type int
+// taking an int as argument
+fun int test_function(int arg) {
+ // return the argument + 2
+ return arg + 2;
+}
+
+// now call the function (and debug print the result)
+<<<test_function(0)>>>;
+// or use alternate syntax
+<<<1 => test_function>>>;
+```
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+(int) 2<br/>
+(int) 3<br/>
+✔
+</p>
--- /dev/null
+# Control Flow
+
+## Repeats
+let start simple ;-)
--- /dev/null
+# For Loops
+**For** loops in Gwion is pretty similar to classic **C** syntax
+
+## basic loops
+``` gw
+for(int i; i < 3; ++i)
+ <<<i>>>;
+```
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+(int) 0<br/>
+(int) 1<br/>
+(int) 2<br/>
+✔
+</p>
+
+Of course, it also works with a block of code.
+
+``` gw
+for(int i; i < 3; ++i) {
+ i/2 => float f1;
+ i/2. => float f2;
+ <<<i, " " , f1, " ", f2>>>;
+}
+```
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+0 0.0000 0.0000<br/>
+1 0.0000 0.5000<br/>
+2 1.0000 1.0000<br/>
+✔
+</p>
+
+## Nested Loops
+``` gw
+int array[3][4];
+
+for(int i; i < 3; ++i) {
+ for(int j; j < 4; ++j) {
+ <<<array[i][j]>>>;
+ }
+}
+```
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+✔
+</p>
+
+### Auto Loops
+
+#### Simple auto loop
+``` gw
+int array[2][3];
+for(auto a: array) {
+ <<<a>>>;
+ for(auto b: a)
+ <<<b>>>;
+}
+```
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+(int[]) 0x4e0ff00<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int[]) 0x4e0ff20<br/>
+(int) 0<br/>
+(int) 0<br/>
+(int) 0<br/>
+✔
+</p>
+
+### Auto Pointer loop
+With the simple auto loop, you only get the value in the array.
+If you want to change it, you need a pointer
+
+``` gw
+int array[2][3];
+int i;
+for(auto a: array) {
+ for(auto @b: a)
+ <<<++i => *b>>>;
+}
+for(auto a: array) {
+ for(auto @b: a)
+ <<<*b>>>;
+}
+```
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+(int) 1<br/>
+(int) 2<br/>
+(int) 3<br/>
+(int) 4<br/>
+(int) 5<br/>
+(int) 6<br/>
+(int) 1<br/>
+(int) 2<br/>
+(int) 3<br/>
+(int) 4<br/>
+(int) 5<br/>
+(int) 6<br/>
+✔
+</p>
--- /dev/null
+# Giving gwion a new driver
+
+## basics
+
+> in order to use GWION_CTL ...
+
+# concept
+
+# upd driver
--- /dev/null
+# Writing a Gwion plugin
+
+> THIS IS OUTDATED. please look at the source code in src/lib/ instead
+
+ * [getting started]
+
+## Getting started
+use the script
+
+### headers
+```
+#include "vm.h"
+#include "instr.h"
+#include "import.h
+```
+<!-- TODO: verify this -->
+
+### Class
+Define the type:
+```
+struct Type_ t_mytype = { "MyType", SZ_INT, &t_object};
+```
+> every type extending t_object should have SZ_INT
+
+### Handling Constructors and Destructors
+#### CTOR
+```
+CTOR(mytype_ctor) {
+ /* constructor code here */
+}
+```
+#### DTOR
+```
+DTOR(mytype_dtor) {
+ /* destructor code here */
+}
+```
+
+those macros provide two variables:
+ * `o`: the *M_Object* for the (con/des)tructor
+ * `shred`: the *VM_Shred* for the (con/des)tructor
+
+```
+CHECK_BB(import_class_begin(env, &t_mytpe, env->global_nspc, mytype_ctor, mytype_dtor))
+```
+#### variable
+declare a `m_int`. coding convention require
+ * a leading *_o*
+ * a following *_type_*
+```c
+m_int o_mytype_myvaroffset;
+```
+#### function
+```c
+/* declare a member function */
+MFUN(mytype_memberfunction) {
+ /* code here */
+}
+
+SFUN(mtype_staticfunction) {
+ /* code here */
+}
+```
+
+#### operator
+
+### Import function
+
## Add to VCS
-It's now time to add your changes to the package :smile:
+It's now time to add your changes to the package
``` sh
make translation-commit TRANSLATION_TARGET=<xxx>
--- /dev/null
+# Giving gwion a new driver
+
+## basics
+
+> in order to use GWION_CTL ...
+
+# concept
+
+# upd driver
--- /dev/null
+# Writing a Gwion plugin
+
+> THIS IS OUTDATED. please look at the source code in src/lib/ instead
+
+ * [getting started]
+
+## Getting started
+use the script
+
+### headers
+```
+#include "vm.h"
+#include "instr.h"
+#include "import.h
+```
+<!-- TODO: verify this -->
+
+### Class
+Define the type:
+```
+struct Type_ t_mytype = { "MyType", SZ_INT, &t_object};
+```
+> every type extending t_object should have SZ_INT
+
+### Handling Constructors and Destructors
+#### CTOR
+```
+CTOR(mytype_ctor) {
+ /* constructor code here */
+}
+```
+#### DTOR
+```
+DTOR(mytype_dtor) {
+ /* destructor code here */
+}
+```
+
+those macros provide two variables:
+ * `o`: the *M_Object* for the (con/des)tructor
+ * `shred`: the *VM_Shred* for the (con/des)tructor
+
+```
+CHECK_BB(import_class_begin(env, &t_mytpe, env->global_nspc, mytype_ctor, mytype_dtor))
+```
+#### variable
+declare a `m_int`. coding convention require
+ * a leading *_o*
+ * a following *_type_*
+```c
+m_int o_mytype_myvaroffset;
+```
+#### function
+```c
+/* declare a member function */
+MFUN(mytype_memberfunction) {
+ /* code here */
+}
+
+SFUN(mtype_staticfunction) {
+ /* code here */
+}
+```
+
+#### operator
+
+### Import function
+
--- /dev/null
+# Welcome to Gwion
+
+gwion is a easy yet powerful, strongly-timed programming language,
+
+## And now for the hello world
+
+So, as it is mandatory, here is the piece of code you're waiting
+for:
+
+``` gw
+<<<"Hello, World!", "">>>;
+```
+<p style="background-color:#e3e3e3; border: 5px solid #343131; padding: 10px; margin-right: 20%; margin-left: 20%; -moz-border-radius: 15px; -webkit-border-radius: 15px;">
+Hello, World!<br/>
+✔
+</p>
+
+## (Bag of) Features
+ * horizontal inheritance
+ * typedef (function pointers and type aliases)
+ * enums and unions
+ * templates (both class and functions)
+ * easy concurrency/async
+ * [lambdas](Functions/Lambdas)
+ * memoization
+ * [variadic](Functions/Variadic) functions