nickforall / taal Goto Github PK
View Code? Open in Web Editor NEW:zap:Experimental systems programming language
:zap:Experimental systems programming language
The global node variable containing flags is not really optimal, since we want the taal compiler to be able to be used as a node library (for now), especially when I want to compile multiple files parallel/incremental.
I am not really sure how I would want to fix it though.
the way main functions are compiled are a bit weird now, and I am especially struggling with variable assignment now.
The script object should just be a list of functions, and have a reference to the index of the main function.
We don't want an entry function in design, we still want to have the script like feel where you can write anything in the parent scope of the entry file.
Essentially this taal code
print 1 + 1
fn hey {
print 300
}
hey()
represents this
fn hey {
print 300
}
fn start {
print 1 + 1
hey()
}
so it would make sense to treat everything in the parent scope as a seperate function both in the parser and compiler. This way, later on people can also create library binaries that don't have an entry point easier.
x = 19
if x < 19 {
# this is true, but shouldn't be
}
So, we have this AST, representing 100 + 200 + 300
.
{
"type": "binary",
"operator": "+",
"left": {
"type": "binary",
"operator": "+",
"left": {
"type": "numberLiteral",
"value": 100
},
"right": {
"type": "numberLiteral",
"value": 200
}
},
"right": {
"type": "numberLiteral",
"value": 300
}
}
In the end they are all number literals, so we can just optimize this to the expression below, because at compiletime we know these numbers will never change, they are constant.
{
"type": "numberLiteral",
"value": 600
}
I wanna run on linux too, soon!
Whenever we have more than 6 arguments, they get pushed on the stack due to the System V Application Binary Interface calling conventions.
However, because of the way our functions are constructed right now, we're popping empty values of the stack?
At this moment, it is all based around running it as a process, but in fact we want to be able to run the compiler as a library too.
Promisify the compile step that calls nasm and linker, and handle process exits and error logs in the part that does cli stuff.
Is required for closing #3
With System V ABI's spec, return statements need to return their value in rax
, but the optimizer breaks that I think.
Something tells me I am breaking all kinds of stuff while adding new stuff.
I should probably set up some kind of testing mechanism, and use Travis for ci.
so, when i do this
mov [rdp-8], 10
mov [rdp-12], 100
rdp-8
is set to 0?
Should probably research why this is happening, because reassignment of vars is practically impossible now
We calculate the length by getting the length of the value, the output to the terminal is hacked together.
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.