25 ms·
The New OCaml Website
- QuikAccount 4y agoOCaml is a language that I'd really like to use more in my day to day but can't find a use for.
- valcron1000 4y agoWhat's the current state of OCaml regarding parallelism & concurrency? Is it like Node.js where I have single threaded async/await model or do I have access to parallelism?
- masklinn 4y agoOCaml is more like Python in that it has true OS threads, but it has a GIL (it also has an async ecosystem via `lwt` and `Async`). This will change when OCaml 5 is released, though it is likely that will require test driving and fixes in both ocaml itself and the ecosystem. Multicore OCaml was merged in PR #10831, and 5.0 was originally targeted to be cut in March or April 2022, but it seems there are still blockers: https://github.com/ocaml/ocaml/milestone/40 https://github.com/ocaml/ocaml/milestone/40
- pjob 4y agoMulticore support announcement: https://discuss.ocaml.org/t/the-road-to-ocaml-5-0 https://discuss.ocaml.org/t/the-road-to-ocaml-5-0 Latest monthly update: https://discuss.ocaml.org/t/multicore-ocaml-march-2022 https://discuss.ocaml.org/t/multicore-ocaml-march-2022 Github for the multicore project: https://github.com/ocaml-multicore/ocaml-multicore https://github.com/ocaml-multicore/ocaml-multicore
- asplake 4y agoWhat is the OCaml web development story now? What is it like to use?
- frou_dh 4y agoThe new hotness is Dream, which technically isn't 1.0 yet, but is very well documented and example'd https://aantron.github.io/dream/ https://aantron.github.io/dream/ https://github.com/aantron/dream/tree/master/example https://github.com/aantron/dream/tree/master/example
- dna_polymerase 4y agoIt's probably the best open source OCaml project in terms of documentation and in my opinion it really sets the bar for all oss project a little higher. Aantron really did some amazing work here.
- Orangeair 4y agoInitial impression: why do the first two blocks of text say almost exactly the same thing?
- sigzero 4y agoThe second line is what the REPL prints out.
- bvaldivielso 4y agoThey mean the copy, not the code snippets
- cultofmetatron 4y agoI love that we now live in an age where older languages can suddenly start seeing a renaissance. I hope something similar comes to common lisp.
- _benj 4y agosame. I think something along those lines might be happening with projects like Janet, Fennel and Clojure. But I’d love to be able to experience that so talked about CL teaching a system how to behave in CL/Small Talk
- nix23 4y agoLike Mozart/OZ, i just love that language. https://github.com/mozart/mozart2 https://github.com/mozart/mozart2
- zem 4y agohave you used it for anything? i followed it hopefully when it first came out but it never seemed to make the leap beyond "research/teaching language" and was finally abandoned :(
- nix23 4y ago>have you used it for anything? Nothing serious, just playing around, but lost ~interest when they start abandoning...
- cannam 4y ago> I hope something similar comes to common lisp. When you say "something similar", what are you thinking about? Simply this rather professional presentation, or something social, or something technical? Or the fact of a renaissance? Is this sort of revamp a cause or a symptom of a renaissance? For Common Lisp it's always seemed to me that SBCL (disclaimer: never used it, only read about it) is the "modern" option in the sense that it's well maintained, portable and fast, but it has the most amazingly old-school web presence. Another great example is Poly/ML (https://polyml.org/ https://polyml.org/) - one of the best implementations of Ocaml's close relative SML, but it's very much lacking a Bootstrap theme and "trusted by" testimonials and it has a splendid naive-art parrot. I like all that about it, but you wouldn't look at the page and think "I'll choose that for my new green-field project with venture capital money". I would love to see a renaissance of Prolog as well.
- gmfawcett 4y agoThe "build time" graph is missing a time unit on its y-axis.
- MrZander 4y agoI have no familiarity with OCaml at all, so I really don't know what the unit should be here. If it's milliseconds, that's really, really, impressive. If it's seconds though, that seems on par with other languages/compilers I've used.
- gmfawcett 4y agoIt has a pretty fast compiler, that's one of OCaml's strengths. But I've never timed a build of one of these packages.
- _benj 4y agoWhat is OCaml mostly used for? Like Ada for aerospace or Erlang for concurrency, does OCaml has a niche like that?
- melissalobos 4y agoPeople will mention Jane Street for financial stuff, but mostly academia and compilers.
- curiousgal 4y agoThere's also LexiFi for finance.
- fancyfredbot 4y agoDoes LexiFi use vanilla OCaml now? I remember that in the past they had created their own custom dialect.
- anuragsoni 4y agoI've used OCaml at day-jobs for the past couple of years. It has an excellent concurrency story, and I've used OCaml for lots of "boring" work (web services, database drivers, data processing, etc).
- giraffe_lady 4y agoI really think it's such a good fit for most of the daily non-web work I've had to do. It lets you keep the core logic clean & fun and then you can just shrug and let rip with the mutations or whatever when that makes the most sense. I'm well out of my FP fanboy phase now but ocaml feels great for my favorite parts of that without being judgmental when I'm not in the mood.
- anuragsoni 4y ago> It lets you keep the core logic clean & fun and then you can just shrug and let rip with the mutations or whatever when that makes the most sense. Very true! I've used mutations and imperative OCaml quite a few times. Sometimes it was for performance reasons (I've been working on a web server library), and other times when loops either made the implementation a little easier to read, and/or helped avoid some allocations. I am glad that the language is pragmatic enough that I can still use mutation or imperative code where it makes sense, while still being able to present a nice clean api on top.
- hardwaregeek 4y agoIt's a nice website and certainly an improvement from the older one. I just hope that this isn't the only area where OCaml improves. I'd love a consistent documentation source a la docs.rs, better support for language servers, and maybe an explicit effort to build out a good package ecosystem. I really want to like OCaml but the usability story is so far behind Rust. The language is stunning but the ecosystem needs a lot of work.
- glenda 4y agoThe docs.rs part is actually included in the new website: https://ocaml.org/packages https://ocaml.org/packages I've been using ocaml-lsp-server with nvim-lspconfig and it's been great, I'm wondering what issues you've had? From my perspective the ecosystem is evolving pretty quickly!
- d3nj4l 4y agoI can second your experience of using ocaml-lsp-server - I use it with VSCode and it's been incredibly pleasant with lots of active and ongoing work to make it even better. Gone are the days when writing OCaml basically meant using emacs (thought that's still a good option if you want it!)
- hardwaregeek 4y agoPerhaps the README[1] is out of date, but it appears to note that textDocument/implementation is not done? That's a pretty big hole. [1]: https://github.com/ocaml/ocaml-lsp/#features https://github.com/ocaml/ocaml-lsp/#features
- anuragsoni 4y agoOCaml has a pretty decent language server [1]. You can pair it with the excellent OCaml vscode plugin [2], or any other LSP plugin for the editor of your choice. [1] https://github.com/ocaml/ocaml-lsp/ https://github.com/ocaml/ocaml-lsp/ [2] https://marketplace.visualstudio.com/items?itemName=ocamllabs.ocaml-platform https://marketplace.visualstudio.com/items?itemName=ocamllab...
- tmattio 4y agoHi! I am a contributor of this new version of ocaml.org. Just wanted to also link the announcement post here: https://discuss.ocaml.org/t/v3-ocaml-org-we-are-live/9747 https://discuss.ocaml.org/t/v3-ocaml-org-we-are-live/9747. This new website comes with lots of improvements over the previous version, and in particular, the team has been working hard on the following: - Central OCaml package documentation, which contains the documentation of every version of every OCaml packages. (https://ocaml.org/packages https://ocaml.org/packages) - OCaml job board, which lists job opportunities from the community. (https://ocaml.org/opportunities https://ocaml.org/opportunities) - OCaml success stories which explore how major OCaml industrial users solved real-world challenges using OCaml. (https://ocaml.org/industrial-users https://ocaml.org/industrial-users) - An interactive OCaml playground to try OCaml code directly in the browser. (https://ocaml.org/play https://ocaml.org/play) - A syndicated blog, which links to blog articles from the community and offers original blog posts. (https://ocaml.org/blog https://ocaml.org/blog) I'm thrilled that the website is live after more than a year of development! We hope that this will help new comers to have a smoother experience when trying OCaml (in particular with OCaml 5 coming soon), so don't hesitate to share feedback on how we can improve it further!
- agumonkey 4y agowhat website / community is the most warm on ocaml these days ? reddit ? irc ? I don't know, I'm curious where to find people thinking and working with *caml.
- __david__ 4y agoA nit about the code sample syntax highlighting, shouldn't "rec" be highlighted as a keyword and "fac" be the yellowish color that "square" was in the first line?
- agumonkey 4y agoIt's not new, it's function of the old.
- asymmetric 4y agoThe “Carbon Footprint” page[0] is a nice touch. Not much in terms of concrete action there, but the fact it has been written (and linked to in the footer) is a good start. [0]: https://ocaml.org/carbon-footprint https://ocaml.org/carbon-footprint
- mrcrumb1 4y agoWhy do functional programming examples always use such short names? I feel like it adds extra cognitive overhead to trying to learn something that's got plenty of foreign concepts to grok.
- giraffe_lady 4y agoI suspect the ideal behind that is the "variables with small scope should have shorter names" concept. So in a one-liner it's ok to abbreviate. I don't necessarily agree with this especially for examples. But in practice I haven't found the fp communities I'm familiar with (clojure and ocaml) to be too bad about using confusingly terse names. Php and go are by far the worst there, again at least from my experience.
- brucie 4y agoIsn’t it a kind of proof that a function is generic? I can map over some xs with an f and produce ys.
- zem 4y agoa lot of the time there are patterns and idioms that occur very frequently in the language, and have evolved a set of standard short names, e.g. "xs" for a list and then "x" for the element in an iteration, or "acc" for an accumulator parameter in a recursive function.
- zumu 4y agoOften the expressiveness of the type system captures info you'd have to stuff in the name in something like Java or python or at least they just want to emphasize the types over the names. Not always the case though.
- conroy 4y agoThis landing page includes a pet peeve: zero-context social proof. It's great to know that Microsoft, Docker, and Facebook use OCaml. Buy do they use it seriously? The industrial users (https://ocaml.org/industrial-users https://ocaml.org/industrial-users) page links directly the company websites. Only two logos from the home page have case studies. Don't just tell me that Microsoft uses OCaml, tell me how!
- ilaksh 4y agoSame way Microsoft uses Java, mainly. They copied it, paid a bunch of geniuses massive amounts of money to make it better and run on their platform, then spent millions and millions of dollars recruiting Ocaml (Java) developers into their proprietary F# (C#) universe.
- duxup 4y agoI don't even put much faith in those. I've seen enough that I was sure they were BS... they're just noise to me.
- activitypea 4y agoI know that Facebook's Typescript competitor, Flow, was both written in OCaml and tried to introduce the HM type system into the JS world. It was quite popular back in the day, but eventually lost the war to TS. Perhaps more notably, they are still actively working on Rescript (formerly ReasonML), which is an Ocaml dialect with JS as the primary compilation target (think Clojurescript but Ocaml). They also maintain a flavor of React specific for Rescript. I don't know how much they dogfood it, but it seems like they're at least somewhat betting on an ML future. Disclaimer: Not a FB/Meta employee
- zem 4y agotheir python type checker, pyre, is also written in ocaml
- snthueoa 4y agoDocker Desktop uses OCaml/MirageOS for handling all network translation between host and guest systems: https://www.docker.com/blog/how-docker-desktop-networking-works-under-the-hood/ https://www.docker.com/blog/how-docker-desktop-networking-wo...
- junon 4y agoKind of an annoying point but I'm tired of seeing factorial-like functions as the first demos of PL sites. It does nothing to explain how the language works, what it looks like, what any defining/unique features are, what the standard library - if any - might have included, etc.
- Jtsummers 4y agoActually, it does here. Definitions with let in OCaml are not recursive. let rec permits you to have recursive definitions. A simple numeric function is probably the fastest way to show something that a user can type in that illustrates how you'd write a simple recursive function.
- yawaramin 4y agoThe site is on GitHub--feel free to send a PR if you have a better suggestion!
- hbn 4y agoI see those Tailwind classes!
- TheMagicHorsey 4y agoIs MirageOS (Ocaml unikernel) still making forward progress? Ten years ago I thought security sensitive apps would all move to unikernals, but it never happened.
- anuragsoni 4y agoYes it is. There was a new major release last month: https://mirage.io/blog/announcing-mirage-40 https://mirage.io/blog/announcing-mirage-40
- Erlangen 4y agoThe new layout for "99 problems" looks much better than before. It's a huge improvement. https://ocaml.org/problems https://ocaml.org/problems
- continuational 4y ago> General-Purpose, Industrial-Strength, Expressive, and Safe > Here's how to do square and factorial. Show, don't tell.
- plainOldText 4y agoI know these languages are both members of the ML language, but why would one pick OCaml over F#? I've toyed a bit with both and F# seems a bit more ergonomic: pipes, computation expressions, a more concise syntax, etc. I do like how fast the OCaml compiler is though.
- amelius 4y ago> but why would one pick OCaml over F#? For me it would be because OCaml is supported by Ubuntu as a package. In contrast, for installing F# you need to add an external repository and mess with GPG keys etc. which seems odd. Perhaps I'm wrong but what it tells me is that F# is not yet fully embraced by the open source/Linux community.
- whb07 4y agoI find this to not be the case. Essentially anything .netcore to .net5+ is Linux/osx/ windows. Checkout the docs* to install in Ubuntu. F# was open source before any major MSFT project was. In fact it just recently got officially folded into the .net project/repos. https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu https://docs.microsoft.com/en-us/dotnet/core/install/linux-u...
- wk_end 4y agoThe most straightforward reason to pick OCaml over F# is that OCaml's not tethered to the .NET world. Though this is also an excellent reason to pick F# over OCaml! OCaml's type and module system is generally more sophisticated than F#'s - F# doesn't have GADTs, all the functor-y goodness of OCaml's module system, or even OCaml's weird-but-brilliant structurally typed object system. The new algebraic effects that OCaml's getting imminently are pretty killer, too. F#, of course, has several awesome features that OCaml lacks.
- LAC-Tech 4y agoOcaml has pipes now. It also has modules that take other modules as arguments and produce new modules - these are called functors. They're a really useful way of organising code, with F# you'd use .NET objects for similar issues. Nothing against objects - I'm not one of those - but the ocaml design just feels a lot cleaner.
- wawjgreen 4y agoIntellijIDEA has a plugin called ReasonML which also works for Ocaml.
- nazka 4y agoI wish people will use Reason[1] more often and create a vibrant ecosystem with it. It’s the perfect language. Functional, ML but not so hard as Haskel. Very fast to learn and easy to use. And some powerful features like the switch couple with other types and structures. Also no null and undefined and stuff only one thing « None » which avoid many bugs. [1] https://reasonml.github.io/ https://reasonml.github.io/
- melony 4y agoThe JS interop isn't as good as typescript. Calling arbitrary JS libraries from Reason is too hard right now.
- nazka 4y agoYa it has some kirks. But I mean look at the language. It’s so readable. I’m so sad I was talking about this the other day how where it looks like the perfect language but there is not ecosystem…