diff --git a/README.md b/README.md new file mode 100644 index 0000000..580686d --- /dev/null +++ b/README.md @@ -0,0 +1,113 @@ +# Bogus - a statically typed, interpreted language + +Bogus is a programming language with the intention of having the most readable code possible (without getting into things like block coding or LLM's). The interpreter is written in C++. + +**Bogus is NOT intended for production use at present.** If you build your mission-critical application with Bogus, good luck. Things are going to break very often. + +## Compiling bogus + +If you've got [bob](https://git.maxwellj.xyz/max/bob) installed, make use of the supplied Bobfile by running `bob`. Otherwise, run: + +```bash +g++ src/*.cpp -o bogus +``` + +## Using bogus + +``` +Usage: bogus [file] +Options: + --debug Enable debug mode + --help Show this help message +``` + +Debug mode is useful for reporting bugs, which are going to be very frequent (of course). If something doesn't work and you're sure the syntax is right, create an issue in this repo. + +## Writing bogus + +Print things: + +``` +println "Hello!"; +``` + +Print things without a new line using `println`. + +Set a variable: + +``` +let str myString "This is a string variable"; +``` + +Note: Valid types are `int` (equivalent to C++ `int`), `dec` (equivalent to C++ `double`), `str` (equivalent to C++ `string`), and `bool` (equivalent to C++ `bool`) + +Use a variable: + +``` +let int myNum 5; + +println myNum; +``` + +Change a variable: + +``` +let int myNum 7; + +myNum = 10; + +myNum ++; +myNum --; + +myNum += 3; +myNum -= 2; + +``` + +Do some math: + +``` +println 9 + 10; +``` + +Get user input from the console: + +``` +let str userInput input; + +println input; +``` + +Use an `if` statement to compare things: + +``` +let int myInt 4; +let int myOtherInt 3; + +if myInt == myOtherInt { + println "The variables are the same!"; +} + +myOtherInt = 4; + +if myInt == myOtherInt { + println "The variables are now the same after changing it"; +} +``` + +More features will be added in future. + +## Planned features + +* Lists: It's a list of stuff. `str` will become a list of characters (meaning a `chr` type will be made). +* `while` statements: Come on, we gotta have a Turing complete language! +* File input/output: I feel this is going to be complex. + +## Far-off features + +Note: These features are not guaranteed to come to fruition. I am very good at getting distracted by other things. + +* Functions +* Network requests +* Libraries and importing files +* Webserver diff --git a/bogus b/bogus index c0915a4..080e1d7 100755 Binary files a/bogus and b/bogus differ diff --git a/names.bo b/examples/names.bo similarity index 100% rename from names.bo rename to examples/names.bo diff --git a/password.bo b/examples/password.bo similarity index 100% rename from password.bo rename to examples/password.bo diff --git a/test.bo b/examples/test.bo similarity index 100% rename from test.bo rename to examples/test.bo diff --git a/test.fish b/test.fish index 35b33ca..27999d5 100644 --- a/test.fish +++ b/test.fish @@ -1,5 +1,7 @@ #!/usr/bin/fish +echo "Compiling with bob" bob +echo "Running" ./bogus test.bo