Live data from Hacker News

SCRIPT-8: An 8 Bit Fantasy Computer Programmed with Javascript

script-8.github.io

31–40 of 63 posts

Re: SCRIPT-8: An 8 Bit Fantasy Computer Programmed with Javascript

#31

Hello everybody, author here. I hope you enjoy my tiny project. Regarding language, I chose Javascript for three reasons: - the (ab)use of `eval` lets you do all sorts of sorcery, like instant evaluation - the JS Redux library makes it easy to work with state, and I couldn't have implemented SCRIPT-8's time-traveling debugger without it - I dream in Javascript I love Lua's small footprint, and very early on I conside…

Do cassettes have a size limit? AFAIK all (most?) the other fantasy consoles do but I didn't see anything on your page.

A lot of the cool features others mentioned seem like they would be overkill on a small codebase.

Re: SCRIPT-8: An 8 Bit Fantasy Computer Programmed with Javascript

#32
post #31

Hello everybody, author here. I hope you enjoy my tiny project. Regarding language, I chose Javascript for three reasons: - the (ab)use of `eval` lets you do all sorts of sorcery, like instant evaluation - the JS Redux library makes it easy to work with state, and I couldn't have implemented SCRIPT-8's time-traveling debugger without it - I dream in Javascript I love Lua's small footprint, and very early on I conside…

Do cassettes have a size limit? AFAIK all (most?) the other fantasy consoles do but I didn't see anything on your page. A lot of the cool features others mentioned seem like they would be overkill on a small codebase.

They don't now, but that is coming. The "SHOW CASSETTE SIZE" button under the live-preview screen shows you the current size / compressed size. But it doesn't prevent you from making a huge cassette - not yet.

Re: SCRIPT-8: An 8 Bit Fantasy Computer Programmed with Javascript

#33

Hello everybody, author here. I hope you enjoy my tiny project. Regarding language, I chose Javascript for three reasons: - the (ab)use of `eval` lets you do all sorts of sorcery, like instant evaluation - the JS Redux library makes it easy to work with state, and I couldn't have implemented SCRIPT-8's time-traveling debugger without it - I dream in Javascript I love Lua's small footprint, and very early on I conside…

Glad to find another moonscript fan!

Re: SCRIPT-8: An 8 Bit Fantasy Computer Programmed with Javascript

#34

Hello everybody, author here. I hope you enjoy my tiny project. Regarding language, I chose Javascript for three reasons: - the (ab)use of `eval` lets you do all sorts of sorcery, like instant evaluation - the JS Redux library makes it easy to work with state, and I couldn't have implemented SCRIPT-8's time-traveling debugger without it - I dream in Javascript I love Lua's small footprint, and very early on I conside…

Very creative project! Did you experience any issues doing pseudo-low-level programming with Javascript's lack of typing system or definite integer/float data-types?

Re: SCRIPT-8: An 8 Bit Fantasy Computer Programmed with Javascript

#35

Hello everybody, author here. I hope you enjoy my tiny project. Regarding language, I chose Javascript for three reasons: - the (ab)use of `eval` lets you do all sorts of sorcery, like instant evaluation - the JS Redux library makes it easy to work with state, and I couldn't have implemented SCRIPT-8's time-traveling debugger without it - I dream in Javascript I love Lua's small footprint, and very early on I conside…

Very creative project! Did you experience any issues doing pseudo-low-level programming with Javascript's lack of typing system or definite integer/float data-types?

Thank you, and no issues, because I didn't implement any low-level programming. I use React/Redux and Canvas 2D, with some custom shape drawing to avoid antialiasing (e.g. Bresenham's algorithm).

Re: SCRIPT-8: An 8 Bit Fantasy Computer Programmed with Javascript

#36

Hello everybody, author here. I hope you enjoy my tiny project. Regarding language, I chose Javascript for three reasons: - the (ab)use of `eval` lets you do all sorts of sorcery, like instant evaluation - the JS Redux library makes it easy to work with state, and I couldn't have implemented SCRIPT-8's time-traveling debugger without it - I dream in Javascript I love Lua's small footprint, and very early on I conside…

This looks fun! Would be great to have something that catches runtime errors and highlights them in the source code. Then, of course, code completion etc to make it easy to find stuff.

I started working on a bit similar project some years ago (I unfortunately abandonded it...) but I got one thing right: the ability to highlight the erroneous line. See http://write-a-game.herokuapp.com/ and try to call a non-existent function.

Re: SCRIPT-8: An 8 Bit Fantasy Computer Programmed with Javascript

#37
post #36

Hello everybody, author here. I hope you enjoy my tiny project. Regarding language, I chose Javascript for three reasons: - the (ab)use of `eval` lets you do all sorts of sorcery, like instant evaluation - the JS Redux library makes it easy to work with state, and I couldn't have implemented SCRIPT-8's time-traveling debugger without it - I dream in Javascript I love Lua's small footprint, and very early on I conside…

This looks fun! Would be great to have something that catches runtime errors and highlights them in the source code. Then, of course, code completion etc to make it easy to find stuff. I started working on a bit similar project some years ago (I unfortunately abandonded it...) but I got one thing right: the ability to highlight the erroneous line. See http://write-a-game.herokuapp.com/ and try to call a non-existent…

Here's the stack trace parser used. It tries to extract the line number and error message from an Error object. Sorry for the coffeescript!

https://github.com/raimohanska/write-a-game/blob/8d2111e2372...

Re: SCRIPT-8: An 8 Bit Fantasy Computer Programmed with Javascript

#39

I'm super jazzed about this. Wonder if there's anything gained by compiling to web assembly? Thanks for making this.

The typical performance requirements of these fantasy consoles are well below the need for WASM. Having said this, since this one is JS-based there shouldn't be anything stopping your from compiling your own WASM module in the code

Re: SCRIPT-8: An 8 Bit Fantasy Computer Programmed with Javascript

#40

Hello everybody, author here. I hope you enjoy my tiny project. Regarding language, I chose Javascript for three reasons: - the (ab)use of `eval` lets you do all sorts of sorcery, like instant evaluation - the JS Redux library makes it easy to work with state, and I couldn't have implemented SCRIPT-8's time-traveling debugger without it - I dream in Javascript I love Lua's small footprint, and very early on I conside…

> very early on I considered writing SCRIPT-8 in MoonScript, which compiles to Lua and has gorgeous syntax. Maybe some day.

I know it's no longer considered hip these days, but why not support CoffeeScript?

It's easy to compile to JS on the client-side, so support should be much simpler than Lua or MoonScript. You could steal the trick TIC-80 uses to support MoonScript and say that starting a cassette with the string "use CoffeeScript" marks it as a CS file. Then it's "just" a matter of an if(String.startsWith("use CoffeeScript\n"))-check followed by an intermediate string-to-string compilation step, right?

https://coffeescript.org/

Post reply on HN