-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathREADME
76 lines (67 loc) · 2.8 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
The NeeiLang Programming Language
=================================
NeeiLang (NL) is a lightweight programming language that is under
construction. It is designed to be:
* Performant : emits native code with a minimal runtime system
* Type-safe : via aggressive type-checking and semantic analyses
* Effortless : GC, minimal C-like syntax, ~15 keywords
Implementation Progress:
+-----------------------------+
| Feature | Status |
+--------------------+--------+
| Local variables | OK |
| Control flow | OK |
| Functions | OK |
| Type checker | OK |
| Inheritance | OK |
| Virtual methods | OK |
| Type inference | OK |
| Arrays | OK |
| Print | OK |
| Short-circuiting | |
| Static variables | |
| Garbage collection | |
| Modules | |
| Runtime errors | |
| POSIX bindings | |
| Standard library | |
+--------------------+--------+
Usage : www.github.com/neeilan/neeilang/tree/master/doc/Usage
Language : www.github.com/neeilan/neeilang/tree/master/doc/Lang.md
Impl notes : www.github.com/neeilan/neeilang/tree/master/doc/Impl
Note that this project is intended to be an academic exercise and
not a production-grade language toolchain.
Building - LLVM backend
-----------------------
The LLVM backend is programmed against LLVM 9.0.0 API. Since common
package manger repositories only offer newer versions, you'll need to
build from source:
* Download the LLVM 9.0.0 source code from https://releases.llvm.org/
* Extract and build locally (it's a CMake project, so `cmake .` + `make`)
* In the neeilang dir, run cmake while setting the LLVM_PATH variable.
For me, this looks like `cmake -DLLVM_PATH=~/personal/llvm9 .`, then `make`.
* Examples under `test/functional` are ok to play with. `nl_llvm.sh`
will have neeilang emit the LLVM IR and execute using lli, like so:
```
$ ./nl_llvm.sh test/functional/funcs_with_args.nl.splat
hi
hi
hi
```
TLDR: Something like `cmake -DLLVM_PATH=~/personal/llvm9 .` + `make`
Building - x86-64 backend
-------------------------
* Run `cmake -DTARGET_X86=ON .`, then `make`
* When this backend is complete, you can use `nl_x86.sh` just like `nl_llvm.sh`.
At the moment, some tests may pass based on what has been implemented on x86.
```
$ ./nl_x86.sh test/functional/expr_precedence.nl.splat
17
```
Running functional tests
------------------------
* Run `cmake -DTEST_DEPS=ON .` to set up the project with splat, which we use
to run tests under test/functional. You can run individual tests by running
`./bin/splat ./run/nl_llvm.sh <path_to_test>`, or you can perform all the
tests by running `./run_functional_tests.sh`
* You can learn more about splat at https://github.com/neeilan/splat