aboutsummaryrefslogtreecommitdiff

"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.