News for hackers. Stuff that matters.
Re:OCaml Canvas by thangngoc89 on Tuesday December 13, 2022 @02:52AM (#33965990)
OCaml is like an HN darling, always go to the front page. Hopefully, OCaml 5.0 would drive more adoptions to the language.
Re:OCaml Canvas by wakeupcall on Tuesday December 13, 2022 @05:33AM (#33966939)
I used to scoff to the language impurity and no operator overloading. Ocaml always felt like a beaten ML, always second in class compared to haskell.

As usual, superficial views completely change when you actually start using the language. I never did anything mayor (1yr+dev) on it. I only contributed to existing projects and some small personal ones. I found it more pleasant to use compared to haskell (ghc effectively), less surprising, and and a lot more practical.

Combined with a live repl, it feels very close to how I normally work with lisp. In fact, I actually find it ambivalent compared to julia for explorative work and there's a lot of interesting and recent work being pushed to opam regarding this (dataframe/sci/numerical plotting libraries).

It's old, and thus less sexy/marketable.

Re:OCaml Canvas by phplovesong on Tuesday December 13, 2022 @08:15AM (#33968401)
Yes!

I have my vim open and a split below where i run utop. Then i can evaluate any expression with <C-c C-c> and see the result instantly in utop. I usually also run a smaller split where i run dune runtest -w, so all tests are run on each save.

For a compiled language OCaml is incredibly dynamic when developing. Just like a lisp.

Re:OCaml Canvas by bruh2 on Sunday December 18, 2022 @05:17AM (#34036389)
You may also like this discussion in the OCaml forum: https://discuss.ocaml.org/t/whats-your-development-workflow/...
Re:OCaml Canvas by mattpallissard on Tuesday December 13, 2022 @01:04PM (#33973013)
> It's old, and thus less sexy/marketable

It's been gaining traction in the past few years. I've never dealt with it professionally, but just from my hobby stuff I've had recruiters reach out.

Re:OCaml Canvas by nequo on Tuesday December 13, 2022 @08:35AM (#33968606)
> dataframe/sci/numerical plotting libraries

What libraries do you recommend for these? I would love a statically typed alternative to R.

Re:OCaml Canvas by thangngoc89 on Tuesday December 13, 2022 @09:19AM (#33969174)
Check out OWL (https://ocaml.xyz/). It's an umbrella project for anything related to data sciences in OCaml.
Re:OCaml Canvas by WastingMyTime89 on Tuesday December 13, 2022 @07:16AM (#33967876)
Ocaml is a nice language to work with. I briefly worked on Frama-C as a student and have only fond memories of it. I think it's the same for most people who had to use it in the past which is why it get upvotes.

It has always seemed both very modern in the semantic tools it gave (inference, pattern matching, variant types, the module system) but not too in your face. You could very much code in Ocaml as you would in any imperative language and it would be fine and you would still benefit from the nice type system. Generally you don't want to because the other tools the language gives you feel nicer but sometimes it's simpler and that's fine. Plus, the community tends to be very pragramatic and non judgemental about how you achieve things.