nickforall / dioxide Goto Github PK
View Code? Open in Web Editor NEWCarbon runtime and compiler.
License: Apache License 2.0
Carbon runtime and compiler.
License: Apache License 2.0
Preferably we execute it from the central class, now it's just some thrown-together bullshit in the operation cpu loop.
CBFunction.call(image, block, args)
image: image of the program
block: block address
args: array
This prevents me from doing stuff like callbacks in non-native functions.
You should only be able to store when created.
var test = "kay"
test = "bye"
is completely fine as code
huh = "no"
isn't because huh is not initialized with var yet.
Currently the VM handles all assignments as a create.
๐ I wanted to say that this is the cleanest JavaScript I have ever seen in my life, well done: https://github.com/Nickforall/Dioxide/blob/master/compiler/Parser.js
If I am not mistaken, I think you made use of Predictive Parsing? (the combination of accept() and expect()). I'm trying to learn how to make languages right now so this is really inspirational!
Great work on the language and good luck! ๐
In order to implement immutable variables/const, and prevent errors on the VM part.
It's a mess now
I'm currently returning null when you try to do ("test" * 1), might go the JS way with NaN, or just throw an error, for mismatching types. Idk.
hello = false
returns the following carbon code
{
"type": "script",
"prog": [
{
"type": "assign",
"operator": "=",
"left": {
"type": "var",
"value": "hello"
},
"right": {
"type": "var",
"value": "false"
}
}
]
}
There are some debugs at some places, but in fact we want to categorize all debugs, and implement them in more places of the compiler and VM.
Not sure how I want to do this yet. Kind of don't wanna work on it now.
Best guess:
Else is always a code block.
pushbool true
pushblock x //if
pushblock y //else
ifelseblock //new opcode that goes 3 back in the stack for bool, then executes either -2 or -1
else if will be nested in block y.
println(fn(){} == lambda) //returns "FUNCTION" (CBFunction.toJsString())
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.