Hashtag

#OCaml

135 posts tagged with this hashtag.

@dinosaure@mastodon.social
@dinosaure@mastodon.social
@hackuador@functional.cafe
@dfortes@mastodon.social

It's sad that Haskell and OCaml are stuck with such terrible tooling / build systems. I'm partial to OCaml but opam + dune are terrible, and FFI is too complicated (Ocaml LSP is amazing though).

If OCaml had better tooling I would use it instead of Rust whenever possible. As is its I'm probably giving it up for now.

@hannes@social.coop

Romain ( @dinosaure ) talked about building with effects and miou at the workshop and introduced uniker.nl -- with lots of documentation about that (OCaml workshop ocaml.org/ocaml-workshop-2026/)

Note he's a coworker at robur.coop :)

Reach out if you've interest and ideas 💡 about what you'd like to see in the unikernel 🐪 world 🌎.

This work doesn't use multiple stage compilation (mirage configure && make build), no code is generated, no opam-monorepo (barely maintained, comes with a custom solver, ...), no functors -- instead easily accessible straightforward code.

PS just to be clear, no LLM has been involved for developing any of this. We're enjoying to craft the creative and engineered code ourselves by hand.

robur.coop

Robur - Open Source Software Cooperative

Developing robust, secure and sustainable digital infrastructure in OCaml and MirageOS unikernels.

@hannes@social.coop

Romain ( @dinosaure ) talked about building with effects and miou at the workshop and introduced uniker.nl -- with lots of documentation about that (OCaml workshop ocaml.org/ocaml-workshop-2026/)

Note he's a coworker at robur.coop :)

Reach out if you've interest and ideas 💡 about what you'd like to see in the unikernel 🐪 world 🌎.

This work doesn't use multiple stage compilation (mirage configure && make build), no code is generated, no opam-monorepo (barely maintained, comes with a custom solver, ...), no functors -- instead easily accessible straightforward code.

PS just to be clear, no LLM has been involved for developing any of this. We're enjoying to craft the creative and engineered code ourselves by hand.

robur.coop

Robur - Open Source Software Cooperative

Developing robust, secure and sustainable digital infrastructure in OCaml and MirageOS unikernels.

@hannes@social.coop

Romain ( @dinosaure ) talked about building with effects and miou at the workshop and introduced uniker.nl -- with lots of documentation about that (OCaml workshop ocaml.org/ocaml-workshop-2026/)

Note he's a coworker at robur.coop :)

Reach out if you've interest and ideas 💡 about what you'd like to see in the unikernel 🐪 world 🌎.

This work doesn't use multiple stage compilation (mirage configure && make build), no code is generated, no opam-monorepo (barely maintained, comes with a custom solver, ...), no functors -- instead easily accessible straightforward code.

PS just to be clear, no LLM has been involved for developing any of this. We're enjoying to craft the creative and engineered code ourselves by hand.

robur.coop

Robur - Open Source Software Cooperative

Developing robust, secure and sustainable digital infrastructure in OCaml and MirageOS unikernels.

@hannes@social.coop

crashed in Paris, short sleep then

view on marrakesh train station from the 4th floor, some industrial buildings...
ALT text

view on marrakesh train station from the 4th floor, some industrial buildings...

@kit_ty_kate@mastodon.social · Reply to Kate
@kit_ty_kate@mastodon.social · Reply to Kate
@hannes@social.coop

Let's Camel. Let's

A rectangular ashtray and trashbin in yellow. It is written "Let's Camel" on it.
ALT text

A rectangular ashtray and trashbin in yellow. It is written "Let's Camel" on it.

Same thing from the front with lots of rectangles and the text is "let's 🐪" (a picture of a camel).
ALT text

Same thing from the front with lots of rectangles and the text is "let's 🐪" (a picture of a camel).

@Jose_A_Alonso@mathstodon.xyz
@hannes@social.coop

Thanks to @NGIZero @nlnet, we have funding work on μTCP, our TCP/IP stack for / nlnet.nl/project/microTCP/ .

The longer story is this project I first heard about in 2012 at ICFP in Copenhagen where @peter_sewell_ gave an impressive talk "Tales from the Jungle". I was at that moment doing my PhD on software verification (Coq, separation logic) and it was so nice to see real world stories of verification.

For several reasons (MirageOS melting pot, OCaml-TLS with David Kaloper), I went to Cambridge and worked with Peter on that formal model, read our JFP journal paper cl.cam.ac.uk/~pes20/Netsem/pap .

Then I left academia, and worked in my spare time (finding projects, going through team processes, ...) on the OCaml implementation very slowly. Motivated by @dinosaure and @reynir we deployed it in 2024, and fixed issues. Now we have several months of funded work to push it over the finish line.

Big thanks to everyone involved so we can push this forward. 🎉💕

@hannes@social.coop

Thanks to @NGIZero @nlnet, we have funding work on μTCP, our TCP/IP stack for / nlnet.nl/project/microTCP/ .

The longer story is this project I first heard about in 2012 at ICFP in Copenhagen where @peter_sewell_ gave an impressive talk "Tales from the Jungle". I was at that moment doing my PhD on software verification (Coq, separation logic) and it was so nice to see real world stories of verification.

For several reasons (MirageOS melting pot, OCaml-TLS with David Kaloper), I went to Cambridge and worked with Peter on that formal model, read our JFP journal paper cl.cam.ac.uk/~pes20/Netsem/pap .

Then I left academia, and worked in my spare time (finding projects, going through team processes, ...) on the OCaml implementation very slowly. Motivated by @dinosaure and @reynir we deployed it in 2024, and fixed issues. Now we have several months of funded work to push it over the finish line.

Big thanks to everyone involved so we can push this forward. 🎉💕

@kit_ty_kate@mastodon.social · Reply to Kate

regular SSD users on Linux, macOS and BSDs do also get ~some speedup (4x) but the wait wasn’t that outrageous for a command ran once in a while, to begin with

@kit_ty_kate@mastodon.social
@innocentzero@social.tchncs.de

"If you have used OCaml 5 this will feel familiar, except OCaml keeps its effects out of the types, so you find out about an unhandled one at runtime, in production, on a Friday."

"If you have used Haskell this will also feel familiar, except in Haskell you would be assembling a monad transformer stack, lifting each operation through every layer by hand, and explaining to a junior colleague that a monad is just a monoid in the category of endofunctors, what's the problem."

stephendiehl.com/posts/prism/

stephendiehl.com

Prism: An Impure Functional Language With Typed Effects - Stephen Diehl

Personal blog of Stephen Diehl - Software engineer writing about technology, programming, and the future

@haskman@functional.cafe

Announcing the June !

Our first talk is Type-level Programming in , presented by @abnv!

Like always, meet fellow FP heads, have great conversations, all skill levels welcome!

RSVP hasgeek.com/fpindia/bangalore-

hasgeek.com

Bangalore FP June 2026 meetup

Bangalore FP June 2026 meetup

@dinosaure@mastodon.social

I've finally finished my implementation of SSH for unikernels in . For this example, I've used @reynir project to implement a that offers a chat service (like IRC) via SSH. So now we have an engine for providing a TUI within a unikernel that doesn’t even recognise the concept of a console (thanks to lwd)!

3 terminals, one to launch an unikernel, one other which connects to the unikernel via ssh (with the dinosaure user) and launch the chat and a last one launch another user (foo) and they communicate together!
ALT text

3 terminals, one to launch an unikernel, one other which connects to the unikernel via ssh (with the dinosaure user) and launch the chat and a last one launch another user (foo) and they communicate together!

@innocentzero@social.tchncs.de

I write for work, and + at home. I will absolutely ramble about things I have no idea on :p

loves and , will work on anything and everything low level. I love OS level shit, from the desktop ux to driver stability. I will absolutely ramble about and

I occasionally dabble with functional programming, and will totally not shut up about my mmtk port.

As an aside, avid movie watcher, reader, manga enjoyer, anime enjoyer, and fanfic reader.

Here to have fun and enjoy!

@Jose_A_Alonso@mathstodon.xyz
@hasnep@fosstodon.org

I'd been looking for a modern, statically typed, functional language for years, and after using for about a year, I can say I've found it. Didn't expect it to be a BEAM language though!

Shout out to , the current runner-up language and which I'm looking forward to v0.1 of!

@blank71@fedibird.com
@dinosaure@mastodon.social
@hackuador@functional.cafe
@hackuador@functional.cafe
@hannes@social.coop

We (the response team) ocaml.org/security published today an advisory for the OCaml runtime (Marshal decoding over-read) osv.dev/vulnerability/OSEC-202

I'm happy we managed to coordinate this, turned out to be an excessive amount of work - fixing the runtime, fuzzing, performance testing, but also integrating into osv.dev -- any feedback is highly appreciated, esp. if we're missing out on best practices. Otherwise, please welcome OSEC to your vulnerability databases. We're here to stay. :)

If you like our work, please fund OCSF ocaml-sf.org or apply to our calls for proposals (or both ;) discuss.ocaml.org/t/ocaml-secu

Have a nice evening 😍

discuss.ocaml.org

OCaml security grants

Dear OCaml hackers, we’re pleased to announce that there are grants (up to 100_000 EUR) available for the broad topic of OCaml and security. The main idea is to strengthen the OCaml ecosystem in terms of security - being it tooling, documentation, guides, … Your submitted proposal (until March 1st) will be reviewed by the OCaml security team (OCaml Security). This wouldn’t be possible without the OCSF (https://ocaml-sf.org/) and their sponsors. If you have an idea, please go to CryptPad and s...

@hasnep@fosstodon.org

I'd been looking for a modern, statically typed, functional language for years, and after using for about a year, I can say I've found it. Didn't expect it to be a BEAM language though!

Shout out to , the current runner-up language and which I'm looking forward to v0.1 of!

@haskell@fosstodon.org
@Jose_A_Alonso@mathstodon.xyz
@opencage@en.osm.town

🎉 Two new SDKs to announce for our geocoding API: OCaml and Racket both written by our friend Rome Stone 🙌

Blog post: blog.opencagedata.com/post/oca

and with that we now have more than 40 different SDKs for you to chose from to make your geocoding as simple as possible. See the full list:
opencagedata.com/sdks

Screenshot of the OCaml opencage package
ALT text

Screenshot of the OCaml opencage package

screenshot of the opencage Racket package
ALT text

screenshot of the opencage Racket package

@Jose_A_Alonso@mathstodon.xyz
@Jose_A_Alonso@mathstodon.xyz
@Jose_A_Alonso@mathstodon.xyz
@Jose_A_Alonso@mathstodon.xyz
@Jose_A_Alonso@mathstodon.xyz
@ocaml@mastodon.social
@ocaml@mastodon.social

File descriptors are not integers: There was a flurry of activity on ocaml-multicore/ocaml-uring this month leading to a release (ocaml/opam-repository#28604). ocaml-uring provides bindings to the Linux’s io_uring, which allows batching various syscalls to the kernel for it to execute out-of-order, and in parallel. Its principal use at the moment is for the high-performance Linux backend of Eio. dra27.uk/blog/platform/2025/09

dra27.uk

File descriptors are not integers

There was a flurry of activity on ocaml-multicore/ocaml-uring this month leading to a release (ocaml/opam-repository#28604). ocaml-uring provides bindings to the Linux’s io_uring, which allows batching various syscalls to the kernel for it to execute out-of-order, and in parallel. Its principal use at the moment is for the high-performance Linux backend of Eio.

@ocaml@mastodon.social

OCaml Security Team Established: OCaml Security Response Team Established

There is now a dedicated Security Response Team (SRT) to handle vulnerability reports and coordinate security responses. If you discover a security issue in the OCaml compiler, runtime, standard library, or ecosystem tools, you can report it confidentially to the team.

* Report vulnerabilities: Email security@ocaml.org or use a private GitHub issue for high-impact… ocaml.org/changelog/2025-10-03

@ocaml@mastodon.social

Vulkan graphics in OCaml vs C: I convert my Vulkan test program from C to OCaml and compare the results,
then continue the Vulkan tutorial in OCaml, adding 3D, textures and depth buffering.

Table of Contents

* Introduction

* Running it yourself

* The direct port

* Labelled arguments

* Enums and bit-fields

* Optional fields

* Loading shaders

* Logging

* Error handling

* Refactored version

* Olivine wrappers… roscidus.com/blog/blog/2025/09

@ocaml@mastodon.social

OCaml Weekly News, 16 Sep 2025: * Dune dev meeting
* Dune 3.20
* OCaml compiler office hours? (preparation thread)
* Second beta release of OCaml 5.4.0
* Unicode 17.0.0 update for Uucd, Uucp, Uunf and Uuseg
* Scope Image File Viewer
* OCaml security team
* Testo 0.2.0 - test library with support for snapshots, parallel runs, xfails, timeouts
* tinyfiledialogs bindings
* RFC: ~for...in~ construct
* dead_code_analyzer 1.0.0
* Relocatable… alan.petitepomme.net/cwn/2025.

alan.petitepomme.net

OCaml Weekly News

@ocaml@mastodon.social

Relocatable OCaml - from concept to demo to PRs: If you give vapourware long enough, it condenses into an actual ware! An idea hatched between rehearsing Handel arias in the outskirts of Munich just over six years ago to make running OCaml’s programs a little less surprising is now 132 commits of reality.

Relocatable OCaml started out as a solution to a few thorny problems with the darker corners of OCaml. The somewhat grander fast opam switches… dra27.uk/blog/platform/2025/09

dra27.uk

Relocatable OCaml - from concept to demo to PRs

If you give vapourware long enough, it condenses into an actual ware! An idea hatched between rehearsing Handel arias in the outskirts of Munich just over six years ago to make running OCaml’s programs a little less surprising is now 132 commits of reality.

@ocaml@mastodon.social
@ocaml@mastodon.social

Dynamic Formal Verification in OCaml: An Ortac/QCheck-STM Tutorial: You may have read our recent post discussing our involvement in the Gospel Project. In today's follow-up post, we will focus on Ortac, a tool we have been developing at Tarides as part of the Gospel Project.

What is Ortac?

Ortac aims to give OCaml programmers easy access to dynamic formal verification, also known as specification-driven testing. At its core, it translates… tarides.com/blog/2025-09-10-dy

@ocaml@mastodon.social

Giving hub.cl an upgrade: Giving hub.cl an upgrade

* published

2025-09-07

For a few years now we've been running hub.cl.cam.ac.uk, a Jupyterhub instance, for the first year course "Foundations of Computer Science". It serves as a hosting site for the lecture notes, which come in the form of Jupyter notebooks, and as a playground where students can try OCaml, and it also is used to run the assessed exercises that are a mandatory part… jon.recoil.org/blog/2025/09/gi

jon.recoil.org

blog/2025/09/giving-hub-cl-an-upgrade.mld

@ocaml@mastodon.social

Using ocaml-lsp-server via an MCP server: Using ocaml-lsp-server via an MCP server

* published

2025-08-27

* notanotebook

Here's a quick post on how to get the OCaml Language Server (ocaml-lsp-server) working with an MCP server.

We're going to use issacphi's adapter for LSP servers, which is written in go. So install go, and then:

Once that's done, make sure you've got `ocaml-lsp-server` installed in your switch:

Then add the MCP… jon.recoil.org/blog/2025/08/oc

jon.recoil.org

blog/2025/08/ocaml-lsp-mcp.mld

@ocaml@mastodon.social

Rust for Everyone!: Rust promises to empower everyone to build reliable software, but its unique features create steep learning curves. In this talk, Will Crichton presents four years of research into evidence-based tools that help both novices and experts work more effectively with Rust's complexity, including:
- Ownership visualization: Interactive diagrams showing permissions (read/write/own) that help students understand borrowing better than… youtube.com/watch/R0dP-QR5wQo?

youtube.com

Rust for Everyone!

Rust promises to empower everyone to build reliable software, but its unique features create steep learning curves. In this talk, Will Crichton presents four...

@opencage@en.osm.town

🎉 Two new SDKs to announce for our geocoding API: OCaml and Racket both written by our friend Rome Stone 🙌

Blog post: blog.opencagedata.com/post/oca

and with that we now have more than 40 different SDKs for you to chose from to make your geocoding as simple as possible. See the full list:
opencagedata.com/sdks

Screenshot of the OCaml opencage package
ALT text

Screenshot of the OCaml opencage package

screenshot of the opencage Racket package
ALT text

screenshot of the opencage Racket package

@ocaml@mastodon.social
@ocaml@mastodon.social
@ocaml@mastodon.social

Week 33: Week 33

* published

2025-08-19

* libs

cohttp yojson jsonm

More work this week on the OCaml MCP server. Sadiq and I met before I went away on holiday and discussed the next steps to 'park' the work on the MCP server. The final steps are:

* Write a README
* Write and run a small script to fix a problem with module-type names
* Write up and publish a blog post

Not much, right? As always though, writing things up lead to… jon.recoil.org/blog/2025/08/we

jon.recoil.org

blog/2025/08/week33.mld

@Jose_A_Alonso@mathstodon.xyz
@abnv@fantastic.earth

I've got to learn this "weird French programming language that no other company uses" used by this one company named Jane Street so that no other companies will hire their employees.

Screenshot of a YouTube video that claims that Jane Street uses "a weird French programming language that no other company uses" so that no other companies will hire their employees.
ALT text

Screenshot of a YouTube video that claims that Jane Street uses "a weird French programming language that no other company uses" so that no other companies will hire their employees.

@abnv@fantastic.earth

I've got to learn this "weird French programming language that no other company uses" used by this one company named Jane Street so that no other companies will hire their employees.

Screenshot of a YouTube video that claims that Jane Street uses "a weird French programming language that no other company uses" so that no other companies will hire their employees.
ALT text

Screenshot of a YouTube video that claims that Jane Street uses "a weird French programming language that no other company uses" so that no other companies will hire their employees.

@linux_mclinuxface@fosstodon.org

Is there an community on the Fediverse?

I dipped my toes into the language 6-ish years ago and I'm revisiting it now. The curve then was pretty steep, but now going through the initial tutorial there are only a few giant leaps required.

I can't tell if a) I'm unearthing internalized but lost understanding, b) I've grown used to the concepts through other languages in the meantime or c) the info got better.

@linux_mclinuxface@fosstodon.org

Is there an community on the Fediverse?

I dipped my toes into the language 6-ish years ago and I'm revisiting it now. The curve then was pretty steep, but now going through the initial tutorial there are only a few giant leaps required.

I can't tell if a) I'm unearthing internalized but lost understanding, b) I've grown used to the concepts through other languages in the meantime or c) the info got better.

@ocaml@mastodon.social

OCaml Weekly News, 24 Jun 2025: * Multi-domain, multi-scheduler Lwt
* 15th MirageOS retreat May 13th - 20th
* opam 2.4.0~beta1
* ML Family Workshop 2025: Call for Presentations
* Migrating OCaml.org to Use Dune (Developer Preview)
* Send us Talk and Workshop Proposals for Fun OCaml 2025 in Warsaw, September 15+16
* A Brief Introduction to Normalization-By-Evaluation
* My Second Outreachy Internship's Blog Post
* Other OCaml News alan.petitepomme.net/cwn/2025.

alan.petitepomme.net

OCaml Weekly News

@ocaml@mastodon.social

A hardware description language using OCaml effects: A hardware description language using OCaml effects

This is an idea proposed in 2025 as a Cambridge Computer Science Part III or MPhil project, and is available for being worked on. It may be co-supervised with KC Sivaramakrishnan and Andy Ray.

Programming FPGAs using functional programming languages is a very good fit for
the problem domain. OCaml has the HardCaml ecosystem to
express… anil.recoil.org/ideas/tracing-

anil.recoil.org

A hardware description language using OCaml effects

@ocaml@mastodon.social

A hardware description language using OCaml effects: A hardware description language using OCaml effects

This is an idea proposed in 2025 as a Cambridge Computer Science Part III or MPhil project, and is available for being worked on. It may be co-supervised with KC Sivaramakrishnan and Andy Ray.

Programming FPGAs using functional programming languages is a very good fit for
the problem domain. OCaml has the HardCaml ecosystem to
express… anil.recoil.org/ideas/tracing-

anil.recoil.org

A hardware description language using OCaml effects

@ocaml@mastodon.social

A hardware description language using OCaml effects: A hardware description language using OCaml effects

This is an idea proposed in 2025 as a Cambridge Computer Science Part III or MPhil project, and is available for being worked on. It may be co-supervised with KC Sivaramakrishnan and Andy Ray.

Programming FPGAs using functional programming languages is a very good fit for
the problem domain. OCaml has the HardCaml ecosystem to
express… anil.recoil.org/ideas/tracing-

anil.recoil.org

A hardware description language using OCaml effects

@ocaml@mastodon.social

Tarides at BOB Konferenz 2025: BOB Konferenz is a 10-year-old
conference whose tagline is: "The software development
conference for everyone dissatisfied with the status quo"! Indeed,
BOB is a conference that focusses on a variety of subjects that
strongly converge with the interests of Tarides (and the OCaml world
in general). It aims to cover topics such as functional programming,
"fancy types" (dependent types, gradual typing, linear types, ...),… tarides.com/blog/2025-05-08-ta

@sanityinc@hachyderm.io
@compsci_discussions@mastodon.social
@compsci_discussions@mastodon.social
@ocaml@mastodon.social
@hannesm@mastodon.social
@hongminhee@hollo.social

Just what the internet needed: another attempt to explain ! 🙄 But this time I'm comparing and approaches to show why make all the difference. Turns out those JavaScript Promise analogies only tell half the story…

https://hackers.pub/@hongminhee/2025/monads

hackers.pub

Monads: Beyond Simple Analogies—Reflections on Functional Programming Paradigms

While exploring functional programming languages, I've been reflecting on how different communities approach similar concepts. One pattern that seems particularly fascinating is how Haskell and OCaml communities differ in their embrace of monads as an abstraction tool. The Elegant Power of Monads in Haskell It's common to hear monads explained through analogies to concepts like JavaScript's Promise or jQuery chains. While these comparisons provide an entry point, they might miss what makes monads truly beautiful and powerful in Haskell's ecosystem. The real strength appears to lie in the Monad typeclass itself. This elegant abstraction allows for creating generic functions and types that work with any type that shares the monad property. This seems to offer a profound unification of concepts that might initially appear unrelated: You can write code once that works across many contexts (Maybe, [], IO, State, etc.) Generic functions like sequence, mapM, and others become available across all monadic types The same patterns and mental models apply consistently across different computational contexts For example, a simple conditional function like this works beautifully in any monadic context: whenM :: Monad m => m Bool -> m () -> m () whenM condition action = do result <- condition if result then action else return () Whether dealing with potentially missing values, asynchronous operations, or state transformations, the same function can be employed without modification. There's something genuinely satisfying about this level of abstraction and reuse. OCaml's Different Approach Interestingly, the OCaml community seems less enthusiastic about monads as a primary abstraction tool. This might stem from several factors related to language design: Structural Differences OCaml lacks built-in typeclass support, relying instead on its module system and functors. While powerful in its own right, this approach might not make monad abstractions feel as natural or convenient: (* OCaml monad implementation requires more boilerplate *) module type MONAD = sig type 'a t val return : 'a -> 'a t val bind : 'a t -> ('a -> 'b t) -> 'b t end module OptionMonad : MONAD with type 'a t = 'a option = struct type 'a t = 'a option let return x = Some x let bind m f = match m with | None -> None | Some x -> f x end OCaml also doesn't offer syntactic sugar like Haskell's do notation, which makes monadic code in Haskell considerably more readable and expressive: -- Haskell's elegant do notation userInfo = do name <- getLine age <- readLn return (name, age) Compared to the more verbose OCaml equivalent: let user_info = get_line >>= fun name -> read_ln >>= fun age -> return (name, age) The readability difference becomes even more pronounced in more complex monadic operations. Philosophical Differences Beyond syntax, the languages differ in their fundamental approach to effects: Haskell is purely functional, making monads essential for managing effects in a principled way OCaml permits direct side effects, often making monadic abstractions optional This allows OCaml programmers to write more direct code when appropriate: (* Direct style in OCaml *) let get_user_info () = print_string "Name: "; let name = read_line () in print_string "Age: "; let age = int_of_string (read_line ()) in (name, age) OCaml's approach might favor pragmatism and directness in many cases, with programmers often preferring: Direct use of option and result types Module-level abstractions through functors Continuation-passing style when needed While this directness can be beneficial for immediate readability, it might come at the cost of some of the elegant uniformity that Haskell's monadic approach provides. Reflections on Language Design These differences highlight how programming language design shapes the idioms and patterns that emerge within their communities. Neither approach is objectively superior—they represent different philosophies about abstraction, explicitness, and the role of the type system. Haskell's approach encourages a high level of abstraction and consistency across different computational contexts, which can feel particularly satisfying when working with complex, interconnected systems. There's something intellectually pleasing about solving a problem once and having that solution generalize across many contexts. OCaml often favors more direct solutions that might be easier to reason about locally, though potentially at the cost of less uniformity across the codebase. This approach has its own virtues, particularly for systems where immediate comprehensibility is paramount. After working with both paradigms, I find myself drawn to the consistent abstractions that Haskell's approach provides, while still appreciating the pragmatic clarity that OCaml can offer in certain situations. The typeclasses and syntactic support in Haskell seem to unlock a particularly elegant way of structuring code that, while perhaps requiring a steeper initial learning curve, offers a uniquely satisfying programming experience. What patterns have you noticed in how different programming language communities approach similar problems? And have you found yourself drawn to the elegant abstractions of Haskell or the pragmatic approach of OCaml?

@hongminhee@hackers.pub

While exploring functional programming languages, I've been reflecting on how different communities approach similar concepts. One pattern that seems particularly fascinating is how Haskell and OCaml communities differ in their embrace of monads as an abstraction tool.

The Elegant Power of Monads in Haskell

It's common to hear monads explained through analogies to concepts like JavaScript's Promise or jQuery chains. While these comparisons provide an entry point, they might miss what makes monads truly beautiful and powerful in Haskell's ecosystem.

The real strength appears to lie in the Monad typeclass itself. This elegant abstraction allows for creating generic functions and types that work with any type that shares the monad property. This seems to offer a profound unification of concepts that might initially appear unrelated:

  • You can write code once that works across many contexts (Maybe, [], IO, State, etc.)
  • Generic functions like sequence, mapM, and others become available across all monadic types
  • The same patterns and mental models apply consistently across different computational contexts

For example, a simple conditional function like this works beautifully in any monadic context:

whenM :: Monad m => m Bool -> m () -> m ()
whenM condition action = do
  result <- condition
  if result then action else return ()

Whether dealing with potentially missing values, asynchronous operations, or state transformations, the same function can be employed without modification. There's something genuinely satisfying about this level of abstraction and reuse.

OCaml's Different Approach

Interestingly, the OCaml community seems less enthusiastic about monads as a primary abstraction tool. This might stem from several factors related to language design:

Structural Differences

OCaml lacks built-in typeclass support, relying instead on its module system and functors. While powerful in its own right, this approach might not make monad abstractions feel as natural or convenient:

(* OCaml monad implementation requires more boilerplate *)
module type MONAD = sig
  type 'a t
  val return : 'a -> 'a t
  val bind : 'a t -> ('a -> 'b t) -> 'b t
end

module OptionMonad : MONAD with type 'a t = 'a option = struct
  type 'a t = 'a option
  let return x = Some x
  let bind m f = match m with
    | None -> None
    | Some x -> f x
end

OCaml also doesn't offer syntactic sugar like Haskell's do notation, which makes monadic code in Haskell considerably more readable and expressive:

-- Haskell's elegant do notation
userInfo = do
  name <- getLine
  age <- readLn
  return (name, age)

Compared to the more verbose OCaml equivalent:

let user_info =
  get_line >>= fun name ->
  read_ln >>= fun age ->
  return (name, age)

The readability difference becomes even more pronounced in more complex monadic operations.

Philosophical Differences

Beyond syntax, the languages differ in their fundamental approach to effects:

  • Haskell is purely functional, making monads essential for managing effects in a principled way
  • OCaml permits direct side effects, often making monadic abstractions optional

This allows OCaml programmers to write more direct code when appropriate:

(* Direct style in OCaml *)
let get_user_info () =
  print_string "Name: ";
  let name = read_line () in
  print_string "Age: ";
  let age = int_of_string (read_line ()) in
  (name, age)

OCaml's approach might favor pragmatism and directness in many cases, with programmers often preferring:

  • Direct use of option and result types
  • Module-level abstractions through functors
  • Continuation-passing style when needed

While this directness can be beneficial for immediate readability, it might come at the cost of some of the elegant uniformity that Haskell's monadic approach provides.

Reflections on Language Design

These differences highlight how programming language design shapes the idioms and patterns that emerge within their communities. Neither approach is objectively superior—they represent different philosophies about abstraction, explicitness, and the role of the type system.

Haskell's approach encourages a high level of abstraction and consistency across different computational contexts, which can feel particularly satisfying when working with complex, interconnected systems. There's something intellectually pleasing about solving a problem once and having that solution generalize across many contexts.

OCaml often favors more direct solutions that might be easier to reason about locally, though potentially at the cost of less uniformity across the codebase. This approach has its own virtues, particularly for systems where immediate comprehensibility is paramount.

After working with both paradigms, I find myself drawn to the consistent abstractions that Haskell's approach provides, while still appreciating the pragmatic clarity that OCaml can offer in certain situations. The typeclasses and syntactic support in Haskell seem to unlock a particularly elegant way of structuring code that, while perhaps requiring a steeper initial learning curve, offers a uniquely satisfying programming experience.

What patterns have you noticed in how different programming language communities approach similar problems? And have you found yourself drawn to the elegant abstractions of Haskell or the pragmatic approach of OCaml?

@hongminhee@hollo.social

Just what the internet needed: another attempt to explain ! 🙄 But this time I'm comparing and approaches to show why make all the difference. Turns out those JavaScript Promise analogies only tell half the story…

https://hackers.pub/@hongminhee/2025/monads

hackers.pub

Monads: Beyond Simple Analogies—Reflections on Functional Programming Paradigms

While exploring functional programming languages, I've been reflecting on how different communities approach similar concepts. One pattern that seems particularly fascinating is how Haskell and OCaml communities differ in their embrace of monads as an abstraction tool. The Elegant Power of Monads in Haskell It's common to hear monads explained through analogies to concepts like JavaScript's Promise or jQuery chains. While these comparisons provide an entry point, they might miss what makes monads truly beautiful and powerful in Haskell's ecosystem. The real strength appears to lie in the Monad typeclass itself. This elegant abstraction allows for creating generic functions and types that work with any type that shares the monad property. This seems to offer a profound unification of concepts that might initially appear unrelated: You can write code once that works across many contexts (Maybe, [], IO, State, etc.) Generic functions like sequence, mapM, and others become available across all monadic types The same patterns and mental models apply consistently across different computational contexts For example, a simple conditional function like this works beautifully in any monadic context: whenM :: Monad m => m Bool -> m () -> m () whenM condition action = do result <- condition if result then action else return () Whether dealing with potentially missing values, asynchronous operations, or state transformations, the same function can be employed without modification. There's something genuinely satisfying about this level of abstraction and reuse. OCaml's Different Approach Interestingly, the OCaml community seems less enthusiastic about monads as a primary abstraction tool. This might stem from several factors related to language design: Structural Differences OCaml lacks built-in typeclass support, relying instead on its module system and functors. While powerful in its own right, this approach might not make monad abstractions feel as natural or convenient: (* OCaml monad implementation requires more boilerplate *) module type MONAD = sig type 'a t val return : 'a -> 'a t val bind : 'a t -> ('a -> 'b t) -> 'b t end module OptionMonad : MONAD with type 'a t = 'a option = struct type 'a t = 'a option let return x = Some x let bind m f = match m with | None -> None | Some x -> f x end OCaml also doesn't offer syntactic sugar like Haskell's do notation, which makes monadic code in Haskell considerably more readable and expressive: -- Haskell's elegant do notation userInfo = do name <- getLine age <- readLn return (name, age) Compared to the more verbose OCaml equivalent: let user_info = get_line >>= fun name -> read_ln >>= fun age -> return (name, age) The readability difference becomes even more pronounced in more complex monadic operations. Philosophical Differences Beyond syntax, the languages differ in their fundamental approach to effects: Haskell is purely functional, making monads essential for managing effects in a principled way OCaml permits direct side effects, often making monadic abstractions optional This allows OCaml programmers to write more direct code when appropriate: (* Direct style in OCaml *) let get_user_info () = print_string "Name: "; let name = read_line () in print_string "Age: "; let age = int_of_string (read_line ()) in (name, age) OCaml's approach might favor pragmatism and directness in many cases, with programmers often preferring: Direct use of option and result types Module-level abstractions through functors Continuation-passing style when needed While this directness can be beneficial for immediate readability, it might come at the cost of some of the elegant uniformity that Haskell's monadic approach provides. Reflections on Language Design These differences highlight how programming language design shapes the idioms and patterns that emerge within their communities. Neither approach is objectively superior—they represent different philosophies about abstraction, explicitness, and the role of the type system. Haskell's approach encourages a high level of abstraction and consistency across different computational contexts, which can feel particularly satisfying when working with complex, interconnected systems. There's something intellectually pleasing about solving a problem once and having that solution generalize across many contexts. OCaml often favors more direct solutions that might be easier to reason about locally, though potentially at the cost of less uniformity across the codebase. This approach has its own virtues, particularly for systems where immediate comprehensibility is paramount. After working with both paradigms, I find myself drawn to the consistent abstractions that Haskell's approach provides, while still appreciating the pragmatic clarity that OCaml can offer in certain situations. The typeclasses and syntactic support in Haskell seem to unlock a particularly elegant way of structuring code that, while perhaps requiring a steeper initial learning curve, offers a uniquely satisfying programming experience. What patterns have you noticed in how different programming language communities approach similar problems? And have you found yourself drawn to the elegant abstractions of Haskell or the pragmatic approach of OCaml?

@hongminhee@hackers.pub

While exploring functional programming languages, I've been reflecting on how different communities approach similar concepts. One pattern that seems particularly fascinating is how Haskell and OCaml communities differ in their embrace of monads as an abstraction tool.

The Elegant Power of Monads in Haskell

It's common to hear monads explained through analogies to concepts like JavaScript's Promise or jQuery chains. While these comparisons provide an entry point, they might miss what makes monads truly beautiful and powerful in Haskell's ecosystem.

The real strength appears to lie in the Monad typeclass itself. This elegant abstraction allows for creating generic functions and types that work with any type that shares the monad property. This seems to offer a profound unification of concepts that might initially appear unrelated:

  • You can write code once that works across many contexts (Maybe, [], IO, State, etc.)
  • Generic functions like sequence, mapM, and others become available across all monadic types
  • The same patterns and mental models apply consistently across different computational contexts

For example, a simple conditional function like this works beautifully in any monadic context:

whenM :: Monad m => m Bool -> m () -> m ()
whenM condition action = do
  result <- condition
  if result then action else return ()

Whether dealing with potentially missing values, asynchronous operations, or state transformations, the same function can be employed without modification. There's something genuinely satisfying about this level of abstraction and reuse.

OCaml's Different Approach

Interestingly, the OCaml community seems less enthusiastic about monads as a primary abstraction tool. This might stem from several factors related to language design:

Structural Differences

OCaml lacks built-in typeclass support, relying instead on its module system and functors. While powerful in its own right, this approach might not make monad abstractions feel as natural or convenient:

(* OCaml monad implementation requires more boilerplate *)
module type MONAD = sig
  type 'a t
  val return : 'a -> 'a t
  val bind : 'a t -> ('a -> 'b t) -> 'b t
end

module OptionMonad : MONAD with type 'a t = 'a option = struct
  type 'a t = 'a option
  let return x = Some x
  let bind m f = match m with
    | None -> None
    | Some x -> f x
end

OCaml also doesn't offer syntactic sugar like Haskell's do notation, which makes monadic code in Haskell considerably more readable and expressive:

-- Haskell's elegant do notation
userInfo = do
  name <- getLine
  age <- readLn
  return (name, age)

Compared to the more verbose OCaml equivalent:

let user_info =
  get_line >>= fun name ->
  read_ln >>= fun age ->
  return (name, age)

The readability difference becomes even more pronounced in more complex monadic operations.

Philosophical Differences

Beyond syntax, the languages differ in their fundamental approach to effects:

  • Haskell is purely functional, making monads essential for managing effects in a principled way
  • OCaml permits direct side effects, often making monadic abstractions optional

This allows OCaml programmers to write more direct code when appropriate:

(* Direct style in OCaml *)
let get_user_info () =
  print_string "Name: ";
  let name = read_line () in
  print_string "Age: ";
  let age = int_of_string (read_line ()) in
  (name, age)

OCaml's approach might favor pragmatism and directness in many cases, with programmers often preferring:

  • Direct use of option and result types
  • Module-level abstractions through functors
  • Continuation-passing style when needed

While this directness can be beneficial for immediate readability, it might come at the cost of some of the elegant uniformity that Haskell's monadic approach provides.

Reflections on Language Design

These differences highlight how programming language design shapes the idioms and patterns that emerge within their communities. Neither approach is objectively superior—they represent different philosophies about abstraction, explicitness, and the role of the type system.

Haskell's approach encourages a high level of abstraction and consistency across different computational contexts, which can feel particularly satisfying when working with complex, interconnected systems. There's something intellectually pleasing about solving a problem once and having that solution generalize across many contexts.

OCaml often favors more direct solutions that might be easier to reason about locally, though potentially at the cost of less uniformity across the codebase. This approach has its own virtues, particularly for systems where immediate comprehensibility is paramount.

After working with both paradigms, I find myself drawn to the consistent abstractions that Haskell's approach provides, while still appreciating the pragmatic clarity that OCaml can offer in certain situations. The typeclasses and syntactic support in Haskell seem to unlock a particularly elegant way of structuring code that, while perhaps requiring a steeper initial learning curve, offers a uniquely satisfying programming experience.

What patterns have you noticed in how different programming language communities approach similar problems? And have you found yourself drawn to the elegant abstractions of Haskell or the pragmatic approach of OCaml?

@hongminhee@hollo.social

Just what the internet needed: another attempt to explain ! 🙄 But this time I'm comparing and approaches to show why make all the difference. Turns out those JavaScript Promise analogies only tell half the story…

https://hackers.pub/@hongminhee/2025/monads

hackers.pub

Monads: Beyond Simple Analogies—Reflections on Functional Programming Paradigms

While exploring functional programming languages, I've been reflecting on how different communities approach similar concepts. One pattern that seems particularly fascinating is how Haskell and OCaml communities differ in their embrace of monads as an abstraction tool. The Elegant Power of Monads in Haskell It's common to hear monads explained through analogies to concepts like JavaScript's Promise or jQuery chains. While these comparisons provide an entry point, they might miss what makes monads truly beautiful and powerful in Haskell's ecosystem. The real strength appears to lie in the Monad typeclass itself. This elegant abstraction allows for creating generic functions and types that work with any type that shares the monad property. This seems to offer a profound unification of concepts that might initially appear unrelated: You can write code once that works across many contexts (Maybe, [], IO, State, etc.) Generic functions like sequence, mapM, and others become available across all monadic types The same patterns and mental models apply consistently across different computational contexts For example, a simple conditional function like this works beautifully in any monadic context: whenM :: Monad m => m Bool -> m () -> m () whenM condition action = do result <- condition if result then action else return () Whether dealing with potentially missing values, asynchronous operations, or state transformations, the same function can be employed without modification. There's something genuinely satisfying about this level of abstraction and reuse. OCaml's Different Approach Interestingly, the OCaml community seems less enthusiastic about monads as a primary abstraction tool. This might stem from several factors related to language design: Structural Differences OCaml lacks built-in typeclass support, relying instead on its module system and functors. While powerful in its own right, this approach might not make monad abstractions feel as natural or convenient: (* OCaml monad implementation requires more boilerplate *) module type MONAD = sig type 'a t val return : 'a -> 'a t val bind : 'a t -> ('a -> 'b t) -> 'b t end module OptionMonad : MONAD with type 'a t = 'a option = struct type 'a t = 'a option let return x = Some x let bind m f = match m with | None -> None | Some x -> f x end OCaml also doesn't offer syntactic sugar like Haskell's do notation, which makes monadic code in Haskell considerably more readable and expressive: -- Haskell's elegant do notation userInfo = do name <- getLine age <- readLn return (name, age) Compared to the more verbose OCaml equivalent: let user_info = get_line >>= fun name -> read_ln >>= fun age -> return (name, age) The readability difference becomes even more pronounced in more complex monadic operations. Philosophical Differences Beyond syntax, the languages differ in their fundamental approach to effects: Haskell is purely functional, making monads essential for managing effects in a principled way OCaml permits direct side effects, often making monadic abstractions optional This allows OCaml programmers to write more direct code when appropriate: (* Direct style in OCaml *) let get_user_info () = print_string "Name: "; let name = read_line () in print_string "Age: "; let age = int_of_string (read_line ()) in (name, age) OCaml's approach might favor pragmatism and directness in many cases, with programmers often preferring: Direct use of option and result types Module-level abstractions through functors Continuation-passing style when needed While this directness can be beneficial for immediate readability, it might come at the cost of some of the elegant uniformity that Haskell's monadic approach provides. Reflections on Language Design These differences highlight how programming language design shapes the idioms and patterns that emerge within their communities. Neither approach is objectively superior—they represent different philosophies about abstraction, explicitness, and the role of the type system. Haskell's approach encourages a high level of abstraction and consistency across different computational contexts, which can feel particularly satisfying when working with complex, interconnected systems. There's something intellectually pleasing about solving a problem once and having that solution generalize across many contexts. OCaml often favors more direct solutions that might be easier to reason about locally, though potentially at the cost of less uniformity across the codebase. This approach has its own virtues, particularly for systems where immediate comprehensibility is paramount. After working with both paradigms, I find myself drawn to the consistent abstractions that Haskell's approach provides, while still appreciating the pragmatic clarity that OCaml can offer in certain situations. The typeclasses and syntactic support in Haskell seem to unlock a particularly elegant way of structuring code that, while perhaps requiring a steeper initial learning curve, offers a uniquely satisfying programming experience. What patterns have you noticed in how different programming language communities approach similar problems? And have you found yourself drawn to the elegant abstractions of Haskell or the pragmatic approach of OCaml?

@hongminhee@hackers.pub

While exploring functional programming languages, I've been reflecting on how different communities approach similar concepts. One pattern that seems particularly fascinating is how Haskell and OCaml communities differ in their embrace of monads as an abstraction tool.

The Elegant Power of Monads in Haskell

It's common to hear monads explained through analogies to concepts like JavaScript's Promise or jQuery chains. While these comparisons provide an entry point, they might miss what makes monads truly beautiful and powerful in Haskell's ecosystem.

The real strength appears to lie in the Monad typeclass itself. This elegant abstraction allows for creating generic functions and types that work with any type that shares the monad property. This seems to offer a profound unification of concepts that might initially appear unrelated:

  • You can write code once that works across many contexts (Maybe, [], IO, State, etc.)
  • Generic functions like sequence, mapM, and others become available across all monadic types
  • The same patterns and mental models apply consistently across different computational contexts

For example, a simple conditional function like this works beautifully in any monadic context:

whenM :: Monad m => m Bool -> m () -> m ()
whenM condition action = do
  result <- condition
  if result then action else return ()

Whether dealing with potentially missing values, asynchronous operations, or state transformations, the same function can be employed without modification. There's something genuinely satisfying about this level of abstraction and reuse.

OCaml's Different Approach

Interestingly, the OCaml community seems less enthusiastic about monads as a primary abstraction tool. This might stem from several factors related to language design:

Structural Differences

OCaml lacks built-in typeclass support, relying instead on its module system and functors. While powerful in its own right, this approach might not make monad abstractions feel as natural or convenient:

(* OCaml monad implementation requires more boilerplate *)
module type MONAD = sig
  type 'a t
  val return : 'a -> 'a t
  val bind : 'a t -> ('a -> 'b t) -> 'b t
end

module OptionMonad : MONAD with type 'a t = 'a option = struct
  type 'a t = 'a option
  let return x = Some x
  let bind m f = match m with
    | None -> None
    | Some x -> f x
end

OCaml also doesn't offer syntactic sugar like Haskell's do notation, which makes monadic code in Haskell considerably more readable and expressive:

-- Haskell's elegant do notation
userInfo = do
  name <- getLine
  age <- readLn
  return (name, age)

Compared to the more verbose OCaml equivalent:

let user_info =
  get_line >>= fun name ->
  read_ln >>= fun age ->
  return (name, age)

The readability difference becomes even more pronounced in more complex monadic operations.

Philosophical Differences

Beyond syntax, the languages differ in their fundamental approach to effects:

  • Haskell is purely functional, making monads essential for managing effects in a principled way
  • OCaml permits direct side effects, often making monadic abstractions optional

This allows OCaml programmers to write more direct code when appropriate:

(* Direct style in OCaml *)
let get_user_info () =
  print_string "Name: ";
  let name = read_line () in
  print_string "Age: ";
  let age = int_of_string (read_line ()) in
  (name, age)

OCaml's approach might favor pragmatism and directness in many cases, with programmers often preferring:

  • Direct use of option and result types
  • Module-level abstractions through functors
  • Continuation-passing style when needed

While this directness can be beneficial for immediate readability, it might come at the cost of some of the elegant uniformity that Haskell's monadic approach provides.

Reflections on Language Design

These differences highlight how programming language design shapes the idioms and patterns that emerge within their communities. Neither approach is objectively superior—they represent different philosophies about abstraction, explicitness, and the role of the type system.

Haskell's approach encourages a high level of abstraction and consistency across different computational contexts, which can feel particularly satisfying when working with complex, interconnected systems. There's something intellectually pleasing about solving a problem once and having that solution generalize across many contexts.

OCaml often favors more direct solutions that might be easier to reason about locally, though potentially at the cost of less uniformity across the codebase. This approach has its own virtues, particularly for systems where immediate comprehensibility is paramount.

After working with both paradigms, I find myself drawn to the consistent abstractions that Haskell's approach provides, while still appreciating the pragmatic clarity that OCaml can offer in certain situations. The typeclasses and syntactic support in Haskell seem to unlock a particularly elegant way of structuring code that, while perhaps requiring a steeper initial learning curve, offers a uniquely satisfying programming experience.

What patterns have you noticed in how different programming language communities approach similar problems? And have you found yourself drawn to the elegant abstractions of Haskell or the pragmatic approach of OCaml?

@Jose_A_Alonso@mathstodon.xyz
@Jose_A_Alonso@mathstodon.xyz
@soupglasses@hachyderm.io

Heyo!

My name is Sofie, and I love building things so it is nicer and easier to use!

I touch on subjects such as , , and how to generally make your life easier running servers.

I also love trying out a lot of different programming languages, big ones being , , and right now!

My current pet project is github.com/imsofi/phenix

In my free time I also enjoy and .

Good to see you! :ablobfoxbongo:

@AssertionError@types.pl

Hi types.pl,

I am a computer scientist interested in , concurrency theory applied to parallel systems.

My main research project deals with verifying safety and performance properties of kernels.

I write code for research mainly in and .

I am passionate about teaching. I am currently using Racket to teach functional programming and Coq to teach Intro to Theory of Computation.

I use this to share my own research findings, papers I like, and software that I find fun.

PS: I just migrated from mathstodon.xyz and I think I lost my posts.

@sbr@hachyderm.io

Heya folks! 👋

My name is Sophia, I work as a software developer in Germany.

This is my account, so I'll focus on , command-line tools, , front-end .
Other accounts 👉 please see my bio.

I love to try out different programming languages like , , , , , etc.

In my free time I enjoy reading, playing pen & paper RPGs or learning new languages like .

@league@scholar.social

Reactivating — Hello! I’m into:
• Functional programming, especially , , ,
• Proof systems & software correctness tools , , ,
• Scientific data acquisition & analysis, frameworks
• Reproducible builds, ,
• Non-traditional families (, interracial)
• strategies & other perspectives
• Black natural hair care, for Ms. 7yo
• & electronic music, dabbling at piano as a busy adult

@yomimono@wandering.shop

> ./masto.sh
>>> Welcome back to Mastodon!
>>> You are [yomimono]. You are in some sort of wandering shop.
>>> Behind you is a weirder earth (closed), just beyond which is a famous town of witches (also closed).

> inventory

>>> You have:
>>> a computer
>>> regrets

> order coffee

>>> ☕

> program computer

>>> You make a in using .

> program computer

>>> You work on a ! it involves and .

> look cat

>>> which ?

> ALL