Live data from Hacker News

OCaml as my primary language

xvw.lol

201–210 of 296 posts

Re: OCaml as my primary language

#201

> At present, I don’t know anyone who has seriously used languages like OCaml or Haskell and was happy to return to languages with less sophisticated type systems (though an interesting project can sometimes justify such a technological regression). Recovered typeaholic here. I still occasionally use OCaml and I primarily wrote F# and Haskell for years. I've been quite deep down the typing rabbit hole, and I used to…

> Now I love dynamic typing - but not the Python kind - I prefer the Scheme kind - latent typing.

Could you elaborate on the difference? I was under the impression that "latent typing" just means "values, not variables, have types", which would make Python (without type annotations) latently typed as well.

Re: OCaml as my primary language

#202
post #45
post #29

Earlier quoted context omitted.

That was my optimistic take before I started working on a large Haskell code base. Aside from the obvious problem that there's not enough FP in the training corpus, it seems like terser languages don't work all that well with LLMs. My guess is that verbosity actually helps the generation self-correct... if it predicts some "bad" tokens it can pivot more easily and still produce working code.

> terser languages don't work all that well with LLMs I’d believe that, but I haven’t tried enough yet. It seems to be doing quite well with jq. I wonder how its APL fares. When Claude generates Haskell code, I constantly want to reduce it. Doing that is a very mechanical process; I wonder if giving an agent a linter would give better results than overloading it all to the LLM.

Can't you just run HLint on it?

Re: OCaml as my primary language

#203

Do they have a decent GUI library / binding yet?

OCaml does not have what you'd call I fully featured GUI framework to my knowledge (besides rendering webpages).

F# has FuncUI - based on Avalonia. All just possible because of the ecosystem.

https://github.com/fsprojects/Avalonia.FuncUI

Re: OCaml as my primary language

#204

Earlier quoted context omitted.

Wouldn’t Kotlin be a more reasonable choice in that case? It has ADTs and a lot of the same niceties of Rust.

Garbage collector in Kotlin makes it a no go for C or C++ displacement.

As someone that has left pure C++ applications in 2006, and has mostly written mixed language projects since 1999, usually the displacement is more religious than anything else.

In many use cases even if the performance is within the project delivery deadlines there will worthless discussions about performance benchmarks completly irrelevant to the task at hand.

And ironically many of the same folks are using Electron based apps for their workflows.

Re: OCaml as my primary language

#205
post #176

I saw a talk by someone from Google about their experiences using Rust in the Android team. Two points stuck out: they migrated many projects from Python, so performance can't have been that much of a concern, and in their surveys the features people liked most were basics like pattern matching and ADTs. My conclusion is that for a lot of tasks the benefit from Rust came from ML cicra 1990, not lifetimes etc. I feel…

The issue regarding academia is that functional programming is treated as an afterthought/sideshow that is mainly of interest for research. Almost no-one is teaching FP concepts to undergrads.

I can assure you that wasn't the case on my degree, if anything almost every lecture had its own programming language.

Maybe I got lucky being in one of the most relevant universities in Portugal, however I can tell that others in the country strive for similar quality for their graduates, even almost 40 years later.

Re: OCaml as my primary language

#206

I saw a talk by someone from Google about their experiences using Rust in the Android team. Two points stuck out: they migrated many projects from Python, so performance can't have been that much of a concern, and in their surveys the features people liked most were basics like pattern matching and ADTs. My conclusion is that for a lot of tasks the benefit from Rust came from ML cicra 1990, not lifetimes etc. I feel…

> I feel if OCaml had got its act together around about 2010 with multicore and a few other annoyances[1]

OCaml had its act together. It was significantly nicer than Python when I used it professionally in 2010. Just look at what JaneStreet achieved with it.

The main impediment to OCaml was always that it was not American nor mainly developed from the US.

People like to believe there is some technical merit to language popularity but the reality it’s all fashion based. Rust is popular because they did a ton of outreach. They used to pay someone full time to mostly toot their horn.

Re: OCaml as my primary language

#207

Do they have a decent GUI library / binding yet?

OCaml does not have what you'd call I fully featured GUI framework to my knowledge (besides rendering webpages). F# has FuncUI - based on Avalonia. All just possible because of the ecosystem. https://github.com/fsprojects/Avalonia.FuncUI

I'm kind of surprised though because a lot of languages have a Qt binding. Implementing this is only a small investment for a relatively big gain.

Re: OCaml as my primary language

#208

OCaml is a great language without great tooling. Desperately needs a good LSP implementation to run breakpoints and other debugging tools on VSCode or other LSP-aware IDEs. I know there ARE tools available but there isn't great support for them and they don't work well

LSP isn't the protocol that interfaces with debuggers, that'd be DAP. You're right that OCaml debugging is kinda clunky at the moment. OCaml does have an okay LSP implementation though, and it's getting better; certainly more stable than F#'s in my experience, since that comparison is coming up a lot in this comment section.

What’s clunky about the Ocaml debugger?

Ocaml has been shipping with an actual fully functional reverse debugger for ages.

Is the issue mostly integration with the debugging ui of VS Code?

Re: OCaml as my primary language

#209

I saw a talk by someone from Google about their experiences using Rust in the Android team. Two points stuck out: they migrated many projects from Python, so performance can't have been that much of a concern, and in their surveys the features people liked most were basics like pattern matching and ADTs. My conclusion is that for a lot of tasks the benefit from Rust came from ML cicra 1990, not lifetimes etc. I feel…

"I feel if OCaml had got its act together ..." The great thing is we have choice. We have a huge number of ways to express ideas and ... do them! I might draw a parallel with the number of spoken languages extent in the UK (only ~65M people). You are probably familiar with English. There are rather a lot more languages here. Irish, Scottish, Welsh - these are the thriving Brythonic languages (and they probably have s…

It's weird to see someone from the UK champion the Irish language as a choice as if they didn't try to systematically wipe it from the face of the earth for quite a long period of time.

Choice is good of course so do keep up the good work.

Re: OCaml as my primary language

#210
post #186

Earlier quoted context omitted.

Yes. It can also be compiled to native. I just think it was held back too much by the java/jvm backwards compatibility but then again that's probably also the justification for its existence. I definitely find it (and jetpack compose) make developing android apps a much better experience than it used to be. What I like a lot about Kotlin are its well written documentation and the trailing lambdas feature. That is def…

Java is castrated on purpose on Android as means to sell Kotlin. If that wasn't the case, Google would support Java latest with all features, alongside Kotlin, and let the best win. See how much market update Kotlin has outside Android, when it isn't being pushed and needs to compete against Java vLatest on equal terms.

Blame Oracle. If they had been more forward looking and a bit less greedy, Java vLatest would be the default language on Android.
Post reply on HN