Skip to content

Phantonia/Krypton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Antonia Heinen
Mar 24, 2021
e6fd8f3 · Mar 24, 2021
Jan 19, 2021
Jan 19, 2021
Mar 24, 2021
Mar 16, 2021
Dec 13, 2020
Mar 16, 2021
Mar 16, 2021
Jan 26, 2021
Dec 2, 2020
Feb 22, 2021
Nov 24, 2020

Repository files navigation

Krypton

Krypton is a flexible yet statically typed language for quick scripts. It directly supports rational number (i.e. fractions) and complex numbers.

At this point, it can't do anything. But it is gonna grow and become something, I promise ^^

Some syntactic impression ^^ (I'm using visual basic for syntax highlighting. It doesn't work 100%, but this language most closely matches Krypton's syntax)

Out "Hello world uwu"; ... Outputs "Hello world uwu"

Var complex As Complex = 3 + 4i;
Out complex; ... "3 + 4i"
Out complex.Real; ... "3"
Out complex.Imag; ... "4"
Out complex.Magnitude; ... "5"

Var fraction As Rational = 1 Over 2;
Out fraction; ... "1/2"
Out fraction.Numerator; ... "1"
Out fraction.Denominator; ... "2"

Var fraction2 = 2 Over 4; ... As can be left out
Out fraction2; ... "1/2"

Var input As String = Input();
If (input Is x As Int)
{
        Out x ** 2; ... Squares the input
}
Else
{
        Out "Please enter an integer";
}

Keep in mind, that almost nothing about Krypton's syntax is set in stone yet. This is a prototype!