1. 38
  1.  

  2. 17

    TBH, a bit of up front research would have found all of those issues in the beginning.

    As somebody who’s pretty dedicated to working with an obscure language (Common Lisp), my advice is that if you’re not able (or not willing) to help write the missing libraries and tools that you need then you’re almost certainly better off using a language that already has them.

    1. 2

      If you look at some of the other posts related to async and performance, they do seem to re-learn things.

      1. 2

        Although Common Lisp is not mainstream, but I wouldn’t say it’s obscure. There’s plenty of libraries, the developer experience is very good (ASDF, Quicklisp, etc). And there’s quite a lot of deep production use of CL.

      2. 7

        We have considered OCaml but went for F# instead. I could not be happier. Great libraries, good tooling, in 2020 F# is a first class citizen in the cloud thanks to C# and .NET Core. You can develop on Linux, Windows, MacOS and without modification it works. Compilation times are great. Unless you want to deal with the low level nature and the C++ influence in Rust F# is a much more logical step to move from OCaml. There is dotnet fsi for REPL too. I really like OCaml, it was my first ML language but it is not great for cloud computing or anything where you do not want to write a ton of code that has nothing to do with your business problem, because there aren’t many libraries. F# has access to C# libraries and it is relatively easy to write a thin wrapper that convert nulls to Nones, so you are null safe or C# style functions to ML style functions so you can use |> or <| etc. Out frontend is in Elm and we follow elm-format style in F# (manually though) so our codebases look very similar.

        1. 3

          What’s your problem domain? I will use F# at a new job, and I would love to hear which libraries & frameworks you love, and which resources are good for learning.

          For context, I already know Elm very well, and Haskell at an intermediate level. I also plan to work through “domain modelling made functional”.

          1. 3

            SAAS, energy, finance.

            I could collect some of the libraries for you.

            1. 1

              That would be awesome! I’m especially interested in what stands out, or strong opinions you have derived from your experience. I’m sure I can find the very basic stuff with a bit of research :)

            2. 1

              I will use F# at a new job

              Mind sharing company’s name? Curious about places using functional programming languages.

              1. 1

                Sure, it’s called valora digital. It’s in the retail space, based in Switzerland. We’ll basically build self-serve stores and a bunch of ecommerce.

            3. 2

              My sole issue with F# is that dotnet has no support for the ppc64le architecture yet.

              There is some progress on this front: [1] [2] [3]

              1. 1

                How good is F# for writing cross-platform GUI apps?

                1. 2

                  fairly lousy in my experience. i try it every year or two, because it really does sound like a great language for it, and invariably end up giving up after a few days due to running into issues with linux as my development environment. that said, my last attempt was in 2018 so things might be better now; i would personally like to see a working, reasonably-sized gui app somewhere on github that i could use as a reference before trying again.

                  1. 1

                    Good question, I have no idea.

                    1. 1

                      It’s okayish. Worst case you can use C# for UI which has better tooling. Check out Avalonia which supports Windows, MacOS, and Linux, with Android and iOS coming soon.

                    2. 1

                      You can develop on Linux, Windows, MacOS and without modification it works.

                      AFAIK, F# programs need the .NET runtime being installed. How do you enforce this on the client side? Or is it possible to bundle the runtime with your program?

                      1. 4

                        Publishing your app as self-contained produces an application that includes the .NET Core runtime and libraries, and your application and its dependencies. Users of the application can run it on a machine that doesn’t have the .NET Core runtime installed.

                        https://docs.microsoft.com/en-us/dotnet/core/deploying/

                        1. 3

                          Thanks. Do you know much MBs this adds to an “hello world” application?

                          1. 4

                            A lot, in my experience. A simple program that uses nothing but the standard library will output a binary of about 90mb.

                            1. 1

                              Do you know if there are any efforts in the pipeline to modularize .NET, like JDK 9 did?

                        2. 0

                          And? How is this related to my comment about development?

                      2. 4

                        I see that this post is a merge of two submissions. Could you we make the second submission’s title (Dark’s new backend will be F#) the default title, as that’s a bit more informative when glancing the frontpage?

                          1. 3

                            Language tutorials are extremely poor in OCaml compared to other languages; they’re mostly lecture notes from academic courses.

                            Given the language’s origins, there are a lot of resources written in French (As a quick example, https://ocaml.org/learn/books.html list 16 books in French, compared to 12 books in English). I haven’t read enough of them to come to a conclusion, but it’s possible that some of the good resources are in French.

                            1. 3

                              I wish the OP good luck with finding their next language.

                              The one argument that rings true is the overall quality of the documentation. Not the core language, mind (that one is usually quite excellent), but for most libraries in the ecosystem. It’s not that it’s bad in the sense of lacking or half-backed, but I feel like library authors expect a very high level of fluency in the language and the concepts from their users. Lwt is indeed a good example of a critical piece of software in the OCaml ecosystem that could deserve a bit of documentation TLC.

                              For the other points, YMMV:

                              • I have never needed multicore OCaml and Lwt has always been more than enough for my use cases.
                              • I have always found OCaml tooling to be first class (the compiler itself has gotten a lot better with error reporting over the years, merlin and ocaml-lsp are top shelf).
                              • IDE integration has always been premium within vim. The OP issues could be because of ReasonML.
                              • The only tool you really need is opam. The dune build tool is certainly an improvement over the dark days of oasis and ocamlbuild but it is not required to get started. I have never heard of esy and never ever used it.
                              • “Real World OCaml” is excellent for any beginner wanting to get into the language.

                              If support for some API or service is missing I usually end up writing the necessary libraries. I always found that fairly straightforward especially given the very high quality of some core libraries like opium, cohttp, or conduit, to mention only a few. But I understand how that could be seen as an impediment when the focus is to deliver a PoC or a MVP.

                              1. 2

                                The only tool you really need is opam. The dune build tool is certainly an improvement over the dark days of oasis and ocamlbuild but it is not required to get started. I have never heard of esy and never ever used it.

                                This may be true, but when I was learning OCaml there was no way for me to find it out. There was no high-level description of how the tools fit together; all the docs that mentioned ocaml, dune, and ocamlbuild just assumed you were already familiar with what they were for. As someone new to the language, it just made my head spin trying to figure out how the pieces fit together.

                              2. 3

                                Rust sounds like a good match (but i doubt that’s your choice because I think you tried it already). But see the recent post here about rust being as productive as kotlin.

                                1. 11

                                  My money is on F#. He gets everything he likes from OCaml as well as proper multicore support. Plus he has the entire .NET ecosystem to fall back on when it comes to libraries, documentation etc.

                                  1. 5

                                    F#

                                    Looks like you were right:

                                    https://blog.darklang.com/new-backend-fsharp

                                    1. 2

                                      You nailed it!

                                    2. 4

                                      It sounds like Rust would be an awful choice, because most of his complaints are true for Rust as well, especially where the ecosystem is concerned.

                                      1. 3

                                        Rust has a much bigger ecosystem especially in terms of “cloud” and web stuff. You won’t have the “there’s no google cloud client library and the postgres client is incomplete” problem in Rust.

                                        1. 2

                                          Rust is approaching 50,000 crates (that’s 1/5th of nuget, and more than CPAN). It’s not as big as mainstream package repositories, but it’s definitely past being a niche language.

                                          1. 2

                                            It doesn’t matter how many crates exist if none of them provide what you need

                                            1. 4

                                              That’s a meaningless tautology. It’s true when applied to any language.

                                        2. 3

                                          Rust doesn’t really have a good official google cloud sdk. I think the safest choice is Go if your aim is interfacing with google products.

                                          That being said, I wish someone made the equivalent of bucklescript/reasonml that compiles to go so you can just use ocaml with go’s extensive set of libraries.

                                          1. 8

                                            That’s one of the reasons I don’t like Go—its ecosystem is a walled garden.

                                            OCaml libraries are usable from other languages, you can write a shared library in it. Whether to link everything statically is a choice. With Go you don’t have that choice, if you write a library, no one but other Go users can ever benefit from it.

                                        3. 2

                                          I am quite fascinated by both their technology and their story. I sent the author an interview request. Sure hope he has time to chat some. I imagine those guys are getting a ton of attention right now!

                                          1. 2

                                            I used OCaml for a personal project and what’s described here on tooling and general user-friendliness is sadly correct. And I didn’t need that many libraries, wasn’t writing a web service, or connecting to a third-party… it was a static-site generator! I really, really tried to make something positive come from my frustrations and wrote up some things I wish I’d known before, but you can tell the post is a bit seething with how hard it was to find what I needed.

                                            I think a doc like What I Wish I Knew When Learning Haskell or even How I Start would do a lot of good. There’s so much there that I love and I’d love to use it for more projects but it’s such a spiny experience I can’t recommend it to those who value their time.

                                            1. 1

                                              I can’t help but notice this:

                                              I built the first demo of Dark in Python, in about two weeks.

                                              you mostly model data with sum types, which in my mind are the best way to model data

                                              in light of the Tea language project, which someone is actually helping with me now!

                                              tl;dr Tea is a cleanup of Oil’s metalanguages, which can be called “statically typed Python with sum types”.

                                              https://github.com/oilshell/oil/tree/master/tea

                                              The README.md links to previous lobste.rs threads on the subject.

                                              Also related: https://lobste.rs/s/vmkv3r/first_thoughts_on_rust_vs_ocaml#c_v5ch1q (previous OCaml vs. Rust thread)

                                              1. 1

                                                I’d like to see why they chose OCaml then F# over Clojure, considering his previous experience with Clojure.

                                                1. 2

                                                  Static typing

                                                  1. 1

                                                    Thanks for replying!

                                                    Does that really make a large difference? Clojure sits on top of the JVM with that type system, would it have been a problem to build on top of that?

                                                    1. 1

                                                      Clojure is dynamically typed, you can’t reuse the Java type system (and even if you could, it’s not a great type system). We experimented with Core.Typed, a library for static typing in Clojure, here’s how that went:

                                                      https://circleci.com/blog/why-we're-supporting-typed-clojure/ https://circleci.com/blog/why-were-no-longer-using-core-typed/

                                                      1. 1

                                                        So final question on the topic, was static typing really so important for Dark?

                                                        1. 1

                                                          yeah, absolutely. We’ve made so many huge changes and the compiler guides us the whole way. We were deathly afraid of making changes in Clojure.