Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jzwood/portcullis
A minimalist / functional / dataflow programming language
https://github.com/jzwood/portcullis
compilers javascript language lua portcullis programming-language python
Last synced: 5 days ago
JSON representation
A minimalist / functional / dataflow programming language
- Host: GitHub
- URL: https://github.com/jzwood/portcullis
- Owner: jzwood
- License: bsd-3-clause
- Created: 2021-11-03T00:24:12.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-05-01T00:50:09.000Z (6 months ago)
- Last Synced: 2024-10-11T20:20:08.671Z (27 days ago)
- Topics: compilers, javascript, language, lua, portcullis, programming-language, python
- Language: Haskell
- Homepage: https://github.com/jzwood/portcullis
- Size: 2.23 MB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
Portcullis
A minimalist / functional / dataflow programming language.
fib.po
compiles to fib.js
```js
// signature: (Num -> Num)
export function fib(n) {
return (
_lte_(n)(1.0) ? 1.0 : _plus_(fib(_minus_(n)(1.0)))(fib(_minus_(n)(2.0)))
);
}
```compiles to fib.py
```py
# signature: (Num -> Num)
def fib(n):
return (1.0 if _lte_(n)(1.0) else _plus_(fib(_minus_(n)(1.0)))(fib(_minus_(n)(2.0))))
```compiles to fib.lua
```lua
-- signature: (Num -> Num)
function fib(n)
return (_lte_(n)(1.0) > 0 and 1.0 or _plus_(fib(_minus_(n)(1.0)))(fib(_minus_(n)(2.0))))
end
```
fizzbuzz.po
```
Deno 1.22.0
exit using ctrl+d or close()
> fizzbuzz(20)
[
1, 2, -1, 4, -2, -1, 7,
8, -1, -2, 11, -1, 13, 14,
-3, 16, 17, -1, 19, -2
]
```## About
I wrote the compiler for Portcullis purely for my own education and amusement. Painfully specific goals guided the development of this project and account for both the language features I chose to include as well as omit.
Some of these goals include
- minimalism
- [purity](https://en.wikipedia.org/wiki/Purely_functional_programming)
- [parametric polymorphism](https://en.wikipedia.org/wiki/Parametric_polymorphism)## More
- [Introduction](./docs/About.md)
- [Language Guide](./docs/Docs.md)
- [Developer Guide](./docs/Dev.md)
- [Vim Syntax Highlighting](https://github.com/jzwood/portcullis-vim)