License, readme, and build files
This commit is contained in:
81
README.md
Normal file
81
README.md
Normal file
@@ -0,0 +1,81 @@
|
||||
# Funk
|
||||
|
||||
Funk is an interpreted programming language.
|
||||
|
||||
## Getting started
|
||||
|
||||
First of all, you'll need to build the Funk interpreter:
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
./funk
|
||||
```
|
||||
|
||||
Now you can get coding!
|
||||
|
||||
## Syntax
|
||||
|
||||
Funk requires a main function for your code to begin execution in. Define it like this:
|
||||
|
||||
```
|
||||
main func {
|
||||
println("Hello, World!")
|
||||
}
|
||||
```
|
||||
|
||||
You can define other functions and call them if you wish.
|
||||
|
||||
```
|
||||
dingus func {
|
||||
println("You got dingused")
|
||||
}
|
||||
|
||||
main func {
|
||||
dingus()
|
||||
}
|
||||
```
|
||||
|
||||
Use `if` and `while` for control flow.
|
||||
|
||||
Note: Equality operators like `==`, `!=`, etc, etc aren't supported yet. This is a new project, after all.
|
||||
|
||||
```
|
||||
main func {
|
||||
if (true) {
|
||||
println("It's true!")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
main func {
|
||||
while (true) {
|
||||
println("To infinity and beyond!")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
Set variables with `=`.
|
||||
|
||||
```
|
||||
main func {
|
||||
x = 5
|
||||
}
|
||||
```
|
||||
|
||||
Note: Variable access isn't a thing yet, but is a priority. Stay tuned!
|
||||
|
||||
Another note: If you'd like you can do this as well:
|
||||
|
||||
```
|
||||
main = func {
|
||||
println("Ooh functional looking programming")
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
Funk is licensed to you under the GNU GPL v3.0. Contributions are welcome!
|
||||
Reference in New Issue
Block a user