
A Forth to Scratch compiler - CarolineW
https://scratch.mit.edu/discuss/topic/213122/
======
Retr0spectrum
There are quite a few interesting transpilers involving Scratch. For example,
[https://phosphorus.github.io/](https://phosphorus.github.io/) lets you
transpile Scratch code to JavaScript for improved performance.

Other projects of note are an LLVM frontend for Scratch:

[https://github.com/bobbybee/scratch86](https://github.com/bobbybee/scratch86)

And a corresponding backend:

[https://github.com/bobbybee/scratch-
llvm](https://github.com/bobbybee/scratch-llvm)

~~~
saghm
Compiling to JavaScript to improve performance? There's something new

------
stevekemp
It is nice to see the recent rise of posts about FORTH. It's a language I
first played with back on the 48k ZX Spectrum in the late nineties.

When I first used it I loved the way you could redefine the language, at run-
time in the REPL. These days I just love the purity and cleanliness of the
language.

I don't have a single compelling use-case for it, but over the years I've
written my own implementation in C, Java, and Perl.

Having recently started playing with hardware it is nice to see you can even
run it on ESP8266 / Arduino hardware.

~~~
xzm
Very timely remark :) Take a look at what jcw (of tclkit fame) is doing:

[http://jeelabs.org/2017/02/various-shades-of-
forth/](http://jeelabs.org/2017/02/various-shades-of-forth/)

~~~
stevekemp
Thanks for the link, they were indeed timely pieces!

------
ycmbntrthrwaway
This project completely misses the point of Forth.

Forth is an interactive assembler. This one has no REPL.

Control structures are easy to introduce in the Forth itself because IF, ELSE
and THEN are separate "immediate" words that just manipulate the return stack
and compile some branching code immediately when parser encounters them. This
compiler has no return stack at all and just looks for IF..ELSE..THEN during
parsing.

Forth is ugly outside but has beautiful implementation. This compiler is some
ugly python code inside.

