https://github.com/szktty/trompe
A strongly-typed handy scripting language with type inference
https://github.com/szktty/trompe
command-line-tool scripting-language static-typing strongly-typed swift type-inference
Last synced: about 1 month ago
JSON representation
A strongly-typed handy scripting language with type inference
- Host: GitHub
- URL: https://github.com/szktty/trompe
- Owner: szktty
- License: apache-2.0
- Created: 2015-07-05T05:44:27.000Z (almost 10 years ago)
- Default Branch: develop
- Last Pushed: 2018-08-31T18:22:05.000Z (almost 7 years ago)
- Last Synced: 2025-05-12T23:44:20.397Z (about 1 month ago)
- Topics: command-line-tool, scripting-language, static-typing, strongly-typed, swift, type-inference
- Language: Go
- Size: 325 KB
- Stars: 14
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Trompe
Trompe is a strongly-typed scripting language with type inference.
This is developed for handy scripting to clean up chores, which enables quick startup, interpretation (no need build configuration), and detecting type mismatch errors easily and quickly.Current version is pre-pre-pre-alpha. See examples/ for more detail.
## License
Trompe is licensed under the Apache License, Version 2.0.
## Requirements
- Go 1.10+
- Antlr 4.7.1+## Build
```
$ make
```## Grammar
### Comments
```
-- comment end of line
```### Unit
```
()
```### Boolean
```
true
false
```### Integers
```
12345
```### Floating-Point Numbers
```
123.45
0e10
```### Strings
```
"hello, world!"
```### Lists
```
[]
[1, 2, 3]
```### Tuple
```
(1, 2, 3)
```### Closure
### Calling Functions
```
f()
f(1, 2 , 3)
```### Block
```
do
...
end
```### Variable Bindings
```
let x = 1
```### Defining Functions
```
def f(x)
x + 1
end
```### Conditions
```
if n == 0 then
show("zero")
else
show("other")
end
```### Loop
```
for i in 1..15 do
show(i)
end
```### Pattern Matching
```
case i do
when 0 then "0"
when 1 then "1"
when 2 then "2"
when _ then "_"
end
```### Type Annotations
# TODO
- Library
- Partial application
- Records
- Variants
- References and dereferences
- Operator definition
- Exception handling
- Modules and traits
- Tail call optimization## Author
SUZUKI Tetsuya ([email protected])