Hacker News new | past | comments | ask | show | jobs | submit login

You're thinking of Haskell. F# was modelled after OCaml, which doesn't attract monad transformer stacks, and doesn't have a zoo of compiler extensions.



Well, they aren't actually compiler extensions but pre processor extensions (PPX).

And I would really like if OCaml would have had the possibility to add the needed PPXs names to the source file (like Haskell's compiler extensions). So as to not have to read the Dune (or whatever build system is used) file to get to know where `foo%bar` or `[@@foo]` is coming from and what is doing. But at least the usage of `ppxlib` nowadays should make PPXs "compose" aka. not stamping on each other's feet.

https://ocaml.org/docs/metaprogramming http://ocamlverse.net/content/metaprogramming.html


I haven’t used it for some time but OCaml certainly used to have a zoo of incompatible compiler extensions. Circa 2008 or so I once hit on the brilliant idea of using protobufs to get two mutually incompatible halves of an ocaml program to talk to one another only to find that required yet another compiler extension to work.


Are you thinking of preprocessors? Back then, it would have been via Camlp4 and Camlp5.


Aah yes I am


I'm pretty sure F# was modeled on both. There are some definite "Haskell-isms" in F#; if nothing else, monads are typically done in something more or less equivalent to the `do` notation (an `async` or `seq` block), for example.

The syntax superficially looks a lot like OCaml, but it doesn't do the cool stuff with OCaml functors and modules; you write it a lot more like Haskell most of the time.


Here is the "official" history of F#: https://fsharp.org/history/hopl-draft-1.pdf

Don Syme began with a port of Haskell to .Net, but SPJ convinced him that this is a bad idea, so he did choose OCaml. ("The Decision to Create F#", Page 9)


You have to add extra syntax to do very normal things like have more than one expression in a function.


As someone who's coded OCaml for 20 years, I have no idea what you're referring to. `let x in y`? `x; y`? `x, y`? Those are all in the base language.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: