TwistingTwists

TwistingTwists

Pattern matching in other languages

I just noted that pattern matching of some sort was introduced in python 3.10

I guess there is destructuring in ES6 syntax in javascript.

I wonder

  1. How are pattern matching in these languages differ?
  2. Who started pattern matching first? :rofl: Which language?
  3. What are other ideas you have seen being adopted outside Elixir which were Elixir originals? :sweat_smile:

First Post!

Sebb

Sebb

Afaik, no one outside Erlang-world can do binary pattern matching (which is really great if you need binary pattern matching).

Pattern matching is not an Elixir nor Erlang original.

Most Liked

dorgan

dorgan

The original implementation of pattern matching in erlang is based on this book https://www.microsoft.com/en-us/research/uploads/prod/1987/01/slpj-book-1987.pdf

Sebb

Sebb

when you bring up this great book, I have to say, that Peyton Jones and especially Wadler are fantastic speakers. This is one of my favourite talks and the best plea for functional programming I know: https://www.youtube.com/watch?v=IOiZatlZtGU
(You can safely skip the exhausting minutes 9-24 if you’re not “ready to learn about the hilarious subject of comptutablility theory”)

josefrichter

josefrichter

Rust also has quite nice pattern matching: Redirecting...

Came to use Rust only recently, trying to write some smart contracts for terra blockchain. In many ways it reminded me of Elixir actually, with similar terminology and some of the goodies we like in Elixir. Going to Rust from Elixir might actually be easier than from any other language. It felt very friendly really, I like Rust :slight_smile:

Where Next?

Popular in Discussions Top

jesse
Hi everyone, I hesitated to post this here because I don’t want you to think I’m spamming, but I’ve been working on a Platform-as-a-Serv...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New
pdgonzalez872
If this has been asked here before, please point me to where it was asked as I didn’t find it when I searched the forum. Maybe a mailing ...
New
klo
Got a question about when to concat vs. prepending items to list then reversing to achieve appending. So i know lists boil down to [1 | ...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New
arcanemachine
https://nitter.net/josevalim/status/1744395345872683471 https://twitter.com/josevalim/status/1744395345872683471
New

Other popular topics Top

New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
shijith.k
I am trying to start a new phoenix project with elixir 1.9, but mix phx.new does not work. It says that ** (Mix) The task "phx.new" could...
New
saif
Hello everyone, Long time lurker first time poster here. I’ve recently begun working on Elixir full-time again! :raised_hands: It’s been...
New

We're in Beta

About us Mission Statement