A web runtime for the Red programming language
Red.js is a web runtime for the Red programming language that allows you use Red right in your browser. Although it's currently very incomplete, the end goal is to make it as similar to regular Red as possible. While I highly doubt it can happen, it'd also be cool for it to also includes features like web equivalents for Red's View, Draw, Rich-Text, and VID dialects and a version of Red/System that can be compiled to WebAssembly.
Red.js is currently being converted from TypeScript to Haxe due to a variety of reasons:
I am keeping the old code in the old
folder for future reference until the transition to Haxe is complete.
NYI
In order to run this locally, you'll need:
haxe build.hxml
to build Red.jsnode bin/main.js
to start the Red.js REPLNYI
This is sadly not possible due to the fundamental differences between Red and JS. In order to support all of the meta-programming features that Red has, it'd be no different transpiling to JS than just embedding the interpreter. There may be a JS dialect of Red.js at some point in the future, but for now it will remain interpreted.
Because it's helpful to be able to easily inspect values when debugging. I'll probably disable it some time in the future.
Red.js is not a perfect replica of normal Red, as there are a large number of things that Haxe/JS cannot do within a browser that can normally be done in Red (due to browser limitations). There could be features that only work when using Node or a different Haxe target, but I would like to mainly focus on features that work on both runtimes.
I already answered that.
I also already answered that.
TypeScript is... annoying. It doesn't support nominal typing (even for classes!), lacks real pattern matching, and it's honestly just as unproductive as the language that it's built on.
Haxe, on the other hand, is a very powerful language that not only compiles to JS, but also fixes pretty much everything that I don't like about TS. These things include:
That being said, Haxe does have a few downsides:
!
without macros??)...
)this
typeDespite these issues, Haxe has been much nicer to work with, and gave me a chance to fix a lot of things that I had originally implemented incorrectly. I've made some macros to help with some of these things, and others have been accepted at the latest Haxe evolution meeting, so I'm hoping that will make the experience better at some point soon.
Anything helps!
Please consider looking at TODO.md and FEATURES.md