Expanding ocaml appeal to future open source application developers

I want to build services and software running unmodified for decades. OCaml seems promising here where other options become sparse.

Choose the right tool for the job and not every tool has to be alike. They may differ. Even better if they do.

1 Like

Since this is a loose thread I’ll just tell a little semi-OT anecdote.

I think we all get the importance of libraries :–)

But what people never seem to mention is the quality of the libraries in these “batteries included” languages. Each time I reach for them I end up being disappointed by the very low power they provide – this is anecdotic of course, I’m sure there’s good software written there as well, I likely just got unlucky.

So here’s the story. Last year I needed to devise under time pressure a pipeline to produce static IIIF images (a format to serve high resolution image on the web).

So I reach for an off-the-shelf solution, lose a couple of hours (3 according to my timesheet) searching the web for something decent until I find some python code based on the PIL python library that does that. I run the software and it takes something like 9 (!) hours to produce the image with tiles of a very dubious photographic quality. The knobs to improve or tweak the results are far from being obvious and anyways the time of production was a no go. Especially since we had to experiment with the results.

So in the end I dive into the spec and produce after seven hours and a half a 150 loc OCaml program that shells out (:grimacing: I know I know) to imagemagick and produces the desired file hierarchy in about 1min with all the control over quality we need (compression, color profiles etc.).

Sometimes the batteries are closer than we think :–)

16 Likes

So because you have those goals does it mean that I can not use for my purpose? As far as I know OCaml is a general purpose language, not a DSL for whatever niche usage.
The only reason I was not able to use ocaml was the lack of libraries, not because it was not possible or it would not allow me to do equally quick.
I guess you love reinventing the wheel on every project of yours and have one or two at most on a lifetime.

1 Like

Bear with me if I speak for myself and my goals which may be different from yours. That’s variety best served by different tools. Sure you can use OCaml, why shouldn’t you. But no community is responsible providing a library in the language of your choice and your purpose for you.

But why don’t you want to use node in the first place if it solves your problem at hand? What’s your problem with node? Use OCaml where it shines and for the properties it has. IMO it need not excel at throwaway sprints. If it does what others cannot, it may fall behind with what others can. Do you know what I mean mentioning mirage and TCB?

1 Like

I did, in my message that you replied to.

It’s not your exact wording but it’s the end result that matters. This was my exact point–you are very fixated that it should not be too ‘attractive’ for ‘everybody’. Everybody? OCaml has been struggling to attract a community for a long time now, and meanwhile language communities have zipped past us and shown us how to do it right. I’m not even talking about Rust–look at Elixir for a great example of how to build up a community and ecosystem, by caring about developer joy. Or even look at F#–it’s what people compare OCaml to, after all!

I mean things like this:

And by the way, these are super-smart people, but their goal is not to learn the intricacies of package managers, build systems, and their interactions. Their goal is to get their work done. Even they can only do so much!

7 Likes

that’s insulting, right? Fixation is a mental disorder you label me with.

The second is a tautology, being too X is always a bad thing, isn’t it? Even being too nice. The quotes ridicule them. Please sport friendlyness and precision in discussion.

A last thing: if super-smart people demand empathy without having contributed a thing I’m not impressed. No matter how large their companies and numerous their followers may be. However, I am impressed by 25 years of OCaml or Is rescript damaging Ocaml ecosystem? - #27 by mars0i.

1 Like

If we come to think of OCaml as a product and users as customers, then we will be locked in a struggle for market dominance and we will try to compete with other languages. I think this would lead us to fall into the same trap that is driving all the structures in our civilization towards the deadly embrace of addiction to exponential growth.

Instead, I hope we will think of OCaml as an ecosystem. Then we’ll aim to maintain its current health and sustainability, and protect the diversity and life that is already at home here. But we will also strive to provide more fertile grounds for diversity (which entails diversity of uses and users and, principle among many other things, concern with accessibility, in the sense of empowering those with relative disability). We should also look to build mutualistic systems of exchange with other ecosystems. But above all, I think this calls for maintaining healthy (and kind) relationships between the various people and organizations within the ecosystem. I think this is what allows new entrants to the ecosystem to find a safe place to take root.

I believe that the best thing we can do to expand the appeal of OCaml in a way that is healthy and sustainable is to continue to nurture, cultivate, and protect the ecosystem. This should definitely entail being compassionate and responsive to the difficulties people face! People who are in this ecosystem, or who want to be, obviously encounter issues with documentation, familiarity of tooling, etc. But we can justify and motivate the repair and improvement on this front without orienting everything to the aim of scaling up or improving our marketing.

This is enough: People need help. Let’s see what we can do to help them!

I hope this is a path we can all agree on :camel: :green_heart:

16 Likes

I am not labelling you with a mental disorder. The word also has the meaning ‘focused on a specific topic’.

The quotes indicate that they are quoted verbatim.

Anyway, I see we have reached the stage where every single word is being examined and nitpicked for ‘precision’ (use of the word ‘too’), while ignoring the actual relevant issues. I agree with Shon, it is time to end this discussion.

There is an interesting catch-22 here: one will only use the language to write libraries if it already has the libraries they want written :wink:

Totally agree except for one thing:
I don’t care about merlin

Use merlin.
It’s the best editor in the ENTIRE GALAXY.
Damn it…

2 Likes

There are libraries and then there are libraries. For problems requiring enough domain expertise the effort to create and maintain a high quality library can be comparable to a programming language and it is no coincidence that they often and/or only exist as C/C++. If I were to write one I would like the greatest number of people to benefit from the effort as well. Well OCaml is as good as any other language to leverage C/C++ libraries. Then there are problems like “read the whole text file into a string” that do not make into the Stdlib but are easily solvable (with the first attempt being correct thanks to the type system). It is the in-between that could benefit from more users. Even an abandoned/unmaintained effort at solving something can be educational for a new entrant. And more users lead to more such attempts. But I think it is unrealistic to expect quality documentation in these cases. Instead what if we have tools that make reading source code easier? Source code analysis/transformation is what OCaml excels at, after all. Can we make it even more accessible? Like provide a Merlin like experience directly off the opam repository: you can browse the code off the web with tooltips showing you type annotation everywhere and let you jump to definition/declaration (even across projects!). All the information are already there in the builds. We just need a good interface. This is something that everyone could benefit from, not just new developers.

As an example of what I am getting at I did something for the OCaml compiler here. It is basic and incomplete but it is already helpful to my effort of trying to understand the compiler better. I think it is more profitable to work with human nature. Even the compiler has many un(der)documented features. At the same time it is the most hackable/accessible compiler anywhere. Let’s use the strength to benefit ourselves.

2 Likes

This is a very good explanation about the libraries problem and some good examples of interesting things to do.

Answering @shonfeder, I think the libraries (from my JS dev point of view) is something that easily grows exponentially. The more low level libraries you have the easier is to build greater abstractions on top of that and then on top of that. If I had a good Gzip library and a good XML parsing library, then creating a KMZ library will not be a lifelong task compared with having to write code to read compresses files

If I had a good Gzip library and a good XML parsing library, then creating a KMZ library will not be a lifelong task compared with having to write code to read compresses files

???
gzip:

xml:

2 Likes

Let’s be fair. Depending on what you need to do (e.g. quick and dirty data extraction) xmlm is a pain to use.

2 Likes

Do we have anything that is quick and dirty for xml?

Haven’t used it, but GitHub - aantron/markup.ml: Error-recovering streaming HTML5 and XML parsers looks nice.

Cheers,
Nicolas

1 Like

There’s also xml-light.

Don’t use xml-light. It’s not a compliant parser.

I’ve recently used ezxmlm as an easier to use wrapper built on top of Xmlm and was quite happy with it.

3 Likes

Currently using markup.ml. Would not call it quick and dirty. Don’t think “streaming parsers” and “quick and dirty” go together.

3 Likes