Live data from Hacker News

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

script-8.github.io

41–50 of 63 posts

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

#41

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…

I wish more people used CoffeeScript and supported it. The syntax makes me so happy

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

#42
This looks incredible ! Real time editing, time travel ... and integrated sprite, map, and music editors are a real plus. Only thing is the default color palette that is great but I wonder if we can change it ?

For people complaining about JS vs Lua : go have a look at Amulet. This is not a fantasy console but also has an online editor and is perfectly suited for retro games. Just have a look at "Defender of the Weeping Quasar" in the example section : http://www.amulet.xyz/editor.html

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

#43

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…

Coffee Script is hell.

Apart from https://github.com/usefulthink/coffeescript-from-hell/blob/m..., it takes the worst approach to spaces as syntax, because it doesn't enforce consistency, so with many devs you can end up with a file with two, four spaces, tabs all compiling but easily breaking. It has features their own syntax checker recommend not using, like defining objects without curly braces (which I think shouldn't even be a feature, but it was once so backwards compatibility)

Coffee Script tries to be beautiful without straying too far from Javascript and it ends up being an easily broken mess. I would then recommend either typescript or purescript.

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

#44
I find kind of disingenuous that the page does not mention PICO-8 at all, which is the obvious inspiration for this project, starting from the name. Many people who are in the scene, as it were, do know PICO-8 and know to draw the parallels, but it'd still be nice to link back to https://www.lexaloffle.com/pico-8.php somewhere...

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

#45
Interesting how different people arrive at similar ideas. Many years ago I created a retro-like "virtual computer" in Java, called simpleJ, to let teenagers learn how to program by creating simple arcade games. It also had an IDE like environment, with a step by step debugger that could draw a diagram of run time data-structures (arrays, linked lists, trees, etc.), a tile editor, a sprite editor, and a even a book teaching you how to program a video game. You can take a look at it at http://simplej.com/ (in Spanish).

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

#46

Earlier quoted context omitted.

> 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…

Coffee Script is hell. Apart from https://github.com/usefulthink/coffeescript-from-hell/blob/m... , it takes the worst approach to spaces as syntax, because it doesn't enforce consistency, so with many devs you can end up with a file with two, four spaces, tabs all compiling but easily breaking. It has features their own syntax checker recommend not using, like defining objects without curly braces (which I think sho…

Honest question: pointing out programming design warts that allow for WAT-level code[0] is perfectly valid, and I obviously prefer elegantly designed languages. Having said that, how realistic are the odds of being bitten by these issues when using CoffeeScript?

Also, if our point of comparison is Lua and MoonScript, how do those compare?

EDIT: regarding TypeScript and PureScript, can those be compiled in the browser? By which I mean, I'm sure they can technically but do not-too-heavy implementations of such exist?

[0] https://www.destroyallsoftware.com/talks/wat

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

#47

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…

"I love Lua's small footprint, and very early on I considered writing SCRIPT-8 in MoonScript, which compiles to Lua"

Something similar, in Lua: https://liko-12.github.io/

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

#48

Earlier quoted context omitted.

Coffee Script is hell. Apart from https://github.com/usefulthink/coffeescript-from-hell/blob/m... , it takes the worst approach to spaces as syntax, because it doesn't enforce consistency, so with many devs you can end up with a file with two, four spaces, tabs all compiling but easily breaking. It has features their own syntax checker recommend not using, like defining objects without curly braces (which I think sho…

Honest question: pointing out programming design warts that allow for WAT-level code[0] is perfectly valid, and I obviously prefer elegantly designed languages. Having said that, how realistic are the odds of being bitten by these issues when using CoffeeScript? Also, if our point of comparison is Lua and MoonScript, how do those compare? EDIT: regarding TypeScript and PureScript, can those be compiled in the browser…

> how realistic are the odds of being bitten by these issues when using CoffeeScript?

In my experience, minimal if you know the language well and can work around its quirks. Having said that, I prefer working with a language that doesn't require much time to tame and let me do concrete work, at the same time holding my hand when necessary (because of time schedule and pressure and so on). This is less of an issue with private projects, but still there are no downsides in learning a tool that is great for both lone and team work, so there is no real benefit in using coffeescript when there are much more solid languages that compiles to Javascript out there. Hell even heard you can change Glasgow backend compiler to make haskell output Javascript haha

I can't answer about lua and moonscript, I'm completely unfamiliar with them.

About typescript and purescript being compiled in browser, I have never even looked into such approach, they feel unrealistic, because from the top of my head it would require a compilation tool written in JS, which is not particularly efficient for this kind of task that benefits from parallelization, specially if you are not doing deep checks, just translating code. Then there is the matter of what to do with the resulting code. Can we dump it into a file and load it programatticaly? I would be surprised if we could. Eval() the output? Not without some serious security checks that would further compromise performance.

So I believe there is no motivation in not pre-compiling and distributing the result dist code

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

#49
Unlike most, I don't see a problem with it being Lua or JavaScript. I'm just curious why people pick such high-level languages in the first place. I'm planning to make a fantasy computer myself (basing it off the z80), and would never think to make it scriptable in something other than machine code.

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

#50

Unlike most, I don't see a problem with it being Lua or JavaScript. I'm just curious why people pick such high-level languages in the first place. I'm planning to make a fantasy computer myself (basing it off the z80), and would never think to make it scriptable in something other than machine code.

Because we had BASIC on 8 bit home micros and those languages are the natural successors.
Post reply on HN