Erlang and Python Codejam
If you can read this Erlang code jam, the syntax is kind of insane. Just think about it. This is how to manipulate primitive types in Erlang. But not just that. After that is a Python codejam. Python is my main language. It will be fun to compare.
Here are list, tuple, and zip two lists in both languages. But, first, a short background.
My Story
I’m new to Erlang. I’m on page 110 of Joe Armstrong’s book, Programming in Erlang, 2nd.
Erlang is an interesting language. The first time that I tried to learn Erlang, about 1 year ago, a good friend said, “wait until you see pattern matching.” I was reading this exact same book, and was to about page 70, and I still hadn’t seen pattern matching.
My interests changed, and I gave up reading the book. I had gotten so stuck on Tensorflow Extended (TFX) and had paused any project coding because I was so frustrated. 2 months ago, I started reading the book after hearing in May 2019 of Joe Armstrong’s untimely death.
TFX had promised me an end-to-end pipeline. There are about 9 steps. When I got two thirds of the way through to the transform
step, I got so frustrated with the objects involed and their api. Whatever I was trying to do wasn’t working. I gave up.
In May, I stated reading “Erlang Programming 2nd Ed.” by Joe Armstrong. So, if I do the math, in 60 days I have read 110 pages, so 2 pages a day. Ouch. Okay, that’s kind of bad. Either way, here is my progress. Maybe I only got serious in the last month, and I’m being hard on myself. Enjoy.
Python and Erlang
Let’s do Erlang first. I’ll build myself up for Python. Python is my main language, so I’ll show that last.
Erlang
Map, List, Tuple, Zip Code Example
And from there, I could get back to where I eventually was.
Python
Map, List, Tuple, Zip Code Example. Here is the Python codejam. Enjoy.
Wow, that was a world tour of Python. The slicing here involved lists, where the Erlang slicing used Binaries. Both were slicing of data structures.
Verdict
Okay, hands on the keyboard verdict. Both were amazing! Okay, until next time. Thanks for reading.