5 ms·
Been dabbling in f# lately, but this has me wanting to give OCaml a try for comparison, very interested in the new effects stuff.
by runevault 4y ago
Been dabbling in f# lately, but this has me wanting to give OCaml a try for comparison, very interested in the new effects stuff.
- rigoleto 4y agoI wish OCaml had something like F#'s lightweight syntax: https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/verbose-syntax https://learn.microsoft.com/en-us/dotnet/fsharp/language-ref...
- runevault 4y agoI'd never seen the verbose syntax for f#, I thought you had to write it the whitespace dependent way. Huh.
- bitbckt 4y agoIt's been tried https://people.csail.mit.edu/mikelin/ocaml+twt/ https://people.csail.mit.edu/mikelin/ocaml+twt/
- KMag 4y agoNote that The Whitespace Thing actually preceded F#. (Mike and I were in the same fraternity, I remember talking to him about TWT, and we haven't talked much since our college days, which pre-date F#.) IIRC, Mike was also doing a bunch of stuff with a Jabber client in OCaml around that time.
- cies 4y agoReasonML or ReScript not your cup of tea? They are different syntactical front-ends for OCaml.
- hawk_ 4y agoLightweight syntax is a pain to use for blind people. Glad OCaml hasn't fallen for that fad.
- naasking 4y agoDo blind people use special code editors? If so, they should probably have a whitespace sensitive mode to make this easier.
- robot9000 4y agoThis so-called lightweight syntax gives me anxiety just scrolling through these examples.
- yawaramin 4y agoOCaml syntax is whitespace-insensitive. You don't need to worry about indentation, copy-pasting code snippets, etc. I think that makes for a better experience especially for beginners when the parser is more forgiving.
- devmunchies 4y agoYes, I started in OCaml but switched to F# for the last 3 years and will likely move back to OCaml when effects are mature (when lwt and async are snuffed out). Being able to use C# libs is very nice but also it sucks that I don't have true null safety. Who knows, maybe F# is always more performant than OCaml and it doesn't make sense to switch back.
- LAC-Tech 4y agoF# is .NET, so you can have pretty fine grained control over memory layout, right? Spans, packed structs, 8/16/32/64 bit signed/unsigned ints, etc. That stuff all gets a bit screwy in Ocaml, an int has 31 bits of information but is 32 bits in size, a record with two int 64s ends up being twice you expect, etc.
- yawaramin 4y ago> when effects are mature (when lwt and async are snuffed out). That's actually on the way right now. The main concurrency library which is designed for OCaml 5, eio, internally uses effects but doesn't require its users to be exposed to them. Users write code in direct style and don't need to care about internal implementation with effects.