Functional Programming

Pick a language to use for the next 5 years for all of your hobby projects.

Attached: Functional-programming-languages.jpg (638x479, 56K)

Other urls found in this thread:

mnielsen.github.io/notes/parentheses/index.html
twitter.com/NSFWRedditVideo

>lisp
This shit is as old as Fortran, people who shill this language here are retards

>erlang
Outdated shit, use elixir

>elixir
OK

>Haskell
Great language but too many pretentious fags who go around talking about Haskell because they think they're cool for doing functional programming or repeating the definition of a monad to sound intelligent on their favorite anime imageboard

>OCaml
>functional
kek, they ruined it with OOP garbage

>Scala
Don't know anything about this

>Clojure
There is no good Lisp dialect

kotlin

so which one between elixir and haskell?

I'm already using Haskell, but I wish there were more jobs towards it. Maybe I'll have to learn Clojure.

You forget Racket

I haven't used much Elixir so I'd have to go with Haskell. But from what I've seen it's not bad.

only my own custom version of forth

Attached: 1548406484335.jpg (557x651, 232K)

A monad is just a burrito bro.

Haskell

Lisp.

>no SML
fuck you

Based poster, the only sane, no frills functional language these days.

Easy, Scala.

I want to learn Erlang or Elixir but am kind of on the fence about which. Opinions?

Attached: different.jpg (500x359, 33K)

I hate haskell with a buring passion, but at least I know that one.

Isn't SML deader than Lisp and Scheme? Why not just use OCaml or Haskell?

Yeah, I'm going to pick perl.

Elixir and Scala are the only useful ones for me, because they have actual uses in the real world.

Elixir -> web dev stuff with phoenix, websocket, basically any chat/pubsub stuff, literally anything that might want to run concurrent services at any point in time ever
Scala -> big data memes

I've never used scala though but I love elixir, by far the best dev experience so far.

>language is stupid because i don't understand it!!!!

Haskell, desu ne

Scala.

Not the purest of FP, but it has a better track record of getting shit done and into production than the other languages here. And it is a language with a good ecosystem.

Clojure, because I have some experience and I find it generally comfy.
elixir would be my pick otherwise, seems interesting.

>who shill this language here are retards
>t. retard

Where my Prolog bois at

based && redpilled

Haskell 100%
started learning it like a week ago and it’s the most fun I’ve had programming, I’m going through some of the beginner books for it and for once I’m enjoying myself enough that I feel inclined to just toy around with the language while I’m learning about it

what about Go?

>no LLVM SSA IR
dropped

why are functional languages so slow when fast language still compile into functional form?

It says functional programming you monumental retard. Go play with Google shit somewhere else.
Scala, Haskell or Ocaml (in that order. I use Scala at work). I hate dynamic typing with a passion. Erlang is based as fuck though, but the prolog-like syntax is attrocious.

>Erlang is based as fuck
Try elixir, it literally a fix for the syntax, and adds some abstractions to make other bloated things easier to use. And you can still call and use erlang and all erlang features interchangeably, if you want.

>func on rust when?
It's like a lesb who also squirts. Sweet jewish nectar.

OCaml obviously

The only difference is syntax and a few minor changes. I would recommend elixir since its syntax is much easier to understand

>Common Lisp
>functional
regardless, common lisp

>Functional Programming
>No F#

Enjoy your after school activity languages.

they have ocaml. it's would be like putting every lisp dialect in pic, however, they miss ur which is haskell on steroids

This makes no sense. If I can use the entirely of even one language, I can implement another language in it. It isn't difficult to implement an interpreter for 95% of Scheme. Disregarding that, if I really had to choose a single language, I'd pick Haskell. It compiles to native code and has good C interoperability. Picking a JVM or a BEAM language would limit what you could do.

I did. It's nice but the fact that it looked a litte like Ruby already gave me PTSD. Plus I still have to define two functions if I need to pattern match by two different criteria. Doesn't fix the Prolog issue either.

Why no F#?

Is. D "functional"?

What's the consensus on guile?
I want like scheme but I'm looking for something that's actually used in current year

Currently learning Haskell. I admire the incredible expressivity, but laziness is honestly kind of pointless right now, and now I have to learn strict io. The big flaw in the language seems to be the ease of use of lists over anything else.

I don't know anything about functional programming but I thought Lisp was different from say Haskell. What's the deal with all the parentheses? Are those just syntactic sugar or whatever?

*blocks your paths*

Attached: 4BBF26E8-AF67-448B-8D9C-5663AF8D93DB.png (112x180, 16K)

Nah, they just made Lisp very explicit. One consequence:

mnielsen.github.io/notes/parentheses/index.html

OTOH of course almost everyone else decided against this, even among FP languages. It's something most people just don't like in the language's syntax.

Scala-native exists, and actually anything on the JVM can still be compiled to native code (used to be GCJ in the past, now it's usually GraalVM or Excelsior).

> something that's actually used in current year
I think that suggests not using guile.

Yeah that's going to be a Matlab from me

Attached: 960-1-590x332.jpg (590x332, 24K)

learn erlang, to fully understand and use elixir you basically need to know erlang anyway, also elixir in my opinion is abomination in some ways because it tries to combine erlangs functional paradigm with object oriented elements, thats why oop people even consider trying elixir because pure erlang is too complicated for many

>old as Fortran
So what? Languages aren't milk.

>Outdated shit
See lisp

>kek, they ruined it with OOP garbage
More features is better. If you need them, you use them. If you don't need them, you ignore them.

>too many pretentious fags
You could just shut the fuck up. Fags
aren't language's fault.

Racket is ok

Yeah but surprise lisps aren't functional and never were. Actually, the only truly functional language is Haskell, other has imperative features.

Common Lisp. Still unmatched with language/compiler level extensibility + advanced object system + image-based live coding + error/“condition” handling + various great implementations etc. etc. Also not really functional but close enough.

Nah.

Racket is one of the more active schemes. If you want something simpler and with good performance go with Chez.

Common Lisp is not a functional language
Kotlin is not a functional language

There are companies that use Erlang with bigger markets than Elixir has with webshits. Same with OCaml, Haskell, and Lisps.

What if I want to write my own? Just have it compile down to C or assembly

Scheme

The most popular Schemes are Racket, Guile and Chicken. I prefer Chicken but if you're looking for an active community then Racket's the way to go.
>Yeah but surprise lisps aren't functional and never were.
Thank god.

ReasonML

fuck you.
all my hobby projects are around vulkan/opengl, C++ is the only answer.
just use lambda and templates to simulate your functionnal trash

I'd prefer elixir because it makes a much heavier use of concurrent processes and pattern-matched mailboxes with explicit recursion (there's no such thing as infinite loops, you just call the function again at its end)
But I guess haskell because of its maturity and support

I've pretty much only used Chicken Scheme, Racket and Haskell. I prefer Haskell, but some things are permanently annoying like IO in Haskell, and 2D arrays. Also FP fails for situations where stateful data structures are best used, like hashmaps

I agree with if you're using lists then you're gold, but outside of that things can get annoying

I love Scheme, Clojure, F#, but man do they all have gaps in their applicability.

I want a native-compiled ML that's concurrency-ready. Something with simple base syntax like F# (none of OCaml's stupid semicolon sprinkling), nixes the object system of F# and OCaml in favor of simple data structures like maps, lists, records, and algebraics, can be JIT-compiled or AOT-compiled with optimizations, and has tons of batteries and a nice package manager.

Basically an ML that has all the utilities and scaffolding of D or Python.

why is functional such a fucking meme?
Its almost entirely made up of one-liners that take longer to run than the shit they're based on and are fucking impossible to maintain the codebase for. WTF?

There are a very large subset of problems that are very easy to solve and implement using functional programming.

Neither of these is the case.

And FP is virtually necessary to program code to run concurrent and/or distributed. Yes, even across CPU cores, there is not much else that really works.

It doesn't matter if you're still programming, say, Java, what you code against Apache Spark is mostly FP.

>only truly functional language is Haskell
There is no way you're legitimately retarded enough to think this is true, and I'm not even talking about how Haskell is not even a functional language in the first place.

>none of OCaml's stupid semicolon sprinkling

shit like this is why I've been switching to reasonml. added plus of it looking more C-like for functionlets.

>it makes a much heavier use of concurrent processes and pattern-matched mailboxes with explicit recursion (there's no such thing as infinite loops, you just call the function again at its end)
thats erlang, not sure why you need elixir for what erlang can perfectly do on its own (and even do it better)

Elixir is syntactic sugar and language extension of erlang. Erlang syntax is fucking retarded.

I can get that. A lot of programming problems are fundamentally mathematical, so applying it in a mathematical form provides a more sensible straight-forward means of expressing those problems.

Its difficult to maintain one-liners, lisp is a perfect example of that.
Furthermore, without parallellization functional is slower than procedural (and sometimes even OO). I will grant that given the problem of parallellization and distributed computing, that functional is less of a headache and thus easier to maintain than procedural (in most cases).

the syntax is fine, if you cant use for whatever reason then you are retarded

pic related is everything a successful dev needs to know about functional programming. everything else is just academic brain farts

Attached: linq.png (758x414, 59K)

F*. Dependently-typed F#, with a subset called LowStar.

based

> Its difficult to maintain one-liners, lisp is a perfect example of that.
Even if Lisp did have that issue, the language is not representative.

And good functions composed of functions are the easiest thing to reuse and edit.

> Furthermore, without parallellization functional is slower than procedural (and sometimes even OO).
They are all equally fast. If course real objects can have more RAM usage and some functional or procedural arrangements of code are hard to optimize for predictable performance without major rewrites. Other FP arrangements are strongly for that, though. It depends in reality. The FP purists havent found out how to combine code golf with maximum performance, but neither is that the case for procedural code.

>programming outside of work

>Haskell is not even a functional language
What is? Name your criterion.

none of these shit shows.

>not programming outside of work

Common Lisp is objectively the most powerful and flexible language in existence, but its standard libraries are somewhat dated.

Haskell is also very nice.

t. brainlet

>What is?
Any language which is provably functional (as per the usual definition of "functional"), obviously. Husklel is provably non-functional because of shared mutable state not being a type error. You can write functions in the language, but that doesn't make the whole language functional.

>couldn't name one
Thanks for proving you're full of shit.

You're pretty stupid for needing people to name you a language which is functional; that's pretty trivial to do if you don't require anything else. Try thinking about it for a bit and maybe even you can come up with something. As a hint, try thinking of the simplest language possible.

this. so many years later and still no lang can match lisp features
why?

>I-it's not functional because I say so!
>Baka, you don't even know my secret functional language (with no IO because that breaks functional)!
ib4 you say something retarded like Math and try to claim its a programming language.

Attached: smol.jpg (800x450, 44K)

Please, for the love of God, don't tell me you want me to say "lambda calculus" when the question was clearly about an existing, implemented, usable programming language.
Please, let me keep what little faith I have in humanity.

You can thank Unix and C for that.
Nearly every single "development" in programming languages for the past 40 years has consisted of nothing but rediscovering what Lisp already offered 70 years ago.

That's a silly definition. For one thing, you can design a "provably functional" language with no concept of mutation at all that doesn't even have a type system. Where does Haskell allow shared mutable state outside of IO, which is a proper type, and you deliberately telling the type system to fuck off at your own risk? If you are complaining about shared mutable state in IO, you are complaining about being able to do I/O at all.

It's pretty obvious user is asking for nontrivial real-world examples, not NOP the language. I think Miranda had no way to express mutable state.

>I-it's not functional because I say so!
I literally gave you a reason why it's not functional, you retard. Maybe you should try discussing this on with people around your intelligence level? You're clearly not ready to properly parse and comprehend simple English text.
>my secret functional language
It being a secret to you just goes to show how simple-minded you really are (as if someone couldn't already tell that by the picture you chose to attach to your shitty post).

>existing
How can a programming language (with the only requirement of being functional) not ""exist""? You are making zero sense here.
>implemented
The functional language I'm talking about is easily implemented by your brain. Try actually using it for once.
>usable programming language
How can a programming language be ""unusable"" exactly? Maybe you mean "usable by retards like me"? If so, I don't really know what's usuable or unusable by you, nor do I (or anyone else) give a fuck.

>The functional language I'm talking about is easily implemented by your brain. Try actually using it for once.
oh dear, it's worse than I thought

Attached: brainless.jpg (300x256, 27K)

I like your style, user. Honestly, your pretending to not understand common words and haughty attitude are making me horny. I imagine you look like a smug anime girl. If it were possible, I'd take here and now by force.

How is the trivial definition of a functional language being functional silly? You're not making much sense right now. How is the existence or nonexistence of a type system (not the properties it has, just existence/nonexistence) even remotely relevant to the language being functional? You're not making much sense again.
>Where does Haskell allow shared mutable state outside of IO
I can trivially define a type right now which allows me to use shared mutable state.
>which is a proper type
As opposed to an "improper" type? What do you mean by that exactly?
>If you are complaining about shared mutable state in IO
Shared mutable state (trivially) implies non-functionality. That's quite simple to see even for someone with severe brain deficiencies. Me merely stating this as fact isn't complaining, I couldn't care less about Husklel having or not having shared mutable state. I prefer to not waste my time on silly hobbyist projects.

>It's pretty obvious user is asking for nontrivial real-world examples
I don't see that anywhere in his post. Also, how can an example of a programming language be ""non-real-world""? Fiction is part of the real world by virtue of being created by humans.

Yeah, I can easily imagine how trying to actually use up the space in your skull for something productive for once in your life might cause you pain worse than you ever thought.

>express mutable state
Also, this conflation of mutable state and shared mutable state you're making is quite laughable.

\+ functional(prolog).

The fuck is that?

It's a horse dildo with the sun rising behind it.

Nice projection