1
0
Fork
You've already forked sethlans
0
Sethlans prototype-based language
  • C++ 55.6%
  • Python 22.3%
  • Racket 21.3%
  • Meson 0.8%
Find a file
2021年01月26日 13:27:50 +00:00
lib use methods instead of whatever the fuck i was doing 2021年01月17日 17:41:18 +02:00
sethlans-cxx lotsa stuff 2021年01月17日 15:38:54 +02:00
sethlans-py more modifications, helper script 2021年01月14日 15:54:23 +02:00
sethlans-racket Racket implementation failed - I give up 2021年01月26日 13:27:50 +00:00
.gitignore start writing interpreter in C++ 2021年01月14日 19:44:04 +02:00
doc.md no laziness actually 2021年01月15日 17:54:56 +02:00
meson.build readme refactoring, include boehm gc 2021年01月15日 17:48:04 +02:00
README.md no laziness actually 2021年01月15日 17:54:56 +02:00

Sethlans

Sethlans (named after the Etruscan god of craftsmanship) is a dynamic, prototype-based, functional programming language. It's made as a testbed for some of my programming language ideas (including related to Bjoern, my attempt at a high-level OS).

See doc.md for a description of the basic syntax and semantics.

Interpreter

There are currently two interpreters: a basic one written in Python, and another one in C++ being worked on (which will become the primary interpreter).

The dependencies of the C++ interpreter are libgmp and libgc.

Example

[
{ the classic introduction }
print! '"Hello, World!'
{ checks if a number is prime using trial division }
def-query! `` is-prime? [ n ] [
 m: 2
 prime: `` true
 while! [ return: ( m < n ) ] [
 if! ( n divisible-by? m ) [
 self2 prime: `` false
 ] [ ]
 self m: ( m + 1 )
 ]
 return: prime
]
{ enumerate all primes up to 100 }
i: 2
while! [ return: ( i < 100 ) ] [
 if! ( is-prime? i ) [
 print! i
 ] [ ]
 self i: ( i + 1 )
]
]