https://github.com/zeroxthreef/clatter
A procedural scripting language with even weirder expressions
https://github.com/zeroxthreef/clatter
Last synced: about 1 year ago
JSON representation
A procedural scripting language with even weirder expressions
- Host: GitHub
- URL: https://github.com/zeroxthreef/clatter
- Owner: zeroxthreef
- License: other
- Created: 2019-06-19T02:29:23.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-30T06:59:28.000Z (almost 7 years ago)
- Last Synced: 2025-02-02T02:41:25.104Z (over 1 year ago)
- Language: C
- Size: 106 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Clatter
A procedural lang with kinda weird expression handling.
The best way to think about this language is all expressions are functions. Pretty much everything can be thought of as a function.
It's kind of lisp in the sense of s-expressions, but c-like syntax for the actual expressions.
Heres an example:
```
printsp(+(3 5 8 9))
```
And another more complicated one:
```
=(globalTest *(3 6)) //NOTE: all variables declared have to be initialized
//function declaration order shouldn't when calling functions
testThing("hey" 8)
testThing(concat1 concat2):
{
=(final 0)
if(<(concat1 concat2))
{
+(string(concat1) string(concat2))
}
else()
{
+(string(concat2) string(concat1))
}
printsp("result:" final)
//optional return
return(1)
}
```
And an example with a for loop
```
for({=(i 0)} {<(i 10)} {=(i +(i 1))})
{
printsp("hello" i)
}
//if you wanted to just loop forever
for(0 0 0)
{
printsp("hello")
}
```
Documentation will be available soon.
## Using
Using utf8.h at https://github.com/sheredom/utf8.h, which uses Unlicense and is public domain as well.
## Dependencies
Using a sizeable portion of the C stdlib. Will work to reduce the need in the future.
## License
Clatter is dual-licensed under Unlicense and the MIT license. Choose whichever you want.