4 ms·
Sure. I presume you're asking about why FP is easier, though if you're wondering about my language there's more info at https::/darklang.com. I think the quote
by pbiggar 9y ago
Sure. I presume you're asking about why FP is easier, though if you're wondering about my language there's more info at https::/darklang.com.
I think the quote about the gorilla and the banana and the jungle is a really important piece. It's just hard to compose things in OO languages unless they're designed to be used together. Whereas in an FP language, you focus on simpler primitives (arrays, hashtables, nullable types, and errors values typically, depending on the language), and you have a ton of functions that know how to work with those, so you kinda use them for everything.
A second reason is static typing (doesn't apply to the lisp family of FP). Good static typing makes it very easy to understand what's happening, and makes it hard(er) to make errors. For example, in OCaml, Elm and Haskell, it's impossible to have a NullPointerException, which is the biggest bug class in Java. Similarly, the biggest problem in a python/ruby codebase is "what exactly is this thing I have", a problem eliminated by the type system as well.
Of course, these features have a cost. It can sometimes be trickier to do things that are easy in dynamic OO languages like Python (and of course Haskell has layers of complexity so I don't recommend going near it), esp the learning curve if you're not familiar with FP. But being in deep in a functional codebase is much much easier than being in a deep in a java, ruby, python, js, etc, codebase.
If you're looking to check FP out, I recommend Elm, ReasonML, or Clojure.
- whitepoplar 9y agoThank you! Do you have any thoughts on Elixir/Erlang/LFE? Elixir is dynamic, but seems to have many of the benefits of a static type system by use of Dialyzer, Erlang's static type analysis tool.
- pbiggar 9y agoI have no experience with Erlang sadly. I did my PhD on static analysis though, and my general opinion is that the difference between a language designed for analysis (eg via a type system), and one that isn't, is night and day.
- kazinator 9y agoIn that respective order, too. You could have caught that had you assigned night and day different types, instead of having it blow up 19 hours later in the field like this.
- purvis 9y ago> about my language there's more info at https::/darklang.com. I find it slightly reassuring that someone is actually working on a language/compiler with PaaS features built in. I'd thought of doing that and jotted it down in my notebook.. assuming it was just a crazy idea. When do you plan to release an alpha version? I'd be interested in seeing it!
- pbiggar 9y agoAlpha is probably out this year. We send periodic announcements to our mailing list, there's a link at the bottom of Darklang.com. Also, we're hiring: http://darklang.com/careers http://darklang.com/careers