Hacker News new | ask | show | jobs
by reycharles 3843 days ago
How is this 'Haskell-derived'?
1 comments

From 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".

This 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.

Just 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))
semantics ... based on Haskell while using eager evaluation is kind of a contradiction in terms. The difference between eager and lazy evaluation is rather large.
Definitely. 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.
Rust 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.