cxw42 / do-not-self-host Goto Github PK
View Code? Open in Web Editor NEWA toolchain starting from assembly so you don't have to self-host your next programming language
License: Other
A toolchain starting from assembly so you don't have to self-host your next programming language
License: Other
Because it would be nice to have while reading traces.
See linked commit for more.
E.g., so this will work:
:global_var
.data 42
.scope
:local1_var
.data 1
fetch &global_var ; OK
fetch &local1_var ; OK
fetch &local2_var ; assembly-time error - not in scope
.endscope
.scope
:local2_var
.data 2
fetch &global_var ; OK
fetch &local1_var ; assembly-time error - not in scope
fetch &local2_var ; OK
.endscope
General:
VM:
in
, out
instructions (currently in ngaita.c
)err
instruction to output to stderr (since we're going to want that for the toolchain)iseof
(push (TOS == -1) ? -1 : 0
); leave the character on the stack)cjump
to ccall
, since that's what it is in nga.ccjump
setcount
/getcount
instructionsloop &label
a la x86 (because it's a nice, convenient thing to have).
I think this should be loopcheck &done_label
so you can put it at the top of the loop, since most of the loops I have written have been top-check. The resulting loop would look like:
setcount 5
:loop
loopcheck &loop_done ; branch if counter==0; otherwise, decrement counter.
getcount
outnum
jump &loop
:loop_done
Assembler:
.include
directive.lit <n>
directive that emits a lit <n>
instruction.lit <n>
before the instruction. E.g., cjump &done
is assembled to lit
, &done
, cjump
. Or eq 32
becomes lit
, 32
, eq
. (This requires more care on the programmer's part with stack discipline :) .)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.