Skip to content

ALANVF/Red.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Red.js

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 include 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.

Example usage

NYI

Running

Locally

In order to run this locally, you'll need:

  • Haxe 4.3.1 (or higher)
  • Some version of Node
  1. Run haxe build.hxml to build Red.js
  2. Run node bin/main.js to start the Red.js REPL

In a browser

NYI

Current limitations

  • Because I didn't want to try recreating Red/System just yet, Haxe is being used for development instead.
  • Things that interact with the OSs don't exist because web browsers don't do that.
  • I have yet to benchmark anything, but there's a good chance that this is probably many times slower than the default implementation of Red.
  • I'm currently only 1 person, so progress is gonna be kind of slow as long as it's just me.

FAQ

Why not transpile to JS? Wouldn't that be easier and faster than using an interpreter?

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.

Why do expressions in the REPL print out JS/JSON?

Because it's helpful to be able to easily inspect values when debugging. I'll probably disable it some time in the future.

Why isn't feature X in Red.js if it exists in normal Red?

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.

Do you plan to implement dialects such as Red/System?

I already answered that.

Will Red.js be able to compile to WebAssembly?

I also already answered that.

Why Haxe?

Typescript is gross and doesn't have all the features necessary for this project.

What can I do to help with development?

Anything helps!

Other notes

Please consider looking at TODO.md and FEATURES.md

About

A web runtime for the Red programming language

Topics

Resources

Stars

Watchers

Forks