aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 18ff834e577422f023cc74194bbeac78a302b1bb (plain)
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

"Try 2" of the SLUL programming language
========================================

Notes:

* This programming language is in a very early design phase!
* Currently has the beginnings of a bootstrap compiler, that compiles to C.
* To implement all of the features below, it will probably be necessary
  to write a more powerful compiler (e.g. in SLUL), with a custom code
  generator / linker.

SLUL is programming language that...

Will be safe:

* [ ] Type safe, statically typed
* [ ] Memory safe
* [ ] Null safe
* [ ] Integer range safe
* [ ] Capabilities
* [ ] Pure/immutable by default
* [ ] Safe to build (no unrestricted build-time execution)
* [ ] Safe upgrades of libraries (without possibly violating constraints above)

```
    ?Thing t = get_thing 123
    assert t <> none # t can be accessed after this.
    assert b <= 254  # assuming that the range of b is 0-255,
    b += 1           # this addition is now allowed.
```

Will be lightweight:

* [ ] Small runtime
* [ ] Native code compilation
* [ ] Arena allocation, with optional garbage collection
* [ ] Compile-time generics using type erasure (avoids duplication)

Will be usable:

* [ ] Minimal surprises
* [x] Minimal punctuation
* [ ] Maybe name-based type inferrence

Will be "modules first":

* [ ] API compatibility enforced by compiler
  (cryptographically hashed interfaces)
* [ ] Dynamic linking
* [ ] Link to minimal version of dependencies
* [ ] Build environment needs only interface files of (direct) dependencies
* [ ] Easily build and replace any program of library, without having to
  rebuild any another components.

Will be platform-independent / portable:

* [ ] SLUL code will be fully platform independent
  (assuming that dependencies exist/work on the target platform).
* [ ] Trivial cross-compilation (not in the bootstrap compiler, which compiles to C)

Building it
-----------

Requirements:

* C89+ compiler with 64-bit types (such as GCC, Clang, TCC, ...)
* GNU Make or BSD Make

```
    cd bootstrap
    make
```

SLUL "try2" vs. original SLUL
-----------------------------

This an attempt to make my previous experimental progamming language
simpler and easier to use. Main changes:

* Less punctuation (no `(` around simple function calls)
* Function definitions have one parameter definition per line, which
  allows documentation to appear in a comment on the line before.
* Implicit namespace/class per file
  (this way "globals" are actually instance variables).
* Probably won't have hard-coded integers (int8, int16...)
* Generic types might use `of`, `from`, and `to` keywords.
  For example, `List of Int` or `Map from Int to String`. Not decided yet.

License
-------

EUPL 1.2 or later.

The runtime library will most likely be dual-licensed under the EUPL and MIT-0 licenses.