Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asxalex/TTtL
an interpreter of my own
https://github.com/asxalex/TTtL
Last synced: 2 months ago
JSON representation
an interpreter of my own
- Host: GitHub
- URL: https://github.com/asxalex/TTtL
- Owner: asxalex
- License: mit
- Created: 2016-09-22T03:43:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-09T08:07:53.000Z (over 8 years ago)
- Last Synced: 2024-08-03T18:16:35.378Z (6 months ago)
- Language: C
- Size: 33.2 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- AwesomeInterpreter - TTtL
README
TTtL
==
TTtL stands for "TT the Language", which is an implementation of my own language, just for fun.### how to use
```c
cd src && make
```### example
Fibonacci:
```c
define fib(n) {
if (n == 0 || n == 1) {
1
} else {
fib(n-1) + fib(n-2)
}
}i = 0
while(i <= 10) {
printf("%d\n", fib(i))
i = i + 1
}
```now TT supports "require"
```c
// in helper.tt
define add_3(a) {
a+3
}// in main.tt
require("helper.tt")printf("%d\n", add_3(20))
```##TODO
supports for list, the environment can also be replaced by hash table for performance.