4 ms·
> I always want to try and never find a good reason to As someone who learns best by doing, what are some practical projects that someone could do to learn Eli
by linux2647 6y ago
> I always want to try and never find a good reason to
As someone who learns best by doing, what are some practical projects that someone could do to learn Elixir? I know that Elixir is quite capable of solving certain kinds of problems very elegantly, but maybe my experience hasn’t presented these kinds of problems yet. Outside of building a Discord-like server or a Phoenix web app, what other good practical projects/applications are there for Elixir?
- anko 6y agoif you need to do some batching operations such as read from a queue, do some processing and publish to s3, I can recommend Broadway https://github.com/dashbitco/broadway https://github.com/dashbitco/broadway I have seen lots of codebases in lots of languages do this type of task, but aside from maybe spark on the high end, i haven't see it done better. The beauty of erlang is your code reads like synchronous code so it's easy to read/maintain, but it has all the power of the parallelism of async code.
- searchableguy 6y agoRobotics/iot applications.
- dnautics 6y agoI'm probably the crazy one in the community who is using Elixir for the most super-strange things. For example: - as a custom DHCP server to do multiple concurrent PXE booting (among other things) - as a system for provisioning on-metal deployments (like ansible but less inscrutable). - as a system for provisioning virtual machines over distributed datacenters. I'll probably also wind up doing DNS and HTTP+websocket layer-7 load balancing too by the end of the year. Probably large-size (~> 1TB) broadband file transfer and maybe even object storage gateway by next year. I've rolled most of these things out to prod in just about year. I honestly can't imagine doing all of these things in Go, without a team of like 20. Elixir sucks at: - platform-dependent, like IOS, android, or like SDL games or something, - number-crunchy, like a shoot em up, or HPC. - something which requires mutable bitmaps (someone this past weekend brought up "minecraft server"). Actually even desktop might be okay, especially if you pair it up with electron.
- grantjpowell 6y ago> Elixir sucks at: > number-crunchy, like a shoot em up, or HPC. > something which requires mutable bitmaps (someone this past weekend brought up "minecraft server") One thing I'd like to see for the BEAM communities long term are well maintained libraries of NIFs[0] for high performance and possibly mutable data structures. Projects like rusterl[1] and the advances made on dirty schedulers make this more feasible than it used to be. It would be cool to write all the high level components of a minecraft-esque game in Elixir, and drop down to rust when you need raw performance. Similar to the relationship between lua/c++ in some modern game engines [0] http://erlang.org/doc/man/erl_nif.html http://erlang.org/doc/man/erl_nif.html [1] https://github.com/rusterlium/rustler https://github.com/rusterlium/rustler
- dnautics 6y agoI'm in agreement; though I don't like rust (can't read it) and am the author of https://hexdocs.pm/zigler/Zigler.html https://hexdocs.pm/zigler/Zigler.html
- linux2647 6y agoThese are some good examples, and I highly appreciate you pointing out Elixir’s downsides. What are you using to store state? The distributed system itself? An external database? Hybrid approach?
- dnautics 6y agocurrently my main system in prod is a (very smart) stateless caching system, I don't have a database, but I will eventually spin up a (probably amazon) database, for the web gateway, when the keys to that are handed over to me. One of the nice things is that using elixir really puts you in the mindset of thinking hard about who should have responsibility for "the truth". No hiding behind objects backed by ORMs. State is pushed out as far as possible to the edge and I don't trust my server to keep state correctly. As soon as it's at risk of being inconsistent (netsplit, e.g.) the state-holders in the server are slaughtered, rebooted, and told to reconnect to the edge machines, which are trusted with the truth. The nice thing about elixir is that restart logic costs the the price of like 5-6 lines of code across the entire codebase (no worrying about cleaning up resources like tcp connections or anything). Not in prod (personal project), I have a websocket-scraper on an aws free tier that's dropping data into a sqlite file, that I can transfer to my laptop for offline processing, so there are lots of interesting options.
- smabie 6y agoA BitTorrent client would be cool. I wrote one in Scala+Akka and the actor model is great. It's even better when the runtime supports preemption, like Elixer.
- mulander 6y agoAn erlang BitTorrent client exists: https://github.com/jlouis/etorrent https://github.com/jlouis/etorrent