4 ms·
I really wished there was a GC-ed but strictly-evaluating Haskell. A Rust-like syntax would probably help with adoption but I don't have a strong preference in
by wirrbel 4y ago
I really wished there was a GC-ed but strictly-evaluating Haskell. A Rust-like syntax would probably help with adoption but I don't have a strong preference in that.
- discarded1023 4y agoTry Standard ML or ocaml. You may be surprised how far the module system can take you, and how limited type classes really are for expressing abstractions. On a different vector, you can see the same story -- type classes are convenient but too limited -- in the development of abstract algebra/topology/analysis/... in Isabelle/HOL. As for laziness, things don't work out too well for a variety of reasons. Bob Harper laid out several many years ago. See e.g. https://news.ycombinator.com/from?site=existentialtype.wordpress.com&next=2481042 https://news.ycombinator.com/from?site=existentialtype.wordp...
- wirrbel 4y agoI really like standard ML. Modules are great but type classes would be … more pragmatic?
- bmitc 4y agoMy preference are ML dialects, but it sounds like Idris is something you should check out. It's strict by default and has type classes and dependent types.
- wirrbel 4y agoIdris was always filed in my head as some estoric/academic/obscure thing, will have a look at it.
- bmitc 4y agoI actually think it's probably less academic than Haskell or Racket. It's intended to be a practical language that people build things with. It just has an advanced type system and a small community.
- erk__ 4y agoThere is even a SML that does not use a GC* but instead does "region based" memory mangement. https://elsman.com/mlkit/about https://elsman.com/mlkit/about *most of the time.
- one-punch 4y ago> I really wished there was a GC-ed but strictly-evaluating Haskell. To answer this question literally, there are PureScript (transpile to JavaScript), Idris (dependently typed), OCaml, and Standard ML (as discarded1023 pointed out). But I think the wish for a strictly-evaluating Haskell is sometimes in fact a wish for a Haskell with more predictable performance (especially in memory usage). If so, the Linear Type/Arrow of recent GHC may fit the bill [1]. My wish is for Haskell to have a better runtime [2] with optimal reductions (with more predictable performance and without GC) [3], which could have Rust-like performance without lifetimes, while being lazy. [1]: https://www.tweag.io/blog/2017-03-13-linear-types/ https://www.tweag.io/blog/2017-03-13-linear-types/ [2]: https://discourse.haskell.org/t/high-order-virtual-machine-hvm-an-optional-ghc-like-runtime-for-rust-with-many-comparisons-to-ghc/4118 https://discourse.haskell.org/t/high-order-virtual-machine-h... [3]: https://github.com/HigherOrderCO/HVM https://github.com/HigherOrderCO/HVM
- noloblo 4y agoAnd faster Compile times haskell compile times relative to golang are super slow
- one-punch 4y agoGolang prioritizes compile time (hence it took them so long to get Generics), which Rust and Haskell are unlikely to beat, as they both prioritize high-levels of abstractions (more compile time for zero cost abstractions at runtime). That said, since GHC is implemented in Haskell, the compile time will likely improve if linear type/arrow, or a better runtime (such as optimal reductions), is used by GHC itself.
- noloblo 4y agowhat is linear type/arrow?
- one-punch 4y agoLinear Type/Arrow makes sure values are consumed exactly once (as they cannot be duplicated nor destroyed), and such runtime can be used for efficient resource management without reference counting or garbage collection [1]. For Linear Type/Arrow in Haskell, see [2][3][4]. For Linear Type (or Relevant Type) in Rust, see [5]. [1]: https://news.ycombinator.com/item?id=16100840 https://news.ycombinator.com/item?id=16100840 "Linear types can change the world" [2]: https://www.tweag.io/blog/2017-03-13-linear-types/ https://www.tweag.io/blog/2017-03-13-linear-types/ "Linear types make performance more predictable" [3]: https://www.tweag.io/blog/2023-01-26-linear-constraints-freeze/ https://www.tweag.io/blog/2023-01-26-linear-constraints-free... "Linear Constraints: the problem with O(1) freeze" [4]: https://www.reddit.com/r/haskell/comments/v3gouc/linear_text_builder_up_to_20x_faster_than/ https://www.reddit.com/r/haskell/comments/v3gouc/linear_text... "Linear Text Builder: up to 20x faster than alternatives" [5]: https://faultlore.com/blah/linear-rust/ https://faultlore.com/blah/linear-rust/ "The Pain Of Real Linear Types in Rust"
- deleted 4y ago[deleted]
- xmcqdpt2 4y agoScala can be quite Haskell-like and is eager evaluating by default. (It's a lot less opinionated though so you can use it to write Java like code.)
- wirrbel 4y agoI have worked professionally with Scala for two years and while I see its appeal of using it over plain Java, it always felt fairly alien to me and pretty complex (probably due to the Java interop and strong typing).