censoredusername / whitespace-rs Goto Github PK
View Code? Open in Web Editor NEWA whitespace JIT compiler
License: Mozilla Public License 2.0
A whitespace JIT compiler
License: Mozilla Public License 2.0
While using this compiler for competitive programming, I discovered two behaviors of this compiler that differ from the official interpreter and many other compilers.
This compiler interprets \n
as 0, whereas other implementation interprets __\n
or \t_\n
as 0.
This compiler copies the nth value from the bottom of the stack with the Copy instruction. other implementation copies the nth value from the top of the stack.
If the Copy instruction is called in a function, it is not possible to know the offset of the stack at compile time, so it is more appropriate to use the index from the top of the stack.
Are these behaviors intended? If not, would you correct them? (I'm also interested in contributing a PR)
I'm wondering if it's possible to assemble whitespace instructions and output a native binary?
Could we then feed this binary to the whitespace interpreter (outfitted with a suitable loader) and execute the whitespace instructions?
I would propose two new sections for the text and data:
And
Respectively
I tried to build this program using cargo install
:
$ cargo install whitespacers
When I do this, I get 131 errors originating from the files src/core/compiler_x64.rs
and src/core/allocator.rs
. Most are of the form expected value, found module `self`
or cannot find value `...` in this scope
for some variable ...
.
My rustc/cargo version is 1.45.0
.
I also tried installing it with cargo install +nightly whitespace-rs
, but this led to a separate set of compilation errors relating to Span::mixed_site()
when compiling dynasm
.
Is it recommended that I build from source instead of using cargo install
?
Edit: I attempted to build from source and got the same errors (stable and nightly).
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.