Hacker News new | ask | show | jobs
by Tloewald 3638 days ago
If we're really going to be fair, the JavaScript is a much more readable 30 loc than your nigh incomprehensible block of "17" loc which looks like something out of the obfuscated C contest. I expect you rely on the OS for some stuff, why not factor in the size of that?
4 comments

If you want the fully unfolded version you have it there [1]. If you count the JS + CSS lines, then it's about the same size as the Red unfolded version.

[1] https://gist.github.com/dockimbel/b0a413342dc39568696207412a...

I am no expert here, but given the Red system is under 1MB, and the Java browser is over 100MB, wouldn't what they use in the OS be the same, and therefore Red is still 100 times smaller. Just curious. I find the whole self-contained thing under 1MB with no dependencies very intriguing. Especially afer looking at the other demos that are not trying to code golf. Great GUIs and respectable speeds, and easy to distribute.
Code never runs in a vacuum, so arguing about the size of the elephants on the way down is pointless, which is my point.

What I do see is that the JavaScript does all of this much more cleanly and intelligibly, and has an honest line count.

Incidentally, I also think that cleanly separating presentation from logic is an advantage of the JS / CSS divide, even is JavaScript if far from perfect and CSS is actively horrible.

I did a VID version of the demo, that shows a hint at how styling works in Red.

https://gist.github.com/greggirwin/8d0b1c02ccdbd5520d9c77d49...

The reactive logic is all lifted from the original. Around line 40 you can see where styles are defined inline. Originally I had them just defining visual aspects, but then moved the actors into the cell style as well.

With native widgets, you don't get complete control, and they won't match across platforms. Rebol had its own GUI system, and I wouldn't be surprised to see something similar done by a clever Red...we don't have a name for folks who write Red yet. Racket got the best name, with Racketeers.

Good to see that. After all, the article was close to code golfing and not using the new VID to keep it succinct.

More VID demos and the type of FRP in RED would be more enticing to me. But truth be told, I stumbled upon Red when looking at short programs translating text to morse code. The Red example (from Rebol actually) was very short, yet easy to read. I program in J, so I know what short, and unreadable means to others; I personally like J.

That's much clearer, thanks!

Folks who use Red could be referred to as communists ;-) If it takes off, you'll be Big Red.

I don't think it is pointless. But I am curious, not being a JavaScript dev, what would be the closest analogy to Red's setup. For instance, you can download Red for multiple platforms under 1MB, and without a browser, it self-compiles and you have a full coding environment.

I realize browsers are ubiquitous, so in essence you just need to count the size of browser, JS engine and code. What would be the bare minimum JS setup to provide core libs, GUI, and other helper libs and a way to run it/distribute it sans relying on pre-installed browsers. Would that be Chromium or Electron? Can you choose the best engine with them, or are they attached to the browser or minimal browser?

If you really want to be fair, you all would count all the LOC that makes all that possible. Then we'll see who is pissing further!
given the size of the the entire thing, the LOC of these programs are a rounding error anyway.
@dockimbel: perhaps adding some syntax coloring of your code example might help here, the syntax is hard to parse if you don't know what to look for..