dwyl / dwyl/learn-elixir

Elixir is harder than you think

Open
#215 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Elixir
Stars
1.7k
Forks
112
PR merge metrics
No merged PRs in 30d

Description

An open discussion: Elixir maybe harder than you think to get it speedy. It is VERY easy to write "inefficient" code.

Some examples:

- [this video](https://www.youtube.com/watch?v=Y83p_VsvRFA) is a good example on how to write beautiful but inefficient Elixir code.
The todo:
![Screenshot 2024-07-15 at 15 41 57](https://github.com/user-attachments/assets/c93d43d4-b902-405d-8bab-f3f73fbfd2de)

The first "poor" first "natural" version:
![Screenshot 2024-07-15 at 15 39 52](https://github.com/user-attachments/assets/6d8fead0-bff2-4e1d-a37f-dd273e2bc4e1)

- a very instructive [video](https://www.youtube.com/watch?v=cONM2YwCO0Y). A comparison of using tuples vs lists vs maps. In particular, `:erlang_disasm.file` and the add-on `beamdasm` if you are very curious.

![Screenshot 2024-07-15 at 15 36 04](https://github.com/user-attachments/assets/9101699e-6777-4028-b52f-0a2b40686240)

- [Another video](https://www.youtube.com/watch?v=ICZKZQowiHs). The [repo](https://github.com/groovemonkey/go-elixir-benchmark) with the Go and Elixir 1 & 2 versions.
The todo: **repeatedly pick a random element from a large list of words**

He "solved" the issue of constant time access by using the AJA library
[![Screenshot 2024-07-15 at 17 52 28](https://github.com/user-attachments/assets/0cc9fb18-b25b-4cf8-9fa8-225531bb25ce)](https://github.com/sabiwara/aja)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.