https://github.com/profan/thrash-lang
a terrible synonym for bash, and a language which compiles to bash for seemingly no reason
https://github.com/profan/thrash-lang
Last synced: 11 months ago
JSON representation
a terrible synonym for bash, and a language which compiles to bash for seemingly no reason
- Host: GitHub
- URL: https://github.com/profan/thrash-lang
- Owner: profan
- License: other
- Created: 2016-04-08T14:36:21.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-28T22:40:58.000Z (about 10 years ago)
- Last Synced: 2025-07-29T02:03:14.106Z (11 months ago)
- Language: OCaml
- Size: 17.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
thrash
---------------
A small language project for a thing which is intended to compile to bash, mostly because I hate myself and also because I needed some practice writing OCaml and working with dypgen. It will be a dynamic language like bash and mostly mimic it's semantics with the exception of some eq/= etc oddities and various other things like global by default variables which make me hate bash and my life.
This will probably end up being a horrific melting pot of features over time.
Also, using dypgen for this project is probably not necessary, lets consider menhir as LR probably handles our language fine as I think it's free of ambiguities.
Probably put the grammar in not-parser-generator form somewhere later.
As an important side note, **no-one** should **ever** use this.
Example
-----------
```
let somevar = 125
let somebool = true
if true do
25
else
15
end
for x in [1, 2, 3, 4] do
65
end
while somefunction(25) do
printf(10)
end
if x = 25 do
30
else
25
end
```
Structure
-----------
* **src** folder holds source files for the compiler, currently just the main which parses and evaluates the single test source file.
* **data** folder holds data definitions used to generate the parser and lexer.
* **tests** folder holds samples to be used for testing the compiler.
License
-------
GNU GPLv3