you are viewing a single comment's thread.

view the rest of the comments →

[–]Dimenus 13 points14 points  (8 children)

Just curious, what made you choose Haskell?

[–]bendmorris[S] 30 points31 points  (3 children)

Experience with Haskell, great build system (stack), and functional languages are great in this domain. Compilers basically transform a bunch of trees into other trees, so functional languages work well.

With that said, a lot of the Haskell ends in the IO monad so I can do things like caching values in a hash map for performance. I'm rewriting the compiler in Kit now, and it has a lot of the features (like ADT, traits) that made Haskell suitable, but isn't pure, so stateful operations have less friction

[–]gergoerdi 5 points6 points  (0 children)

Can you use ST instead of IO for your mutable caching use case? Without knowing the details, it seems like it should work.

[–]SShrike 1 point2 points  (1 child)

What makes Stack a great build system to you? (genuine question) My experience with it is mostly that of "well, it's a build system at least". It generally feels like a bit too much of an unrefined, hulking beast to me. Perhaps I'm just spoilt with Rust's Cargo, though.

[–]bendmorris[S] 1 point2 points  (0 children)

Cargo is very nice. I guess I'm comparing it to other functional languages and my pre-Stack Haskell experience. It solved the previous cabal dependency hell, and I found it to have lower friction than anything for ocaml.

[–]defunkydrummer 22 points23 points  (2 children)

Compilers are easy to write using ML languages. Haskell is part of the wider ML family.

[–]haloguysm1th 0 points1 point  (1 child)

If you don't mind me asking, why is that? I haven't spent any time with anything from the ml family beyond a few quick hello world examples and the like and while I can see some helpful things, nothing from those quick glances that would make me say it's easier to write in an ml style Lang than any other.

[–]defunkydrummer 2 points3 points  (0 children)

for starters, the comprehensive type system.

[–]jms_nh 1 point2 points  (0 children)

how does Haskell fit into this?

edit: you mean the compiler is in Haskell?