https://github.com/robertkleffner/wort
A core concatenative programming language with variables and first-rank polymorphic type inference
https://github.com/robertkleffner/wort
concatenative racket-lang type-inference
Last synced: 3 months ago
JSON representation
A core concatenative programming language with variables and first-rank polymorphic type inference
- Host: GitHub
- URL: https://github.com/robertkleffner/wort
- Owner: robertkleffner
- License: other
- Created: 2017-04-14T20:29:03.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2020-03-14T14:51:46.000Z (about 6 years ago)
- Last Synced: 2025-10-20T14:59:27.312Z (7 months ago)
- Topics: concatenative, racket-lang, type-inference
- Language: Racket
- Size: 14.6 KB
- Stars: 31
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
wort
====
**wort** is a core concatenative programming language with 'full' type inference, in the sense of Algorithm W (principal types at the expression level). It is not intended for general purpose use, but is surprisingly expressive for as minimal as it is. This particular variant of wort is implemented in Racket's `#lang` facility, so you'll need to have Racket installed first. At the top of your wort file, type `#lang wort` to make sure racket knows what you want (after you've installed the package). The syntax for wort is pretty simple:
```
<> := <>*
<> := 0 | 1 | 2 ...
| true | false
| <
>
| <>
| { <> }
| bind <> ( <> )
| let <> = <> ( <> )
<
> := add | call | fix | if | eq | less
<> := variables beginning with letter, followed by zero or more letters or numbers
```
Error reporting for type inference is currently very minimal, to keep the implementation small and focused.