Functional Languages

What are the quintessential functional languages besides Haskell? More specifically, are there any lisp languages I should learn?

Attached: 1024px-Lambda_lc.svg.png (1024x1024, 19K)

Other urls found in this thread:

sourceforge.net/p/tom7misc/svn/HEAD/tree/trunk/sml-lib/
github.com/seanmcl/sml-ext
youtu.be/j-kj2qwJa_E?t=7m31s
twitter.com/SFWRedditImages

javascrupt

Learn lisp 1.5, scheme if you want a functional lisp.

Erlang is the gold standard for concurrent/distributed programming and it's functional.

Elixir is Erlang with a ruby syntax and some other stuff on top.

Standard ML is the easiest and best for doing large abstract prototyping, such as proving programs yourself. MLton, a compiler for SML compiles to C. You can also call C libraries so the whole 'SML has no libraries!' lies is just lies, you have all the C libraries you wish.It also has a sealed in stone standard from the 1990s, much like ANSI Common Lisp so finding ancient code will run fine no problem, and code you write today will still run 30 years from now.You can take an entire CS education in SML, since there's so many books for it around like 'Discrete Mathematics and Functional programming' or 'Purely Functional Data Structures' or 'Parallel and Sequential Algorithms' book which is free. You can also write imperatively, so loops and shit work in SML if you really wanted (or OCaml).

Erlang isn't entirely the gold standard for concurrency, if you real PFPL by Robert Harper, and ConcurrentML, you'll see there's many other ways of doing it that are proven type safe that you yourself understand from the ground up. Problem with Erlang is OTP is extremely large, so if anything goes wrong you now need to start digging around in the OTP library C implementation which can be a nightmare, discord and whatsapp developers have written on how they essentially needed to rewrite large amounts of Erlang/Elixir. Lisp is fun for rapid prototyping too, as you can run the program as you write it, making changes on the fly during runtime. Cool things you can do in SML/OCaml: Compile it to C with MLton, using whole program optimization. Convert the .c output to webasm, Effortlessly build DSLs for custom compilers for virtually anything, or a typesafe dsl to generate bytecode for the memcoin virtual machine flavor of the week like Ethereum.

Lisps are rarely as immersed in the functional paradigm as something like Haskell. Lisps emphasize practicality over purity, and are designed in such a way that you can do pretty much whatever you feel like.
Anyway, you should probably pick up Scheme if you want to learn a relatively functional Lisp. Won't take long and it's pretty powerful.

Attached: livent.png (1152x648, 21K)

Idris

What can you actually do in Haskell or lisp? I mean, give me examples of useful stuff you can write that's worth learning an obscure programming paradigm

When you learn lisp, it will allow you to reach true spiritual enlightenment, as you discover the beauty of the language.

Haskell is good because of its strong, static and highly expressive type system
Lisps are good because everything is so simple that nothing stands in expressing your intent. They're perhaps not as good at building robust software as proper functional languages, but they're unparalleled in terms of scripting and prototyping.

Scheme for being allowed to sit at the SICP cool kids table
OCaml if you want to be smug about being to be functional AND imperative (and trigger Haskell sour grapes fags)

Written a static site gen in Haskell 2 years ago, and 10 years ago an PHP/ASP/etc-like templating engine in Lisp. The answer is "anything you want". (You better stick with systems-langs where highest-perf is your number 1 priority of course.)

Interesting post
>SML has no libraries
yea I don't know either where this comes from.
The standard library is quite alright. It even has IO, portable system interfaces and sockets.
And there are also huge collections of various algorithms and data structures in SML, so you don't even need to use the ffi for many things.
sourceforge.net/p/tom7misc/svn/HEAD/tree/trunk/sml-lib/
github.com/seanmcl/sml-ext

c

C isn't functional, it doesn't even have closures.

You have first class functions though, and you can make your functions referentially transparent if you really wanted to.

Function pointers are not first class functions.

Scala
It's like Java's non retarded hot sister

why not?
you can store them in variables, pass them around to other functions, and all the stuff you'd expect from a first class citizen.
The only thing you can't do is currying, but that's because C is not built on the lambda calculus.

There are a lot of things about scala that are plenty retarded dude. Java is slowly starting to become the less retarded scala once again.

Clojure is a JVM functional language that was a real pleasure to use for me personally

You can't define nested functions, for starters. First class citizens are no different from any other data type in terms of things you can and can't do, and that's a difference.
It's also standard (generally but also in C) that you can use variables that are in scope for the initialization of any first class data object, so it therefore follows that closures are mandatory for functions to be considered first class.

good point

what are some good haskell books for a hobbyist that aren't 2000 pages?

What hobby you have and why you need haskell for it?

I don't really need Haskell for anything, I just want something to fuck around with in my spare time and it'll purely be a time waster. I sometimes use Scilab at work to help me with tedious tasks and will probably continue to use Scilab there.
I fell in love with Brainfuck some time ago, and that's been my go to time waster for the last few months, but I feel like I'm approaching the limits of interesting things to do in it that my brain can comprehend.
I've used C++ a little, but it's not really that interesting to fuck around with.
I saw a short introduction to haskell and what it's about the other day, and to me it seems like a fun programming language (with a higher ceiling of potential than Brainfuck) to fuck around in

tl;dr: I'm just looking for a hobby that requires a bit more brain power than videogames

>hates javascript even though it powers the web

Such a loser.

JavaScript is garbage. The web should have been powered by Scheme as was planned.

>I just want something to fuck around with in my spare time and it'll purely be a time waster.
Get a girlfriend.

you have been le epic trolled, faggot

but they cost money and requre a personality to aquire

learn about dependent types. I'd say the really cool stuff you can model/do in fp is not evident until you have them. agda is a good language for that.

>Clojure shill incoming.

Clojure is a functional Lisp that compiles to Java bytecode. It has a sibling dialect Clojurescript that targets Javascript. It has built-in primitives for concurrent programming, including aping all of Go's gochannels as a library.

There are literally dozens of us here!

> For the Javascript flamewarriors:

Can I introduce you to Clojurescript? For everybody who has worked on Javascript, watch this video from 7:30 to ~10:00.

youtu.be/j-kj2qwJa_E?t=7m31s

If you want to create web apps, elm is also worth looking into.

For many it's also a gateway drug into Haskell, as it's much easier to learn

>Clojure
I found clojure really hard to get into.
When starting out you first find out about Lein. So you need to set up that first. I wanted to use it in emacs and have a lein repl in it, because that's what I like from other lisps. But there are different guides for that and they all tell things a little differently, which is just annoying and time-consuming when you just want to get started.
Furthermore, when you look for libraries you often find abandoned projects that barely got started before people apparently just lost interest.
Also, the error messages are a pain. The lein repl shows the complete stacktrace and it always took me some time to figure out what was actually wrong. This is especially a problem when initially learning the language and you're unsure about some concepts.

It felt like Clojure really needs a bigger community or something. The language itself is so nice, but all the tooling around it is not quite there yet.

Erlang

WHAT THE FUCK IS A MONAD AND WHY DO I NEED TO USE IT

Attached: 1505273428111.jpg (520x718, 70K)

>WHAT THE FUCK IS A MONAD
As far as functional programming is concerned, a typeclass instance with a bind and return function that follows the monad laws.
>WHY DO I NEED TO USE IT
If it follows those laws then it happens to have the perfect semantics for modelling side effects, which is something you can't otherwise do in a pure language.