5 ms·
Red's author here. In all fairness, for that JS spreadsheet to not look ugly, you need to account for the CSS code too, which is ~35 more lines of normally spac
by dockimbel 10y ago
Red's author here. In all fairness, for that JS spreadsheet to not look ugly, you need to account for the CSS code too, which is ~35 more lines of normally spaced code. Also, there's no realtime reactivity like in our demo where the cells update as you type.
For the "no library", well, you have tons of libraries included in a ~100MB runtime (browser) required to run and render that demo, while Red's one runs on the OS directly (our runtime is 0.6MB uncompressed and entirely written in Red, not a single 3rd-party library). ;-)
That said, that JS demo code is very nice, and its slickness impressive.
- Tloewald 10y agoIf 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?
- dockimbel 10y agoIf 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/b0a413342dc39568696207412a2ef5e7 https://gist.github.com/dockimbel/b0a413342dc39568696207412a...
- maerten 10y ago@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..
- JustSomeNobody 10y agoIf 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!
- nkassis 10y agogiven the size of the the entire thing, the LOC of these programs are a rounding error anyway.
- eggy 10y agoI 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.
- Tloewald 10y agoCode 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.
- greggirwin 10y agoI did a VID version of the demo, that shows a hint at how styling works in Red. https://gist.github.com/greggirwin/8d0b1c02ccdbd5520d9c77d49ea91ada 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.
- Tloewald 10y agoThat's much clearer, thanks! Folks who use Red could be referred to as communists ;-) If it takes off, you'll be Big Red.
- eggy 10y agoGood 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.