News for hackers. Stuff that matters.
Re:Lisp and Haskell (2015) by StreamBright on Thursday October 08, 2020 @02:44AM (#24716516)
Clojure and F# are my two favourite languages and I have similar experience. It is much faster to develop F# code because I can rely on the type system to help me handle all the edge cases, pass in the right things and avoid nulls.
Re:Lisp and Haskell (2015) by mr_custard on Thursday October 08, 2020 @02:09PM (#24721974)
> Clojure and F# are my two favourite languages and I have similar experience

Same. I have worked in both F# and Clojure profressionally. I love them both for different reasons.

As a fun thought experiment, I have often tried to force myself to choose between them, even though one doesn't really have to make a choice. Turns out that it's a tough choice to give one up over the other.

I tend to lean slightly towards Clojure at present, but then I'm using it a great deal at work.

However, if you're looking for a modern strongly typed, immutable functional language with type inference, then F# is really excellent.

I haven't used Haskell professionally and have only played with it but my feeling is that I prefer F# to Haskell because it has some "escape hatches" built in, in order to interop with C# and other .NET languages; So no IO Monad is required. It feels like more of a supporting structure and less of a straightjacket to me.

Re:Lisp and Haskell (2015) by fhsm on Thursday October 08, 2020 @04:27AM (#24717103)
I really like both of these languages but don’t work in either and find that I struggle to manage these two totally different platforms for hobby work. Both communities have strong tooling norms such that I feel stuck either burning side project time getting up on tools or burning time fighting “the way” assumes by most online materials.

Any tips on how to have just a little bit of Clojure/JVM and f#/CLR in your life when day-to-day is on neither platform?

Re:Lisp and Haskell (2015) by StreamBright on Thursday October 08, 2020 @10:06AM (#24719182)
Great question. Our entire company has moved to F#/CLR/.NET Core at the beginning of 2020 and we could not be happier. It started in 2019 as a hobby project, I just wanted to create a simple (not in par in terms of features) replacement for Google Analytics to track how users use our website and also create an ETL pipeline for it using AWS Lambda. This is how I got into it more in depth. The more I worked with it I started to like it even more. When the time came to select the stack for our next project we had Rust and F# as the two options and F# won because most devs were already familiar with C# and we did not like few things about Rust (especially the string handling) while we could not find any particular issue with F#. Now, 100.000 lines of code later, it was a pretty good decision.

As far as Clojure goes, I usually use it for the JVM world, if I get a project and there are no other devs. Unfortunately it is almost impossible to convince Java devs to use Clojure and there are some limitations (Java interop for example) that makes it hard to sell. I am not even sure what would I do in your situation.

Re:Lisp and Haskell (2015) by slifin on Thursday October 08, 2020 @05:57AM (#24717578)
Babashka (https://github.com/borkdude/babashka) is the new gateway drug for Clojure

Essentially you can use it in most places you'd currently use bash scripts the install footprint is small and the startup time is fast

It's kind of like Clojure without the JVM, very easy to justify for one off bits and pieces

Re:Lisp and Haskell (2015) by sidkshatriya on Thursday October 08, 2020 @04:17AM (#24717061)
I've always been curious about F#. Is it true that the F# compiler can be super slow especially on larger codebases?

I always wonder: why use F# when you can use OCaml? OCaml has pretty decent third party libraries...

(Yes multicore support in F# would be a good reason but apart from that)

Re:Lisp and Haskell (2015) by fredrikholm on Thursday October 08, 2020 @06:08AM (#24717662)
In my experience it isn't much worse than equivalent C# solutions, perhaps a fraction slower.

Having .NET CORE as a foundation means that whatever improvement the platform gets, F# gets.

This means that not only gets to interop with all the NET frameworks and such (good or bad), but also enjoy the massive performance improvements that's been going into CORE lately (compared to old NET).

Re:Lisp and Haskell (2015) by StreamBright on Thursday October 08, 2020 @10:11AM (#24719218)
> Is it true that the F# compiler can be super slow especially on larger codebases?

Define slow. I never had an issues with the compilation speed of F#.

> why use F# when you can use OCaml?

Even though both of them are in the same family they could not be further away from each other. OCaml has many standard libraries more you can read here: https://discuss.ocaml.org/t/what-is-the-preferable-solution-...

F# has (almost) everything that is available in the CLR, which means tons of high quality libraries, ready to be used in production.

Another advantage is AWS support. Since C# is a tier one language in the cloud F# is also a tier one language. I am not sure where OCaml falls into in this space.

Other than these I am not sure why, but these are pretty big ones for us. I love OCaml and trying to use it whenever I can, which is not that much unfortunately.

Re:Lisp and Haskell (2015) by bonthron on Thursday October 08, 2020 @09:02AM (#24718711)
If you're already doing C#, then it's easy to start using F#. You probably are using VS Studio/Code, you already know the standard .NET libraries. etc.. F# is a little weird because there are accommodations to ensure it will interop with C#. But it is fun.
Re:Lisp and Haskell (2015) by the_only_law on Thursday October 08, 2020 @09:42AM (#24719017)
Can someone describe to me what is good about OCaml? Unfortunately I think I've only eve heard complaints about it, many being mentioned here (multicore support, bad tooling, things like utf support you'd expect to be built in, Windows pains, etc.). I've also read a number of admittedly older peices criticizing it's type system among other things. When or why should someone consider using OCaml versus a lisp, modern mainstream languahes or even a purely functional language like Haskell?
Re:Lisp and Haskell (2015) by guenthert on Thursday October 08, 2020 @02:51PM (#24722398)
Safer, more expressive than C, easier, saner than C++?
Re:Lisp and Haskell (2015) by dunefox on Thursday October 08, 2020 @04:44AM (#24717190)
> why use F# when you can use OCaml?

I have looked at both without any prior experience in them and OCAML tooling is horrible. Also, with no support for unicode in Ocaml, F# is just much better in this regard - even if it lacks modules, functors, etc.

Re:Lisp and Haskell (2015) by sidkshatriya on Thursday October 08, 2020 @05:07AM (#24717309)
> OCAML tooling is horrible

This is the old view. In 2020 OCaml tooling, if I may be brave to say so, is excellent. Check out the triumvirate of dune (build), opam (external dependencies) and ocaml-lsp (IDE smarts).

P.S. ocaml-lsp uses merlin in the backend (ignore that if you are not familiar with merlin).

Re:Lisp and Haskell (2015) by StreamBright on Thursday October 08, 2020 @10:13AM (#24719233)
I just spent 2 hours on this excellent tooling to try to upgrade a package with opam, I finally gave up after read all the Github issues and Stackoverflow, etc.
Re:Lisp and Haskell (2015) by dunefox on Thursday October 08, 2020 @10:32AM (#24719392)
I spent two evenings (3 years ago, admittedly) to get the tooling setup so that I could install libraries. I got nowhere and gave up. I'm quite interested in the language but everything else seems to be a dumpsterfire.
Re:Lisp and Haskell (2015) by dunefox on Thursday October 08, 2020 @03:32PM (#24722885)
I just tried it again, everything (m4, dune, opam, ocaml-lsp) installed just fine; then I created a simple hello world project (Quick start guide: https://dune.readthedocs.io/en/latest/quick-start.html) and I could compile and run it. Oh, how things appear to have changed.
Re:Lisp and Haskell (2015) by dtbx on Thursday October 08, 2020 @08:47AM (#24718613)
You can use camomile library to handle unicode strings, count code points, perform locale aware lowercase / uppercase, etc

For utf8 regexes, you can use Pcre in ocaml, which is faster than camomile regexes.

Re:Lisp and Haskell (2015) by sk2020 on Thursday October 08, 2020 @10:35AM (#24719414)
You use F# because your use case requires .NET. You can’t write AutoDesk plugins in OCAML, or at least I’ve never heard of that happening. Sometimes you don’t actually have meaningful alternative programming languages for certain uses.