This repository has been archived on 2025-09-13. You can view files and clone it, but cannot push or open issues or pull requests.
Files
iodine/README.md
2025-05-13 17:20:43 +10:00

147 lines
2.9 KiB
Markdown

![Iodine programming language logo](https://chookspace.com/iodine/iodine/raw/branch/master/branding/Iodine_250px.png)
# Iodine - a statically typed, interpreted language
Iodine 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++.
**Iodine is NOT intended for production use at present.** If you build your mission-critical application with Iodine, good luck. Things are going to break very often.
## Compiling Iodine
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 iodine
```
## Using iodine
```
Usage: iodine [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 iodine
Print things:
```
println "Hello!";
```
Print things without a new line using `print`.
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";
}
```
Make a `while` loop to do things over and over:
```
let int myInt 1;
while myInt != 6 {
println myInt;
myInt = myInt + 1;
}
println "The loop has ended";
```
*Sidenote: Loops are very unstable at present. If you find a loop-related bug please let me know.*
Make a list of stuff:
```
let str myList ["List thingy number 1" "List thingy number 2" "A third list thingy"];
printlist myList;
println myList[1];
```
More features will be added in future.
## In Progress Features
* Functions
## Planned features
* Libraries and importing files
## 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
* Reading files
* Webserver
## Licensing
Iodine is licenced under the GNU General Public Licence v3.0. See `LICENSE` or [here](https://www.gnu.org/licenses/gpl-3.0.en.html) for more details.
The Iodine Logo © 2025 by Maxwell Jeffress is licensed under CC BY-SA 4.0. See [here](https://creativecommons.org/licenses/by-sa/4.0) for more details.