iri-compile
Version:
130 lines (103 loc) • 2.36 kB
Markdown
# Iridium Programming Language
Iridium is an Object-Oriented Programming Language Designed to be Simple and Powerful.
## Whats special about Iridium?
- It's fast.
- It's powerful
- It's free
- It's perfect for beginners and pros alike!
- It's open-source under the GNU General Public License v3.0
- Its written in the blazing fast language Rust (there's also a NodeJS version, which has more syntax.)
- Syntax for getting internal variables
# Syntax (unfinished)
## Startup
Make sure you have Iridium installed or NodeJS, and then, when it prompts you to do a command:
```>>> ```
Type in:
```shell
iri -c path/to/file.iri
```
You can use literally any extension, but `.iri` is usually used as not to interrupt the compilers/interpreters of other languages and distinguish.
## Enviroment Variables
*** ` Coming out on 2.0 ` ***
~~advanced-mode = true. //sets advanced syntax to true. Includes Linux command support and C-Like syntax~~
~~graphics-mode = true. //sets the graphics_EngineOn internal variable to true~~
~~web_mode = true. // make a web with Iridium~~
~~shell = true. // sets a shell loop after every program runs.~~
## Output:
```
I/OSTREAM << text
I/OSTREAM << $variable
// Or with an API
#get * from <Console>
Console.out(some text)
```
## Declaring Variables
```
var sample = "Strings are the first data types supported.".
var boolean_supported = true.
var this_is_true = ButBooleanAreSupportedToo.
var age = 13.4. // and numbers!
```
## Printing Variables
```
print = $sample
```
## Classes And Objects
```
class hello{
// Stuff
}
hello = new hello.
class hello:hewwo{
//Class inheritance
}
```
## Methods
```
static method_name(arg1,arg2){
// DO cool stuff
}
```
## Decisions & Accepting user input
```
Userinput().
// example:
string hewwo = Userinput().
```
## Math
```
a = 2 + 2.
math.sqrt(5).
a = pow(4(3)).
a = avrg({dataset}).
a = factorial(5).
a = sin(5).
a = log(5, base=2.71828182845905).
a = MAD({dataset}{dataset}).
a = percent(5.1).
a = Decimal(5).
a =
```
## Data Structures
```
// array
array = new array[](
array[0] = "hi".
).
example = array[1].
//dictionary
hey = new Dictionary([5])(
add[0] "hey".
).
example = hey[1]
//list
list = new list(
add to list "wut".
).
example = list[1]
//dataset WARNING: ONLY USE FOR NUMBERS
average = new dataset[](
add 5 to average.
).
example = average[1].
```