https://github.com/aphsai/thea_interpreter
a predecessor to a more ambitious project (that I'll hopefully have time for) called Cynthia
https://github.com/aphsai/thea_interpreter
go interpreter language programming thea
Last synced: 15 days ago
JSON representation
a predecessor to a more ambitious project (that I'll hopefully have time for) called Cynthia
- Host: GitHub
- URL: https://github.com/aphsai/thea_interpreter
- Owner: aphsai
- License: gpl-3.0
- Created: 2019-01-29T01:21:37.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-05-26T17:47:44.000Z (almost 7 years ago)
- Last Synced: 2024-06-21T00:03:03.784Z (almost 2 years ago)
- Topics: go, interpreter, language, programming, thea
- Language: Go
- Homepage:
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# thea_interpreter
## Why
I have an idea for something a little more ambitious, but I need to understand these things first before I jump into it. So, I'm making an interpreter (and maybe a compiler in the future) for a language I'm creating called Thea. Eventually, I will translate this knowledge into a new language called Cynthia.
I don't really have a big plan for Thea at the moment, I think it's just going to be another quirky language, right now the gimmick is that the keywords are only two characters because I hate memorizing long winded and verbose bits of code.
Though, I imagine reading something like `if (tr) rt fl; el rt tr;` (if true, return false, else, return true) is a bit difficult to read. It looks kind of cute to me.
Also, I think most keywords are just kind of useless? Like if I'm writing a recursive fibonacci function, I don't need to see the entire return keyword, my eyes just glaze over it, so it helps in filtering out noise in programming code.
lt fib = fn(n) {
if (n < 2) rt n;
el rt fib(n - 1) + fib(n - 2);
}
This looks clean to me. Tight.
That's what it is right now, maybe it'll change in the future if I think of a revolutionary new idea (hah).
## Some of the things you can do with Thea
Arithmetic Expressions
5 + 5;
10
Variable Bindings
lt a = 5;
lt b = 10;
b * a;
50
Functions
lt a = fn(x, y, z) { x + y + z; }
a(1, 2, 3);
6
Higher-Order Functions
lt a = fn(x) { fn (y) { x + y } };
lt b = a(2);
b(3);
5