Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zeusdeux/moks
An interpreted language written @recursecenter
https://github.com/zeusdeux/moks
Last synced: 13 days ago
JSON representation
An interpreted language written @recursecenter
- Host: GitHub
- URL: https://github.com/zeusdeux/moks
- Owner: zeusdeux
- License: mit
- Created: 2015-04-22T01:14:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-29T23:31:21.000Z (about 9 years ago)
- Last Synced: 2024-10-16T19:26:24.672Z (27 days ago)
- Language: JavaScript
- Size: 354 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# moks
An interpreted language that I am writing [@recursecenter](https://github.com/recursecenter).Sample program in `moks`:
```moks
let fib n = {
(n < 2)? {
1
} : {
fib (n-1) + fib (n-2)
}
}print (fib 10) // should be 89
print (fib 20) // should be 10946print (map (\x { x + 1; }) [1 2 3 4]) // should be [2 3 4 5]
```
Either semicolons *OR* newlines terminate lines. Do not use both or my parser will throw a cryptic error.## Play with it
> Note: `moks` needs iojs currently since it uses features from v8 that node doesn't have yet
```javascript
npm i -g moks
```
This should install the `moks` interpreter globally.You can then run `moks ` or `moks -e ""`.
For e.g.,:
```moks
moks ./fib.mok
moks -e "let add x y = { x + y; }; print (add 2 3);"
```## Future plans
Things/features I plan to experiment with in the future:
- ~~FFI to Javascript~~
- ~~support arrays & maps~~
- ~~module system~~
- ~~lamda support~~
- ~~add `nil`~~
- repl
- error handling
- marking side effects syntactically
- runtime optimizations
- stack based runtime (currently uses the underlying js runtime stack)
- macros
- simple type system
- pausable and rewindable code editingAlso, if you use emacs, [here's](https://github.com/zeusdeux/moks-mode) a simple emacs major mode for [moks](https://github.com/zeusdeux/moks).