3 ms·
Meanwhile, I ported Arc to JS: https://imgur.com/0Ba0NZN https://imgur.com/0Ba0NZN If LN turns into anything, it'll be because of Lisp, not in spite of it. It
by shawn 8y ago
Meanwhile, I ported Arc to JS: https://imgur.com/0Ba0NZN https://imgur.com/0Ba0NZN
If LN turns into anything, it'll be because of Lisp, not in spite of it. It really doesn't matter that the world is phobic to it when you alone are the blacksmith.
One could argue "See? It's running in JS. Doesn't that mean Lisp is useless?"
Maybe. But macros are a thing. And when you can generate React on the fly, without having to make a class for every single thing you want to do, the power disparity starts becoming very apparent.
There are interesting Lisp codebases, but you have to dig for them. Abuse (a game engine) comes to mind. http://abuse.zoy.org/browser/abuse/trunk/data/lisp http://abuse.zoy.org/browser/abuse/trunk/data/lisp
And what other language could let you add type inference with relatively little effort? https://web.archive.org/web/20070610012057/http://www.cs.indiana.edu/classes/c311/ https://web.archive.org/web/20070610012057/http://www.cs.ind...
https://web.archive.org/web/20070615124421fw_/http://www.cs.indiana.edu/classes/c311/a10.html https://web.archive.org/web/20070615124421fw_/http://www.cs....
- iplusplus 8y agoFWIW, React is a built-in feature of the new Arc-in-JS port. Here's how it looks: (<a> href: "https://news.ycombinator.com" "Hacker News") That lets you merge s-expression syntax with React syntax quite nicely. (<html> (<body> (<div> width: "100%" "Hello, world"))) Here's the output of a REPL session. $ rlwrap bin/lumen-node > (load "arc.l") > (print:compile:expand '(<a> href: "https://news.ycombinator.com" "Hacker News")) React.createElement("a", {href: "https://news.ycombinator.com"}, "Hacker News") > (print:html (<a> href: "https://news.ycombinator.com" "Hacker News")) <a href="https://news.ycombinator.com">Hacker News</a> > (print:html (<html> (<body> (<div> width: "100%" "Hello, world")))) <html><body><div width="100%">Hello, world</div></body></html> > (print:html (whitepage "Look ma, no Racket")) Warning: Each child in an array or iterator should have a unique "key" prop. Check the top-level render call using <html>. See https://fb.me/react-warning-keys for more information. in body <html><body bgcolor="white" alink="blue">Look ma, no Racket</body></html> You can see it's actually JS, since you get all the same warnings that you'd normally get in a node repl. (It's literally running on Node.) And (print:html (msgpage 'shawn toofast*)) spits out a page saying "You're submitting too fast. Please slow down. Thanks." I find it much easier to generate HTML than traditional methods, and much more maintainable. But it's not fair to claim that something new is inherently better. Time will tell. I'm most interested in any unexpected warts, but there don't seem to be any so far.
- iplusplus 8y agoCurrent code is at https://github.com/lumen-language/lumen/blob/f7bfd4dca71ed1e4eb380e7e819a302825d37936/arc.l#L2234-L2245 https://github.com/lumen-language/lumen/blob/f7bfd4dca71ed1e... if anyone's curious. It's basically a copy-paste from the official arc3.1 release. (You can diff with the official sources at https://github.com/arclanguage/anarki/blob/f01d3f9c661eed05511711a0f3388ca2a1d34fa2/news.arc#L400-L411 https://github.com/arclanguage/anarki/blob/f01d3f9c661eed055...) Apologies for the nested replies; wasn't able to edit.