5 ms·
Shem: A Haskell-Derived Compile-to-JavaScript Lisp
- reycharles 11y agoHow is this 'Haskell-derived'?
- kornish 11y agoFrom the README: "Shem is a new compiled-to-JS, statically typed, pure-by-default functional programming language. The semantics are based on Haskell but the language evaluates strictly in a similar way to PureScript." The document, unfortunately, doesn't go deeper into what about the semantics are derived from Haskell. A better HN title might be "Shem: a Statically Typed Compile-to-Javascript LISP".
- reycharles 11y agoThis claim confuses me. It's eager, not lazy. And judging from the video presentation, where an incorrect[1] binary search results in a stack overflow, it doesn't have proper tail calls either. This doesn't suggest to me that it derives from Haskell at all. [1]: The lower bound wasn't updated correctly which should made it loop indefinitely.
- reycharles 11y agoJust confirmed, calling (loop) will cause a stackoverflow. You'd expect TCO for a Lisp and proper tail calls for a Haskell-derived langauge. loop (fn [] (loop))
- deleted 11y ago[deleted]
- tempodox 11y agosemantics ... based on Haskell while using eager evaluation is kind of a contradiction in terms. The difference between eager and lazy evaluation is rather large.
- xixixao 11y agoDefinitely. Type classes are the semantic part of Shem taken from Haskell. Perhaps that is not the best summary, it's the type system that is the most obvious connection between Shem and Haskell.
- chc4 11y agoRust also has Haskell's typeclasses in the form of its traits. I don't think anyone would go around claiming it's "Haskell based". When I think Haskell, I think lazy evaluation and only providing purely functional type patternmatching predicates.
- ScottBurson 11y agoNot to be confused with Shen [0]. [0] http://www.shenlanguage.org/ http://www.shenlanguage.org/
- bkase 11y agoDon't miss the presentation linked at the bottom of the readme[1], and the browser-based IDE, Golem linked in the middle[2]. [1] https://www.youtube.com/watch?v=HnZipJOan54 https://www.youtube.com/watch?v=HnZipJOan54 [2] http://shem.io/ http://shem.io/
- daxfohl 11y agoIs it lazy evaluated? Tail-call optimized?
- izym 11y agoEvaluates like PureScript, so no, it's eagerly evaluated. Not quite sure about the TCO part though.
- techdragon 11y agoSo it came to pass that Haskell begat a Lisp, who in turn begat many children unto the clan of JavaScript. The title translates to "biblical speak" pretty well haha
- provemewrong 11y agoThis is one of the most Hacker News titles I've seen.
- deleted 11y ago[deleted]
- yenda 11y agoMy brain is still buzzing, it's a magic hacker buzzword combo ! Impressive work though
- chenglou 11y agoMan AST editors are so hard to get right. I've tried many of them, this one (Golem) included, but it's just very hard to kill the habit of wanting to move around/delete single text characters. Because of that, many people give up and don't move past the initial stage. I think what we need is "Elm error messages" (http://elm-lang.org/blog/compiler-errors-for-humans http://elm-lang.org/blog/compiler-errors-for-humans) for AST editors. Take paredit for example. If you're trying to delete a closing parenthesis, instead of refusing to do so and silently fail, display a tooltip that explains why such action is disallowed, and a list of (heck, hard-coded even, like some Elm errors) likely actions the user's trying to take. Deleting the list? Deleting just a token? Show the keybindings. Or even automatically pick the most likely action after a second invalid delete attempt. I actually believe the constraints imposed by structural editing can be very beneficial (again, see paredit which helps your program stay syntactically valid). But constraints are good when they're visible. You can exhaustively check what's there. Constraints are frustrating when they're invisible and you repeatedly accidentally stumble against them. (Ideally you'd also provide a free-form mode where you can edit things as plain text. But from personal experience I'd just go back to this instead of learning the AST editing keybindings.)
- deleted 11y ago[deleted]
- CMCDragonkai 11y agoThe AST editor golem is really cool. But the habit of wanting to move around and delete single text characters can be trained out of you, just like people who use vim.
- chenglou 11y agoRight, and I'm saying that a huge amount of users wouldn't pass that initial barrier of training before dropping it. Vim's ubiquity, general applicability and community helped it achieve popularity; I do think it succeeded despite having less stellar error prompts as I described above. Current AST editors are frequently domain/language-specific and don't have the advantage of e.g. general applicability, so they need much better error prompts and other hand-holding stuff to make up for it.
- mikkom 11y agoSo this is not javascript version of shen? Very confusing name. http://www.shenlanguage.org/ http://www.shenlanguage.org/
- xixixao 11y agoThe irony of the project you've worked on for a year hitting HN while you're sitting on an 11 hour flight... AMA if you wish
- sooheon 11y agoNo questions, just want to say as a clojure/emacs fan this is right up my alley, and you really blew me away. Actually, I do have a question: do you have a blog or thought dump I can read?
- xixixao 11y agoA hundred pages of brain dump here (the thesis for the project): https://www.dropbox.com/s/02adjyvrsc4pdof/report.pdf?dl=0 https://www.dropbox.com/s/02adjyvrsc4pdof/report.pdf?dl=0
- jamesfisher 11y ago> The semantics are based on Haskell Are the semantics available anywhere? I've been waiting for someone to create a Lisp with pure/monadic IO, but I don't know whether Shem is what I imagine.