Best Functional Programming Language for Home Projects?

Multicore OCaml is nonexistent
F# is a dead language
Scala could be great, but is currently limited by the JVM
Every variant of ML is quiet or dead
Clojure is great, except those startup times and typed Clojure died a long time ago
Frege is dead
Erlang/Elixir are amazing at distributed parallelism, but records/structs are gimped types
Kotlin is pretty nice, but only as a replacement for Java
If you thought Haskell was academic, take a look at the state of Idris...

Is Haskell the winner by default?

Attached: haskell.png (1200x847, 15K)

Other urls found in this thread:

softwareengineering.stackexchange.com/questions/157684/what-limitations-does-the-jvm-impose-on-tail-call-optimization
r-bloggers.com/fizzbuzz-in-r/
twitter.com/SFWRedditGifs

Python and Go

by default yes
i have hope in dotty tho

unironically python is the best..... quite sadly

Scheme, unironically

python's not best at anything.

cope

probably. haskell has a pretty big community (relative to other functional languages), so there are lots of resources for it too.

dont code in haskell it will make you frustrated when you can't do certain things in other languages like infinite tail recursion

Depends on the project. If just for learning I think haskell wins

Lambda calculus

There's a reason imperative programmers become functional programmers and never the other way around

use whatever. why do you feel the need to be told what to do? do you not think by yourself?

just checking since I might be missing some info that Jow Forums might provide

>Scala could be great, but is currently limited by the JVM

Uni fag here who is learning Java and C, can you explain what you mean by this? Scala always seemed interested to me

>If you thought Haskell was academic, take a look at the state of Idris...
RedHat wasn't complaining when i did my BSc in Idris for them.

Learn Kotlin, Scala is dying/dead

imma need a bit more of an argument here m8

what does that even mean? A company is giving you an opinion on what language you use for your computer science class projects?

what I mean is that the JVM does have some limitations which the Scala creator acknowledges, such as the lack of proper tail recursion (yes in Scala you can do it, but it's a workaround).

See here softwareengineering.stackexchange.com/questions/157684/what-limitations-does-the-jvm-impose-on-tail-call-optimization

But you can find other examples. Not deal breakers of course, but another example is the garbage collection. Akka cannot compete against Erlang OTP on the same level because of the JVM's garbage collection method. Each erlang actor has its own garbage collector so there is no stop-the-world pause like in the JVM. Latency is minimized in the Erlang actor model, and that's just a tradeoff you have to accept when writing Scala and using Akka for concurrency.

Still, not a dealbreaker for writing functional code, but there are several small asterisks like that to consider.

I also think Scala syntax isn't pleasant to look at. Furthermore it seems to attract undesirable code styles e.g. people using it like Java.

Statsfag here. Is R considered a functional programming language? When I think of Haskell I assume it's more difficult than what I'm doing, but there's no shortage of right parentheses in R either.

R cannot be compared to other normal languages. It's a niche language used for statistical modeling. It's easier to do certain things in R than it is in Python e.g. linear models. Python is a better overall language imo because it's just so clean and simple to use. A lot of things can be done in Python more quickly than in R

divisor

R is a specialized tool, like SQL, more than a language. Haskell is intuitive if you come from a mathematical background.

Thanks for clarifying. I don't know if you came up with that as a fizzbuzz demonstration but it's funny that one would need to use sapply, ifelse, and paste0 in order to get the same result that would be a trivially simple program in other languages. Those things are important, but generally not what you would learn first. When I call R easy, I mean that it's easy to run regression, decision trees, etc. on data I need to look at somehow.

I have a BS in math and it's not intuitive. I've never seen category theory offered in a math department... and I don't just mean my own school. I've checked around, it's just not a subject of study for math people.

I just googled r fizzbuzz and saw this

r-bloggers.com/fizzbuzz-in-r/

You don’t need to know anything about category theory to understand Haskell.

Why are functional programmings languages that aren't clojure and elixir so fucking ugly.
Fuck off with that mandatory whitespace and brackets

>Clojure is great
Correct
>except those startup times
Have you tried GraalVM?
>typed Clojure died a long time ago
Why would you say so? I see last update on core.typed is 2 months ago.
The split repositories have been updated in the last week.
And what do you need typed Clojure? Would Spec or Schema be good enough to address your needs?
Just use Clojure OP, she's a good girl.

Just use Rust

>implying you understand haskell

This.

>A company is giving you an opinion on what language you use for your computer science class projects?
A company wanted some tool developed.
A company didn't have a worker with required skillset.
A company wanted to minimize expenses.
A company collaborates with university.
A university evaluates the project as BSc/MSc thesis.
A university offers it to students.
A student picks up thesis topic.
A company has a say in which tools it wants their tool to be made with, since they will be maintaining it.
A company has (effectively) no say in what theoretical background will be underlying their tool.
Is it more clear now, or do you need to explain more about how non-shit unis collab with companies?

>he works for free
Oh I see now

let me get back to counting my money

>implications
I secured a senior-level positon for just one session of convincing some manager retard that Idris is fine to use and about two man-months of work.
Oh and i can put it on my CV as work experience without it being irrelevant, like 99% of BSc theses are.
Just the ~5 year career boost before i'm even done with uni is worth it for me.

Attached: yukari_smile.png (746x676, 445K)

While you can perfectly use Rust and write your programs in a functional fashion, you don't answer OP question and therefore fuck off

Why you have mention Kotlin in the context of functional languages , you fucking inbreed degenerate?

Stick to your node_modules faggot

Welcome to Node.js v12.4.0.
Type ".help" for more information.
> ['1', '7', '11'].map(parseInt)
[ 1, NaN, 3 ]
>

I don't understand wtf is happening there

No way this is real. It can't possibly be this fucked up.

> ['33','11'].map(e => parseInt(e))
[ 33, 11 ]
> ['33','11'].map(parseInt)
[ 33, NaN ]

wtf

What about Eta? (Haskell on JVM)?

Attached: apu.png (1210x1190, 116K)

What did you implement? I've been wanting to get into Idris for quite some time now, how's the progress on Blodwen?
What's your Haskell level?

>le academic language meme
IF ONLY.
This meme has to die. Step in every college nowadays, and you'll almost certainly find a Java/Python school.
Most people now graduate in CS without even hearing about FP. It's sad.

>What did you implement?
Automatic extraction of descriptions for one of their (and some slav uni) verification tools from C source.
>how's the progress on Blodwen?
No idea. I use Coq. I wanted to try Idris, so i did.
>What's your Haskell level?
Proficient, i guess.

>You don’t need to know anything about category theory to use Haskell.
ftfy
understanding the minutae of haskell and being able to use things like monads are two different things.

F# is far from dead.

parseint accepts a second parameter, map sends an index as the second parameter

so you're converting in base 1 a number, which returns NaN


> I don't know how to write stuff so language is shit

yeah no, only for uni stuff, never seen of heard about a real implementation (actually I've seen that it's not only overcomplicated but also slower)

just use rambda.js ezpz

> backend standard
haskell, unless you like implementing shit from scratch
> front end web
purescript, reasonML, elm, in that order
> god tier types
coq

Lisps. Common lisp and Gnu guile are great. They have top tier functional shit, but are also the best at object oriented if you need it. You may also use lisps which can compile to other languages (like fennel to lua or chicken scheme to C)

Pick a scheme implementation you like and you're off to the races.

>Lisps. Common lisp and Gnu guile are great.

Because they're not 'functional'.

>They have top tier functional shit, but are also the best at object oriented if you need it.

Exactly. Common Lisp still has the single most powerful object system in any language to this day. Why other things don't steal the fuck from it is anyone's guess.

>Scala, Erlang, Elixir, Kotlin
Not functional languages.
Scala is multiparadigm, Erlang is concurrent, Elixir is basically Erlang for brainlets and Kotlin is java for sperglords redditfags who shills "java bad! java bad!".

Purely functional is useless. give functional priority and use objects when you need to.

>Home projects
>muh dead lang
>muh multicore
>muh ecosystem

Functional does not mean 'don't use objects'. It means 'don't bind up data with operations on that data in a classical inheritance model', 'avoid exceptions by creating functions that are both pure and total, using data structures that can safely represent failure' and 'maximize code reuse through optimal use of closure, curry, and composition'. Usually in a strong static typed environment using hindley-milner. (which rules out every lisp environment I know of).

what an absolutely brainlet definition of functional programming

R has much better integration of ML algorithms as well, although python is more robust overall. you can basically go get any cutting edge algorithm on R day 1 and start using it and implementing it easily wheras python is a lot clunkier. the idea of scikit-learn at all for example is weird for a R user since you can just get whatever algorithms you want without relying on a bundle.

Care to offer a better one?

No but I'd start by not saying things like "it's not OOP" or "It's Haskell" which is essentially what you wrote

How is Python a functional language, it's not optimized at all for this paradigm and will probably never be

Maybe a Scheme? Have you tried Racket?

F# can't be dead. It has Microsoft behind it. They use it to verify device drivers.
Clojure is okay if you use clojure.spec + generative testing + REPL.
Speaking of Haskell, have you tried Eta?

Attached: raccoon+.jpg (236x289, 23K)

F# is dead. Long live F#.

Type-checking? A warning for a mismatch of number of arguments in *non-variaidic* function?

just fuck you

>They use it to verify device drivers.
You meant F*, Z3 and VCC.

thanks for clarifying

clojure is great

Have you looked at Clojure?

No, it's also garbage.
And all of those things deserve their painful dead, because they couldn't manage to fit between one-trick pony and bloat.

>Second parameter as zero is interpreted as an acceptable base (probably defaults to 10)
>map passes index as second parameter because yes
Utterly retarded API, why would you want this behavior? Any half decent language maps over the actual elements of the list and if you want indexing you can zip or enumerate or whatever. I bet you defend the retarded casting behavior because "it's in the spec xddd".

>>map passes index as second parameter because yes
this is actually sensible imo,
in javascript if you pass more arguments than a function has then they get silently ignored, and I think that's correct for a dynamic lang.

>something is massively fucked up and silently produces errors, and I think that's correct for a dynamic lang.

> Go
Opinion immediately discarded

F# isn't dead OP, considering you can use any .net library from f# extremely easily f# will only die if c# dies.

Haskell as a language itself is probably the best of the bunch, but you'll have to deal with it's god awful tooling, and the community seems to have a weird opposition to any kind of documentation, instead opting for oftentimes cryptic type signatures. Also good luck supporting windows lol, the windows support is a Trainwreck. This is coming from someone who's favorite language is Haskell. If you plan to support windows either make damn sure ahead of time what you're doing is supported, or just use f#.

"silently producing errors" is hard not to achieve with "not getting in your way" and that's the whole point of dynamic langs. Might as well complain that (car nil) and (cdr nil) are nil

Ruby is functional and based

>Erlang/Elixir are amazing at distributed parallelism, but records/structs are gimped types
what does that even mean? are you trying to compare records and structs in Erlang/Elixir to OO class types?

>Is Haskell the winner by default?
no, Elixir wins, Elixir can do everything Haskell can with sane syntax. You gain nothing with Haskell, monads gain you nothing and are just an experiment that failed

The core of a monad is the sum type. That's what is useful about it. Being able to boil IO down to successful operation and their results, or failures, and represent them with one type so that illegal states are unrepresentable...that's useful. But it's also in F# and other languages with sum types.

>coq
idris

>tfw too brainlet for elixir

Racket is the answer.

>using a language that does not represent the hardware it is running on

Chicken scheme, not strictly functional but easy enough to only write in a functional style.

>but records/structs are gimped types
How exactly are they gimped?

>Go
Go is firstly a lite oop language and secondly a lite fp language. But a functional lnaguage is almost useless without generic algebraic data types.

What language do you use?

I am so so sorry, elixir is literally erlang for brainlets. If you cant into elixir, you have absolutely no chance at erlang(and I wont even mention OTP)

So guys, do we care about functional programming because it's the newest frontier for white male programmers where normies, women and ethnics dare not venture?

Attached: a.jpg (480x480, 38K)

most efficient syntax

What do you people think about AI and functional languages? I have been looking into erlang and its concurrent lightweight processes and it seems it could be used for AI development, though there are limitations

people seem to get the concurrency they need from graphics cards so I don't see Erlang getting much use

As I understand with graphics cards you generally run the same code but the data input is different, thats why stuff like encoding, image processing can be sped up so much, with erlang while its probably no where near as efficient as gpu, each process can run its own (different) code and data input

>I am so so sorry, elixir is literally erlang for brainlets.
This is why FP threads on Jow Forums is always hype and posing. Most FP languages used on the web add a lot of complication for negligible advantages. Elixir and the Phoenix framework gives huge out-of-the-box advantages with almost no extra complication of use over a framework like Rails. In fact using frameworks like Rails and Node will eventually require very complex solutions to problems that simply don't exist in Elixir/Phoenix from the start.

>with erlang while its probably no where near as efficient as gpu, each process can run its own (different) code and data input
deep neural networks is basically running the same code over and over on huge datasets, so there is no need for the kind of concurrency that Erlang processes offer

>he didn't study topos theory during Part III

That's not even valid for C you dumb fuck

>newest
It's 46 years old at least. Even older if you count early Lisp as a functional language.

Deep neural networks hardly even qualify as AI

its a subset of AI and is currently the most productive as far as giving tangible results

> require very complex solutions to problems that simply don't exist
Pardon my ignorance but can you give a few examples? I have been using Rails for a while now and I am looking to move to Elixir+Phoenix. What out-of-the-box advantages does Phoenix have?

I don't understand the obsession with FP, for a lot of use cases you have to jump through a lot of stupid shit that would not be necessary in an impure language.