Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomcur/spl-compiler
A compiler for a simple programming language.
https://github.com/tomcur/spl-compiler
Last synced: about 13 hours ago
JSON representation
A compiler for a simple programming language.
- Host: GitHub
- URL: https://github.com/tomcur/spl-compiler
- Owner: tomcur
- License: mit
- Created: 2017-02-28T22:25:50.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-01-09T18:42:15.000Z (almost 6 years ago)
- Last Synced: 2024-11-09T02:25:41.376Z (about 2 months ago)
- Language: Haskell
- Size: 276 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
A compiler for the &SPL language.
# &SPL
&SPL is an acronym for Simple Programming Language, and is a C-like imperative programming language, with classes, lists, and tuples. For example, the following code produces the Fibonacci sequence.
```
#include "stdlib/std.spl"
// Output the Fibonacci sequence
main ()
{
var t1 = 0;
var t2 = 1;
while(True) {
println(t2);
var h = t1 + t2;
t1 = t2;
t2 = h;
}
}
```# Compiling
```
> Lib.compile
> "program.spl"
```# Pretty printing
```
> Lib.prettyPrint
> "program.spl"
```