noituri / novum-lang Goto Github PK
View Code? Open in Web Editor NEWNew LLVM toy programming language
New LLVM toy programming language
If function won't have any args, parentheses can be omitted
I don't think I have to explain this.
Example:
if a > b
// Do something
elif b < a
// Do something
else
// Do something
end
Example:
import "<module>"
Example:
let x: str = "That's a string"
"
can be used to create string
Basic syntax for arrays:
x: Arr<Type> = [t1, t2, t3]
x[0] = t4
x.append(t5)
Infinite loop:
while(true) equivalent:
loop true
// do something
end
for x in array equivalent:
loop i, v in array
// do something
end
Float number can have couple dots. What I mean by that is float can look like that 3.20.1 which is incorrect
this will allow the user to define it's own unary or binary operator (for example Str == Str
etc. It will be very useful in libstd)
Atom is a type and value at the same time
Example:
x := :atom
if x == :another_atom
end
return
keyword does not work at the moment (there is no codgen, parser & ast support for return
, only lexer has implemented return token
)
Highlight expectolang *.exp
Here's example from Rust:
fn do_something() -> i32 {
if true {
return 0;
} else {
return 1;
}
// every case is handled so I don't have to put return here
// return 2
}
I want to add the same thing in ExpectoLang
Make CLI for compiling purposes
List of commands:
So classes will probably change but for now it will probably look like that:
class Example
let mut val: int
fc init(x: int)
val = x
end
fc print()
writeln(val)
end
end
let example: Example = Example(2)
example.print()
Add garbage collector
Escaping strings does not word very well. What if mean by that is GoLang by default when it reads str it does escape "\n"
so it's not really new line, also llvm is escaping "\n"
Basic int support has been added here b51c97e
Example:
// global
fc add(a: int, b: int): int
return a + b
end
// private
fc _add(a: int, b: int): int
return a + b
end
compiler should show how much time did it take to build the project
As for now external functions look like that:
@printf(x)
it should look like that:
@printf(x: str): int
Add LLVM Optimizations
This functions simply print data in your terminal.
As for now #
is used to comment code but I'd like to use //
for single line comment and /* */
for multiline comments
boolean type
Example:
let x: bool = false
let y: bool = true
If I try to use 3 + 1
everything works just fine but If I add third number (or more) it starts to break expression, so 3 + 1 + 4
does not work. 4
is parsed as next expression
At the moment when you'll make syntax error you'll probably get arbitrary error that won't tell you a thing how to fix your problem
Every ast has position (current character) and as for now not every position is valid for given AST, also position should not only consist of current character but also current line
Variables by default are not mutable.
They can be redefined.
As for now they won't detect type dynamically (but it will be added)
Example:
let x: int = 4
// variable redefinition
let x: float = 3.0
// probably syntax for mutable variables
let mut x: bool = true
Or
x: int = 4
x := 5.0
x: mut float = 1.23
x = 2.0
y: bool
Indexing has not been tested in the loops
So @
will be keyword for calling extern functions
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.