arclanguage / rainbow-js Goto Github PK
View Code? Open in Web Editor NEWA JavaScript port of most of Rainbow (conanite's JVM-based Arc implementation).
License: Other
A JavaScript port of most of Rainbow (conanite's JVM-based Arc implementation).
License: Other
In the browser-based REPL, running the (rat)
unit tests gives one test failure with a very clear error message: "No filesystem."
We could do the same thing for other operations the unit tests use, such as java-new
. Having some binding for java-new
will then cause a few more files of unit tests to run, as per the conditional logic in src/arc/lib/unit-test.arc. (Like the other unit tests, these extra ones pass except for some expected failures, like when they attempt to use the java-...
FFI operations.)
We should document the library people get when they require("rainbow-js-arc")
from a Node.js program. This is the API surface area that should be documented:
const rainbowLibrary = require("rainbow-js-arc");
const rainbowInstance =
rainbowLibrary.makeRainbow(
System_in, System_out, System_err, System_getenvAsync0,
System_getenvAsync1, System_exitAsync, System_fs);
const rainbowInstance2 =
rainbowLibrary.makeNodeRainbow(stdin, getStdout, getStderr);
const rainbowInstance3 = rainbowLibrary.getSharedRainbow();
The documentation for makeRainbow()
is bound to be the most complex part. If possible, we should document it thoroughly enough that people can write their own I/O systems for Rainbow.js like index-first.js
, index-last.js
, and rainbow-node-src.js
do.
I've put together a few of these recently:
Currently, timing begins from the moment Console_st.mainAsync()
is called. In Java, the start of main
is one of the earliest, if not the earliest, possible times to do something. But in our Node.js and web REPLs, we spend some time loading Rainbow.js itself, and we can potentially start the clock much earlier on. Let's do that.
We should create a rainbow-js-args run [args...]
subcommand that has functionality similar to rainbow-js-args run-compat [args...]
for executing Arc programs in batch mode and starting REPLs.
By allowing ourselves to change the CLI syntax, we can probably achieve a bit more flexibility than what Java Rainbow supports, such as the way Racket's CLI supports interleaving files to load and expressions to evaluate. Java Rainbow's CLI can already execute multiple files and multiple expressions, but it executes every file before executing any of the expressions.
The readme and the demo page could be updated in a few ways:
System_out
, System_getenvAsync0
, and so on, where different wrappers like src/node/rainbow-node.js and src/web/index-first.js implement these variables in ways that make the most sense for their platforms. Threads are absolutely possible to implement in terms of continuation-passing style, too, which was something I learned in part thanks to doing this port. While I didn't start porting this project with that extent of parity in mind, it is possible, and let's make sure the readme reflects that potential.The npm install rainbow-js-arc
npm package is currently better than nothing, and it has two parts, neither of which is in the best shape:
require("rainbow-js-arc")
. This library has no documentation.rainbow-js-arc
command that can execute Arc code. This command has to be run from the node_modules/rainbow-js-arc/src/arc/ directory, or else it can't load essential libraries like arc.arc.Let's facilitate a workflow like this:
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.