Are functional programming languages memes? Should I learn one?

Are functional programming languages memes? Should I learn one?

Was thinking of learning Elixir instead of Go.

Attached: 1200px-Haskell-Logo.svg.png (1200x847, 15K)

Other urls found in this thread:

hashrocket.com/blog/posts/websocket-shootout
github.com/fyookball/ChainBet/blob/master/PROTOCOL.md
techempower.com/benchmarks/
twitter.com/SFWRedditImages

they are fun to use, but not practical in the real world.

Funny I just tried to make a haskell thread with this exact image. I'm about to learn it for smart contract development.

>Are functional programming languages memes?
No.
>Should I learn one?
Yes, OCaml.

Why for smart contracts? Can't you just use Solidity?

I'm not sure why you can't learn both? Besides learning Go only takes a few minutes, its incredibly easy to jump into.

I don't like dynamic languages so you wouldn't find me using Elixir in practice, Haskell perhaps, but monad fatigue is real.

Yes. They'll have their usecases. You are rather focussing on creating an expression, rather than telling the system what to do.

The only caveat here I think is that for sheer throughput, Elixir servers shit over other options. In particular, Elixir websockets serverside blow everything else out of the water.

I don't use it for anything else than this option.

Aren't smart contracts just a meme?

This is for smart contracts on the BCH (Bitcoin Cash) blockchain, not Ethereum.

Learning Haskell taught me more about Java/C#/Python than writing any of those languages every did.

There's definitely ecosystem challenges, but you should absolutely learn one.

bitcoin cash doesn't have smart contracts

>I think is that for sheer throughput, Elixir servers shit over other options
BEAM languages reduce the effort necessary to deliver __predictable__ throughput and low latency. You still can't beat C++ when the goal is to maximize the network throughput, but you will pay a price in development time, maintainability and safety. If you aren't sure, though, of course you should use the BEAM, not C++.

They are both. Yes, you should learn one.
Now you need to go even more declarative and learn Prolog.

do a little bit of research, fren

solidity is a broken javascript-like language. It really is something you would want to use to write immutable and correct software.

Haskell at least as a decent type system that can be used to guarantee program correctness.

How is OCaml's library/tooling situation? I am biased, but it seems to be far behind Haskell on both.

wormhole relies on an unimplemented soft fork and the first version only supports tokens.

>guarantee program correctness
*rule out certain cases of program incorrectness
It may seem pedantic, but it's an important distinction.

too bad for wormhole

I think it was their websockets implementation that got me in. I was researching websocket libs for c++ and all seemed a bit flakey/hacky compared to the websocket load Elixir Phoenix could handle.

hashrocket.com/blog/posts/websocket-shootout

Elixir is slow as fuck on anything that's not ridiculously IO bound and will never be more than a tiny niche. Go is shit but it's far more useful.

the C++ library ecosystem is terrible

agreed. its only in this one department I considered it worthy. Otherwise, all my other shit is in C++

there's nothing else. Are you confusing bitcoin script with smart contracts? "Smart contracts" today mean turing complete computations with state. That would require bch to have an ethereum-like vm and per-account state, an enormous change.

Bitcoin scripts can do multisig and preimage commitents and that's the extent of useful things.

Are you me?

It's okay, not as much libraries as haskell for sure, but it's not bad. Tooling is rather good.

I can _this_ close to considering using facebook's proxygen, then reconsidered my life once I saw I was selling my soul.

You're not looking hard enough.

Attached: Vanilla-Ice-1499954258-640x482.jpg (640x482, 80K)

you are starting to sound like a bch shill. Zero arguments. Go back to Jow Forums

You don't really care about library. You can write your own. And the tools? Emacs+tuareg (or just the ocaml-mode) is perfect for OCaml.

Go is not functional.

You should learn Haskell or maybe Elm.

Elixir or Erlang is also nice, but they are dynamically typed, which is not my cup of tea

Was tempted to look at Erlang but am wondering if I am missing out if I jump straight to Elixir first.

yeah you are right, if anything it's pedantic not to make the distinction. Haskell's type system is not the be all-end all tool to device perfect and efficient correctness checkers. But, you now, it's a lot better than what solidity (or most C-like languages for that matter) provides.

You can easily go elixir first, I don't think it matters.
Elixir is basically just a different syntax for erlang, but the semantics are the same

>You don't really care about library. You can write your own.
Depends on the library. Only a masochist would choose to write his own DOM. It's better to switch languages than deal with it.

D has the best C++ interoperability the world and it's a pretty nice language, fast and even pretty FP-friendly. When you are tempted to use C++ I suggest considering if D fits your case first.

>"Smart contracts" today mean turing complete computations with state.

NO NO NO. Stop saying this, people only think this because Ethereum brainlet devs are shilling the need of turing completeness for smart contracts. The smart contracts class is a lot smaller.

>Elixir is slow as fuck on anything that's not ridiculously IO bound
It's Lua-tier (not LuaJIT).

???

>Elixir is basically just a different syntax for erlang
Stop repeating this. The syntax doesn't matter. Elixir's main attractions are the protocols and the hygenic macros.

I do only back-end stuff with OCaml, so I barely need library. Maybe an XML parser.

Those are nice, but I don't like elixir because of them. I like elixir for all the reasons inherited from erlang.

So I think it's totally fair to call elixir syntactic sugar for erlang, just with some extra features.

meanings change. People insisting that smart contracts = any transactions with code are in the same class as people insisting to call linux gnu/linux.
>the need of turing completeness for smart contracts
that's proven true by, ironically, bch devs. They are forced to split their timelocked preimage commit/reveal schemes into several transactions, not realizing that what they are actually doing is emulating a loop (or recursion).

>The ChainBet protocol operates through 6 phases. Most phases require a communication message to be sent across the network. This is accomplished by broadcasting a BCH trasnsaction that contains an OP_RETURN output.
(there are actually 7 steps including withdrawal)
github.com/fyookball/ChainBet/blob/master/PROTOCOL.md

The moment you start doing shit like this you're proving that turing completeness is a must. Phases 1-5 could be done in only one transaction on ethereum.
The state issue is even worse, because emulating it requires copying the entire state everything in every transaction which makes any non-toy use impossible.

This transaction count explosion is going to be worse and worse the more complicated the protocol becomes. It's also inherently limited to timelocked fraud proofs, making things like fomo3d impossible.

write your own pure functional DSL in c++
infact, c++ and c consistently win most pure functional programming contests

Name a few such contests.

cardano.org

vaporware.
Show me a smart contract on cardano's mainnet. I will wait.

Elixir and Phoenix is probably the best web framework to work with syntactically. And the performance is good so why the fuck not?

Golets need not respond.

I'm not sure, but go ahead cause broadening your horizons is perfectly fine. Apparently one guy who worked at IBM once told me that he used Scala a lot to process some math stuff and do some data work. I personally don't know too much.

Any opinions on F#?

it's a good one if you need to get work done and you are coming from a background in imperative/OOP languages (esp c#). If you are just trying to learn, try haskell but ignore all the monad tutorials and don't even bother trying to understand what a monad is, (until you have a need to make your code more generic).

Thanks

>And the performance is good
>muh whatsapp

Outside of bullshit benchmarks made by Elixir sycophants the performance is bad.

techempower.com/benchmarks/

Even at strictly IO bound problems, where it should excel, it's about the same as other shitty dynamically typed languages. At CPU bound problems it's even slower than shit like Ruby, Python and PHP. Unlike the Elixir community, the Erlang community at least has the sense to admit that it's terribly slow and that they use it for other reasons.