9 ms·
OCaml Canvas
- HPMOR 4y agoSo cool. Love to see high quality OCaml Libraries.
- unwind 4y agoI love to see that it's 78% C code. :) Not trying to be annoying, but it's sometimes fun/interesting[*] to see that C (which gets a lot of critique here) is still important in order to enable higher-level languages like here. [*]: If, like me, you happen to like C, that is. Edit: escape those lonely asterisks.
- LeonidasXIV 4y agoIt could also be indicative how verbose C is. Given it is used in the C stubs, it does a lot of data conversion from/to OCaml values which increases the line count fast.
- substation13 4y agoThey wrote the C so that you don't have to :)
- michaelcampbell 4y agoSnarkily, could it be that it takes 7x the amount of C to do what Ocaml can do?
- thangngoc89 4y agoOCaml is like an HN darling, always go to the front page. Hopefully, OCaml 5.0 would drive more adoptions to the language.
- wakeupcall 4y agoI 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.
- phplovesong 4y agoYes! 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.
- bruh2 4y agoYou may also like this discussion in the OCaml forum: https://discuss.ocaml.org/t/whats-your-development-workflow/10358 https://discuss.ocaml.org/t/whats-your-development-workflow/...
- nequo 4y ago> dataframe/sci/numerical plotting libraries What libraries do you recommend for these? I would love a statically typed alternative to R.
- thangngoc89 4y agoCheck out OWL (https://ocaml.xyz/ https://ocaml.xyz/). It's an umbrella project for anything related to data sciences in OCaml.
- 4y ago
- WastingMyTime89 4y agoOcaml 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.
- frou_dh 4y agoIn the strictly browser realm, there's also Brr: https://erratique.ch/software/brr/doc/Brr_canvas/index.html https://erratique.ch/software/brr/doc/Brr_canvas/index.html which is a recent reimagining of the traditional interface to browser APIs (provided by js_of_ocaml) in a much more idiomatic OCaml style. https://erratique.ch/software/brr/doc https://erratique.ch/software/brr/doc
- 0x69420 4y ago> in the strictly browser realm > much more idiomatic OCaml style dammit, that's it -- time to go and whip up something that fills the “actual ocaml realm”/“idiomatic ocaml style” quadrant
- tempodox 4y agoThis looks to be a much improved version of what used to be provided by the now defunct `Graphics` module. Definitely have to try it out. `Graphics` was X11-only, but it was the only way to produce on-screen graphics directly in OCaml (i.e. without using a web browser or other image display app). Very nice to have something like that again.
- octachron 4y agoThe graphics library still exists, it is only distributed as a separate library rather than bundled with the compiler distribution, which seems like a better fit for a pedagogical library like `graphics`. Also `graphics` works fine on Windows. In fact, nowadays the edge-case for `graphics` support is MacOs with its dwindling support for X11.
- tommy92 4y agoWhats the best book/resource to learn OCaml for someone new to FP?
- wk_end 4y agoReal World OCaml is available online for free [0] and should work pretty well. [0] https://dev.realworldocaml.org/ https://dev.realworldocaml.org/
- mirekrusin 4y ago[0] "OCaml Programming: Correct + Efficient + Beautiful" 200 video lectures from Michael Ryan Clarkson [0] https://www.youtube.com/watch?v=MUcka_SvhLw&list=PLre5AT9JnKShBOPeuiD9b-I4XROIJhkIU https://www.youtube.com/watch?v=MUcka_SvhLw&list=PLre5AT9JnK...
- happy_bzy 4y agoThis course open on youtube is perfect for beginners. Ocaml Programming: correct, efficient + beautiful. https://youtube.com/playlist?list=PLre5AT9JnKShBOPeuiD9b-I4XROIJhkIU https://youtube.com/playlist?list=PLre5AT9JnKShBOPeuiD9b-I4X...
- octachron 4y agoI have heard good things on "OCaml from the very beginning" (available at https://johnwhitington.net/ocamlfromtheverybeginning https://johnwhitington.net/ocamlfromtheverybeginning)