14 ms·
Leaving OCaml
- ukd1 6y agoI had very similar problems with Crystal early on; I remember having to write my own S3 library, which meant having to write the signing, which meant having to patch the core OpenSSL lib to add the correct SHA. At that point, I realized it was "early". Things change though, excited to see where you end up Paul - not Rust?
- vbordo 6y agoDid you end up using Crystal in production?
- ukd1 6y agoWe do, but only for a few smaller services. It's great, but most of the things we do aren't CPU bound, so we use Ruby. Personally, it's become my default for side projects.
- natchy 6y agoNot OP but I've used Crystal in production at 3 companies: Qualtrics, InVision, and my own side-company (~40 employees) which I briefly mention in this podcast[0] from a few months ago. Been using Crystal for about 5 years. [0]: https://www.indiehackers.com/podcast/166-sam-eaton-of-crave-cookie https://www.indiehackers.com/podcast/166-sam-eaton-of-crave-...
- anonu 6y agoThe first negative sentiment OCaml post on HN that I see. Nice to see some perspective every now and then.
- snazz 6y agoContent on HN about the holy trinity of programming languages, text editors, and operating systems generally favors less popular options with more mystique. Anything about Java is probably going to be largely neutral or negative, while a piece on Common Lisp might be much more positive, even though Java is a far more successful programming language in most ways. I don't think that this bias is a bad thing. It's nice to read about cool technologies that you might not use in your day job. But anyone using HN to decide on the right tool for a project should carefully consider other sources of information as well.
- AnimalMuppet 6y agoAssume for the moment that all languages are equal. (They aren't, but ignore that for the moment.) If you say something good about Java, there are a lot of people here who have used Java, and some of them have bad impressions that they came to through some pain. But if you say that Common Lisp is great, there are fewer people who have really used it, so fewer people who have used it and didn't like it. And since fewer people got into it unless they really wanted to, it's easier to say "You didn't really understand it, then, or you would have liked it." The number of people who can say "No, I really got it, and I still didn't like it" is relatively small. So far, that's just demographics. But then you get into the language itself. Java isn't an exciting language. It's not fun. It's kind of corporate and bland. There aren't many people who are really enthusiastic about Java - nor does Java give them reason to be.
- didibus 6y agoThat's true, I also think Java is most people's job, and your job is never as exciting as your side project. That said, I am quite excited about Java and maybe especially advancements in the JVM even though part of my job is in Java. GraalVM is doing some amazing things with polyglot support and native compilation. Java's project Loom is trying to bring fibers in a really nice way to the language. It is slowly working on bringing value types and inline types as well. And it's got a few cool GCs being experimented on, as well as a nice foreign memory API. Java recently got really nice improvements, multi-line strings, text blocks, local type inference, a shell, running code from source scripts and switch expressions.
- brown9-2 6y ago> We've built our own queue on top of our database rather than using the production-quality cloud queues available on GCP Cloud Pubsub has HTTP and gRPC APIs, wonder why they didn’t use those? https://cloud.google.com/pubsub/docs/apis https://cloud.google.com/pubsub/docs/apis
- pbiggar 6y ago> When you're searching for product-market fit, you do the simplest, easiest thing. If you lack a good SDK for your cloud provider, the simplest, easiest thing is often a terrible architectural choice.
- robertlagrant 6y ago> Cloud Pubsub has HTTP and gRPC APIs
- dj_mc_merlin 6y ago> When you're searching for product-market fit, you do the simplest, easiest thing. If you lack a good SDK for your cloud provider, the simplest, easiest thing is often a terrible architectural choice. I understand his point here. Spending week(s) writing a good SDK is hard to justify, but if you're building new infrastructure to support a project in a more obscure language, you kinda have to sacrifice time building said infrastructure well. When Naughty Dog programmed their games in GOOL/GOAL they built their own compilers, debuggers etc. - not a trivial task.
- zeckalpha 6y agoThey are already writing their own compiler anyway, albeit with a limited focus (initially). Perhaps they’ll eventually get Dark on Dark.
- andendau 6y agoI loved the ML based emphasis. I'm a big fan of f# unfortunately as the article details .net has a shadow of the libraries that Java has. Clojure and Scala have much broader access to popular libraries. I've found most developers are ok with the hum drum c based languages thus c#, java, golang are good enough for most people with no interest to jump the chasm to an ML inspired language.
- gameswithgo 6y agoWhile it is true that .NET has less libraries than the JVM ecosystem, I'm not sure it remains sensible to still call it "a shadow of". In certain domains the .NET ecosystem is better. Either way, if a team was almost able to put up with the OCaml ecosystem, I believe the .NET ecosystem would be no problem at all.
- darksaints 6y agoSo...I think a decent choice to make here is to switch from OCaml to F#. You'll get almost all of the benefits and most of the drawbacks go away. And for the most part, you can directly translate the code from OCaml to F#. The big reason to not use F# vs OCaml tends to come down to the lack of functors... but it looks like your current codebase might not be using them much.
- Nuzzerino 6y ago> The big reason to not use F# vs OCaml tends to come down to the lack of functors... What do you mean by that? F# has support for functors, or are you referring to something else? https://fsprojects.github.io/FSharpPlus/applicative-functors.html https://fsprojects.github.io/FSharpPlus/applicative-functors...
- darksaints 6y agoThose are an implementation of functors as they exist in Haskell. The functors I'm talking about are actually a language level construct that is a primary abstraction mechanism in OCaml/SML. They are essentially higher-level modules: modules that are parameterized by other modules. https://stackoverflow.com/a/16353711 https://stackoverflow.com/a/16353711
- pmoriarty 6y agoCan someone explain to me like I'm 5 what the big deal about functors is?
- darksaints 6y agoProbably not, as it is a very abstract generalization for what is essentially a simple concept that for most purposes doesn't need a math-y abstraction. And it would depend on whether you're talking about Haskell, or OCaml, or Category theory. The best I could describe the general concept is that a functor allows you to take something of some type and maps it to another type via some unspecified function.
- k__ 6y ago"OCaml folks talk about Fancy Type System problems, instead of how to actually build products and applications" I had the impression that's a general problem with FP.
- dimitrios1 6y agoSave for Erlang and Elixir, this tends to be the case with ML-family FP languages, not so much with LISPs, in my opinion of course.
- wilsonthewhale 6y agoagreed. Clojure is probably the most pragmatic FP language in the space.
- nautilus12 6y agoThe problem is there is no middle ground. FP people forget about the product because of FP. Alot of non-FP people forget also forget about their product because their are swamped with unecessary maintanence. There is a middle road in there somewhere where you use just enough FP to avoid the problems you would face without it, without getting totally sucked into making it perfectly consistent.
- fulafel 6y agoFrom my experience in Clojure projects and watching Erlang/Elixir projects, it's not like this at all in those cultures.
- giantDinosaur 6y agoMostly due to interest in FP being driven by intrinsic desire to use it, since it's so rare in enterprise. Anyway, a lot of that discussion filters down into more popular languages, so it's pretty incorrect to think of it as all academic junk or something.
- deleted 6y ago[deleted]
- jitl 6y agoIt was interesting to hear that the Ocaml community has something of that “talking about category theory and functors” vibe that Haskell has. The Haskell posts/community vibe that I see is very heavy on the “ideas of computing research” and I’ve always thought Ocaml was a more “get things done” language because I only ever really hear about it from JaneStreet or ReasonML angle which is very much on the side of “get things done”. That’s a pity.
- darksaints 6y agoActually I think there is a distinction to be made. Both Haskell and OCaml are strongly typed ML-family languages, and to some extent you'll find some overlap in community interests, trending toward the academic side. But Haskell tends to be used more for type theory research, whereas OCaml is far more popular for programming language research due to its popularity for writing compilers. While I don't have internal insight to Jane Street, some of their talks and public information seems to support the idea that they are actually doing a lot of similar work to compiler development. They have stated that they tend to do a lot of symbolic logic and analysis, and they make it sound like they create DSLs that traders can more easily use to convey trading strategies. So OCaml does really well at getting things done, but historically it has been within very narrow definition of the types of things to be done.
- yminsky 6y agoUnderstandable how you'd get that impression, but it's off the mark. We do lots of "ordinary" programming that looks nothing like waiting a compiler. Data analysis, high performance packet processing, log analysis, UI work, you name it. We use OCaml as a general purpose tool, and it really excels in that role.
- pbiggar 6y agoI think the disconnect here is that for much of the world these days, "ordinary" programming is a backend for a web or mobile app, using REST (or maybe GraphQL if you're avant garde). I'm sure Jane Street does lots of web stuff too, but I haven't see a bunch of Core libraries to do, for example, a CRUD app on Postgres in the cloud somewhere.
- server_bot 6y agoA mature take, I applaud the author for overcoming "commitment bias" and being willing to make a change. The lack of a cloud SDK for thier provider seems crippling in hindsight. Wish them well with whatever the replacement language becomes!
- keeganpoppen 6y agohuh this is all extremely relevant information to me, as someone who has always been more on the "use the cool language on the marginal side of the fence" side, and i can't wait to see what the next step for this project will be. i know that the project itself has hit some headwinds, but i gotta say i have actually played around with dark quite a lot and i really, really enjoyed it. so i very much look forward to what's coming next (especially if it makes it easier for me to hook dark stuff into my own systems more directly-- the kinds of hacks i underwent (ssh port forwarding and the like)... don't quite cut it for stuff any fancier than what i've already written).
- galaxyLogic 6y agoI find it curious that this kind of thing still happens "oh we wrote it in the wrong language". Shouldn't every mainstream language by now be good enough to build most (if not all) applications?
- xeeeeeeeeeeenu 6y agoMost languages are good enough, but they rarely have good enough ecosystems.
- galaxyLogic 6y agoI think that's a great criterion to use when choosing a language
- gameswithgo 6y agoProbably yes, but OCaml isn't mainstream.
- gleenn 6y agoThe author stated many reasons this just wasn't the case. Lots of missing libraries to common services or libraries that weren't mature enough like the saddeningly reported Postges driver. That seems particularly damning, if I can't reasonably access one of the most popular and general purpose DBs then how am I going to expect a litany of other software I might want to use and expect after having worked with Java or Ruby or Puthon. Personally this drives me to Clojure more, which they said they used at CircleCI and had success with given it's interoperability with the large Java ecosystem. That meshes well with my experience too.
- dwohnitmok 6y agoIt's perhaps worth pointing out that the author of this blog post explicitly decided against using Clojure a second time for Dark after cofounding CircleCI, mainly due to a lack of sum types.
- 6y ago
- dudul 6y agoWhile I agree with most of the points, the conclusion sounds kind of dishonest. "the best choice of those we had at the time." really? Despite the lack of libraries? of tooling? of multi-core support? If you needed a strong, staticly-typed language why not Scala? Why not Haskell? They have multicore support, a lot of libraries and good tools. While the author is honest about the shortcomings of the language they pick, they don't fully own what looks like a bad choice.
- pbiggar 6y agoOP here. I don't know Scala or Haskell well enough to make a "correct choice" either now or then, but basically I had some experience with ML type systems (from Elm and Haskell) and thought sum types were great. Scala seemed like a mess at the time (from a distance - no idea whether I'm right). My attempts at Haskell had honestly not gone all that well, the lazyness and pure functional-ness I felt were not great. Basically, I wanted server-side Elm, and OCaml was pretty close. Tried it, didn't hate it, figured could always do a rewrite later. And here we are.
- to11mtm 6y ago> Scala seemed like a mess at the time (from a distance - no idea whether I'm right). I work on and use the .NET Port of Akka from the Scala/JVM world. In those travels it has included reading a pretty decent amount of Scala code. I wouldn't call it a mess so much as a very -expressive- language. But the cost of that is there are a lot of different ways to do things, and some parts of Scala that are very powerful can be very confusing until you understand them. My favorite analogy for .NET developers; if they remember their confusion the first time they had to comprehend => delegate syntax, there's lots of little things in the same vein in Scala; ways for the compiler to generate sugar. There's just so -many- of them it can be overwhelming, doubly so when in some cases the wrong choice can in fact have pretty big performance implications.
- dwohnitmok 6y agoIt sounds like you've already made a choice, but on the off chance you haven't I would suggest Kotlin. I would recommend Scala in second, but you really need at least one person who knows Scala well to navigate the wildly divergent styles of Scala programs out there. Kotlin gives you sum types via sealed classes. In fact it's basically the bare minimum of Java + sum types + some syntactic sugar. It has rock solid tooling due to Jetbrains support. It has access to the entire JVM ecosystem. It has a huge amount of learning materials out there. And it's got all the resources on how to deal with web CRUD problems you could ever imagine. It's not server-side Elm by a long shot, but to be fair, Elm would suffer from all the same problems you listed.
- muglug 6y ago> I’ll write in a few days about what we chose instead My bet is Python - it has some types but more importantly a massive ecosystem, and I think Dark’s target market probably has a little Python knowledge (which would come in handy if they’re looking for open-source contributions down the line).
- ben509 6y agoPython is a bad choice for writing reliable software. If you need the reliability of type checking, just use an early-bound language, not a late-bound language with checking grafted on. And very few Python libraries have type annotations. And while 3 fixed some footguns, e.g. 'a' < 5 now throws a TypeError and there's a clear distinction between str and bytes, others remain, e.g. if you reuse a generator it will silently be empty. Looking at the repo[1] the languages tab shows: OCaml 78.6% F# 12.2% The F# hits are in a directory "fsharp-backend", and all in the last 3 weeks. 1: https://github.com/darklang/dark https://github.com/darklang/dark
- JaggerJo 6y agoHaha, also checked the repo and thought the same. We're using F# in prod (about 200K LOC) and it has been great so far. We also use F# for two react front ends with fable (F# to JS compiler). More new alternatives for using F# in the browser (FsBolero/Blazer) via web-assembly or running it server side like Phoenix live view also exist. One issue we had with Fabel is how .NET DateTimeOffsets are handled on the Client side.
- pbiggar 6y agoHonestly surprised I was able to keep this any kind of mystery, since the repo is open and it's plain as day what I've been working on. But congrats on being the only person that actually looked!
- fulafel 6y agoThere's a more to reliable software than static typing. See eg Erlang and its stellar record in building reliable systems. Static types aren't necessarily the best fit for distirbuted systems, network protocols, asynchrony etc.
- hardwaregeek 6y agoI always face this dilemma when starting projects. I want to use a language with nice types that's fun to write, but damn it's so hard to not use Rails or JavaScript. My dream would be for Rails to get good types or for a language with good types to get a Rails style framework. Maybe Sorbet is the solution, although I've seen enough confusing Ruby metaprogramming to be skeptical of that. Maybe someday Rust, Swift or Kotlin will get a mature web stack.
- lostcolony 6y agoMature in what way? In terms of features/completeness, or just...age and battle testing? I'm not really in the Rust world any, but I feel like https://www.arewewebyet.org/topics/frameworks/ https://www.arewewebyet.org/topics/frameworks/ is a fair amount of choice to start with? A couple of those are post 1.0.0, but to be honest, I wrote an Erlang web service using Cowboy, before it hit 1.0, back in the day, and it was fine.
- hardwaregeek 6y agoEverything just takes too damn long. You gotta trawl through tutorials and connect a bunch of libraries just to get a simple CRUD app with user auth set up. In a couple years, hopefully we'll have a mature default library for most usecases and they'll play nice with each other. For instance, there's exactly one JWT library. To get a simple auth setup going, I'd need to connect this JWT library to my password setup, which I'm gonna need to design too, since I'm using a barebones password hashing lib. Now I need to write the token exchange and validation logic. Then manually put the token in the header/response, etc. Compare that to Rails where I can install devise_token_auth and just have tokens out of the box. No fuss.
- lostcolony 6y agoOkay, so you're looking for batteries included. What Javascript framework are you using? Or did you just mean on the frontend? I figured from your including it you meant something backend, like Express, which is probably the most popular in that space, and fairly minimal, but super easy to grab the middleware pieces you want. As, yeah, if you're looking for one giant "does all the things" framework, I don't know of any. Even the ones that started that way, reconfigured their projects to keep them optional (i.e., https://github.com/actix/actix-extras https://github.com/actix/actix-extras ) ...and honestly, I feel like most frameworks are moving in that direction. Even ones that want to be like Rails (i.e., Phoenix for Elixir) tend to be very intentional in making the included pieces fit the middleware pattern so you can swap them out easily. So you may be staying with Rails for a while if that's important to you. I will say, comparing when I had to learn enough Rails to get something done, and having worked with Express, and Phoenix, and Gin, it's generally no harder to learn the pieces you need than it is picking up any new batteries included framework. Oftentimes the same web search that would turn up the one bit of syntax you need for the batteries included framework (i.e., "actix-web auth token") will turn up the most obvious choice of middleware you'd need for the middleware approach. And the usage will be of similar effort, once you've installed one.
- Tommah 6y agoThere is a library called py.ml [0] that lets you call Python code from OCaml. That should let you use Google Cloud's Python SDK from OCaml, although things could get unwieldy if you have to call back and forth constantly. I think it's at least worth a try, especially if the alternative is rewriting your whole codebase in Python. [0] - https://opam.ocaml.org/packages/pyml/ https://opam.ocaml.org/packages/pyml/
- nendroid 6y ago>learnability I feel this is the single most important causative factor for language popularity. Javascript may have much more bad parts to the language than say Haskell but it's far easier for a programmer to learn all the bad parts of javascript and avoid those bad parts then for him to learn all the good parts of haskell and use those good parts.
- amw-zero 6y agoThis really shows how much we depend on (and exploit) open source software. The amount of infrastructure needed for a very simple product is tremendous.
- segmondy 6y agoThat's unfortunate, but hindsight is 20/20. If you wish to build a tool that will be used by the world, it's best to bet on a boring language like Java, Go, Python or you will eventually run into something like this. For pure tools attacking a specific domain, exotic languages like Ocaml, Lisp, and Haskell might shine.
- jeff-davis 6y agoDon't bet on boring languages. Bet on community and ecosystem. If those are vibrant and a good match for your domain, go for it. If multiple languages meet that criteria, choose the one you believe in. Conversely, if you are developing a new language, focus on building a community and ecosystem around certain problems, even niche problems. That will give a consistent group of users that can build out the rest of the ecosystem slowly.
- aidenn0 6y agoI don't know anything about OCaml, but if it's anything like other slightly-unpopular languages, GCP probably was much less supported by the ecosystem than AWS. The double-whammy of an also-ran cloud platform with an also-ran language will really get you.
- mooreds 6y agoEcosystems matter a whole lot when you're just trying to GSD. That's why Rails, for all its flaws, still beats the pants off many other solutions (for the right problems). And then, when you have a ton of code, you have a lot of embedded knowledge and throwing it all away is tough. Looking forward to the next installment to hear what is next.
- wk_end 6y agoI used OCaml for several years professionally. It's a phenomenal language in many ways, but there's no way I'd seriously consider using it for a new project at this point. I don't really agree on the "Learnability" and "Minor annoyances" sections here. In terms of overly academic discourse, well, everyone's experiences differ but that's simply not a problem I've personally seen in the community (and I'd happily tell you other languages have that problem in spades). In terms of learnability: Ocaml, (the good parts) is an extremely straightforward language in most respects. The tutorials on the Ocaml website are enough to get you up and running, and Real World Ocaml is freely available and it's great. It'd be nice if v2 ever came out, but...well. Between those two, if you're still struggling, give me a call and I'd be happy to tutor you :) The rest of this article hits most of the nails right on the head. The library support just isn't there, the community is too fragmented (why is stdlib vs. Core vs. Batteries and Async vs. Lwt still an issue?), the tooling is still too rough. OCaml's lack of multicore isn't actually a problem for most use-cases, but the fact that it's been in limbo for a decade despite the endless clamouring for it tells you something about what you're hitching your wagon to. Twenty years ago OCaml would've been a no-brainer. At this point if I wanted a practical garbage-collected language I'd choose Scala and get a large and active community, as many Java libraries as there are stars in the sky, and the most sophisticated runtime environment mankind has ever dreamed of (for better or worse). If I truly need a compiled language, well...tragically, I've been bitten by the Rust bug (to the extent that I'm starting to believe its rigid approach to ownership helps engineer better code - that the ability to freely and thoughtlessly sharing references to objects the way garbage collection grants makes it a mistake, but that's a story for another post). And if I need 100% of the power and safety types can give me, Haskell is there waiting, with a better ecosystem to boot. Everything OCaml does well other languages do better, and then some. It's an also-ran now.
- ernst_klim 6y ago> I'd choose Scala and get a large and active community, as many Java libraries as there are stars in the sky, and the most sophisticated runtime environment mankind has ever dreamed of (for better or worse). Hahahaha oh wow. You never ever used Scala, aren't you? I did, I moved from OCaml to Scala. Oh, good luck joining Scala community then, we don't have aforementioned problems, don't we? Because Akka vs Zio vs Cats vs Scalaz is not a thing. Because ensime vs metals debacle never happened. Because we don't rewrite the complete ecosystem each couple of years. > most sophisticated runtime environment mankind has ever dreamed of Which you need to tune quite a lot to fit Scala into it (hopefully, it's very tuneable). Oh, and this "most sophisticated runtime" doesn't support TCO btw. Oh, and any AnyRef value (so anything but basic types) can be null, thanks, runtime. I love Scala, but all these "I wouldn't choose OCaml, I would choose F#/Clojure/Scala/other obscure language" usually mean "I've tried ocaml but didn't try other obscure language, so maybe it's better" I love OCaml is well, and most of your points could be reduced to simply "it's lacking manpower" (Scala is lacking it too). Because all of the "why is stdlib vs. Core vs. Batteries and Async vs. Lwt still an issue" we have in C, C++ and many other popular languages too, but it's not a big issue. People complain on meson/cmake/autotools/boost/glib/qt but not leave for some reason. Maybe people don't use OCaml that much rather because there are simply too few jobs and too few programmers and it's a simple chicken and egg problem. And all these technical rationalization is not the reason because it's applicable to quite a lot of languages (safe for lack of libraries)
- lihaoyi 6y ago> it's a high-level language with static types, so easy to make large scale changes as we figure out what the language/product was > you mostly model data with sum types, which in my mind are the best way to model data >it's very similar to the language I wanted to build (in particular, we could reuse built-in immutable data structures for Dark's values) > it had a reputation for being high-performance, which meant that we could write an interpreter for Dark and not have it be terribly slow (vs writing an interpreter in python, which might be too slow) > We have struggled to make editor tooling work for us. > Lack of libraries > Multicore is coming Any Day Now™, and while this wasn't a huge deal for us, it was annoying. > we also use ReasonML > lazyness and pure functional-ness I felt were not great > I plan to leave keep the frontend in ReasonML You want a statically typed functional (but not pure) language with sum types, immutable data structures, good performance, editor/IDE support, a broad library ecosystem, multithreading, a C-like syntax (I assume, since you're using ReasonML), and a nice compile-to-Javascript experience to run in the browser. I don't want to sound too much like a fanboy, but all this really sounds like Scala. You want Scala.
- X6S1x6Okd1st 6y agoIf only there was a recently published high quality book that could walk them through Scala with some hands on examples :)
- natchy 6y agothis? https://www.handsonscala.com/table-of-contents.html https://www.handsonscala.com/table-of-contents.html You the author or something? I'm actually learning F# and OCaml and am interested in Scala as well.
- siwatanejo 6y agoI would discourage you to try Scala, AFAIK it doesn't default to immutability.
- sjrd 6y ago
- swuecho 6y agoWhy not use Ocaml for the compiler part only. When you need to go to the real world, use python or go.
- kasajian 6y agoCoincidentally, I chose to look into using OCaml for a project last week. I was pumped and then I was disappointed at the lack of interest in supporting Windows. That just tells me they're not a serious player.
- djs55 6y agoI do OCaml programming on Windows and I found that it was a bit confusing at first with too many different ports and install options. However once I settled on https://github.com/fdopen/opam-repository-mingw https://github.com/fdopen/opam-repository-mingw I was fine. To my surprise I was able to extend existing C bindings to use Win32 APIs fairly painlessly (for example https://github.com/mirage/mirage-block-unix/commit/7cf658f8a9956c51f053b39eb397b3628b7ee207 https://github.com/mirage/mirage-block-unix/commit/7cf658f8a... ) . I did have problems with I/O scalability at first but I fixed these by using libuv via https://github.com/fdopen/uwt https://github.com/fdopen/uwt . The core compiler and runtime are rock solid on Windows. Docker (where I work) ships OCaml/Windows binaries to lots and lots of desktops with no problem. Apart from the too-many-ports problem, I think the main remaining problem is that too many 3rd party libraries require Unix-isms to build, like shell scripts. This necessitates the presence of cygwin for build (but not at runtime). However the ongoing "dune-ification" of the OCaml universe should help fix this since dune can do everything directly from OCaml code. I'm really looking forward to being able to open a powershell window and type "git clone"; "dune build" and have everything just work.
- emmanueloga_ 6y agoFrom reading the threads here I can see most people agree the JVM is a great language in terms of capitalizing on the existing ecosystem. Some people mention Scala as an alternative to OCaml but honestly the language seems a lot less elegant (at least at a distance...) and the community seems to be surrounded in controversy and confusion ([1] ?) I think a SML inspired language on the JVM platform would be really popular. [2] lists a few but none of them seem to have gained momentum. [3] looked promising but it seems like development has stalled. 1: https://github.com/lampepfl/dotty https://github.com/lampepfl/dotty 2: https://smlfamily.github.io/ https://smlfamily.github.io/ 3: https://eta-lang.org/ https://eta-lang.org/
- dfgdghdf 6y agoIt seems that most of the problems the OP has could be solved with minimal distruption by switching to F#. The .NET ecosystem is large enough to provide the libraries required, multi-threading already works and the language is very close to OCaml. You can also leverage Fable to run F# on the front-end too. However, you do lose some fancy type-system features and (arguably) some single-core performance vs OCaml.
- hobby-coder-guy 6y agoF#
- meowphius 6y agoUse bucklescript so you can use JS libraries on the server.
- pbiggar 6y agoFollowup post: https://blog.darklang.com/new-backend-fsharp/ https://blog.darklang.com/new-backend-fsharp/
- blandflakes 6y agoI guess hindsight is 20/20, but even though I think OCaml is a really endearing language, I would not build my startup on it, for the reasons everybody else is saying! I don't have time to shave yaks with respect to database access, cloud storage, etc. The savings in just going over to GCP or AWS and filtering your "potential languages" by the list of supported languages seems impossible to overestimate. If you want something with more safety machinery than Go (and I get it, so do I), I think your real choices for a language that needs to interact with cloud providers are something on .NET, or something on the JVM - you pick one, and you go solve your actual problems instead of having to write your own stdlib. I'd be way more open to experimenting on the front-end with buckle->rescript or similar, where I'm leveraging existing JS libraries and don't have to worry about high quality database drivers.
- asdfasgasdgasdg 6y agoIt seems really questionable to take on ANY new language if you're trying to build a business. If you're building a gaming business, you had better use C++, C, or C#. If you're building a business that might need to use the cloud, look at the supported languages where your chosen cloud has an sdk and pick one of those. If you're building something for Windows avoid programming languages that only have Unix implementations. Etc. Other choices are just onboarding unnecessary risk.
- blandflakes 6y agoYeah definitely feeling on the same page. I've seen a lot of writing on the web about "novelty" budgets, etc. I know people argue that really expressive languages are a secret weapon (and I definitely think that Java as I was writing it years ago wasted a lot of my time), but I think haven't a great ecosystem is also a (not secret, but) secret weapon.
- sweeneyrod 6y agoI'm sure that by new you meant obscure, but OCaml has been around for 24 years.
- 6y ago
- ksec 6y agoI wonder if anyone has built a list of functions, libraries and toolings that are considered as essential among mature Programming Languages. Not the core features but ecosystem around it. So that when people are evaluating a PL, they can known immediately what is missing. And people wanting to make a new PL knows what is missing in their ecosystem, the community can jump in to help.
- ncmncm 6y agoAre there any programs coded in OCaml in common use by non OCaml programmers? E.g., in Haskell I found only Pandoc, plus a personal finance and a parametric 3D CAD system. I know the FFTW C library is generated by an OCaml program, but that is just for programmers. "In common use" might mean commonly packaged for Linux distributions and not targetted for programmers, or driving multiple public websites that are not programming-related.