I haven’t gotten through the whole article yet, and haven’t encountered Elixir before, but I really like the popes ideas. I am going to dig into that a little more. Are there other languages that have similar constructs (outside of shells!)?
Ocaml, F#, probably others.
Elixir for Humans Who Know Python
161–170 of 198 posts
Re: Elixir for Humans Who Know Python
#162Re: Elixir for Humans Who Know Python
#163I've been using Elixir with Phoenix and Liveview at my job for the past three months as part of a small team building a non-trivial web app ( https://duffel.com/links ). I'm mostly a front-end developer and was brought in to handle the UX side. Prior to this project I've spent the last 5+ years in the React world. I found a lot of what the author says to be true. I'm used to the nightmare that is managing front-end d…
> Whenever I jumped into the JS world it often felt like I was fighting against Phoenix I've had the same experience and this is something I've tried to tackle recently. I've started working on LiveSvelte which allows you to plug in Svelte components directly into your LiveView, while still being able to push events to the server with a `pushEvent` function on the client. I've only started working on it this week but…
Re: Elixir for Humans Who Know Python
#164No offense to TFA author, but I don't think this is doing to sell Elixir to Python people. In fact, I have serious doubts as to whether most Python lovers would be willing to set aside their beliefs and practices to learn the Elixir way. Perhaps Phoenix and LiveView will be the gateway drug, but even to reach that point requires a lot of effort to understand functional programming and Elixir. Python has some function…
I think this article does capture the magic of elixir phoenix live view that is impossible in the async await madness hell in python. I cannot wait to try elixir Phoenix live view, elixir |> pipes, :atom pattern matching and ets pids to send and manage processes across servers none of these AFAIK are currently possible with the GIL and single threaded nature of python As the venerable prof Joe armstrong would say you…
There are the major benefits of Elixir itself, including FP, plus the array of features and tools for building distributed systems via OTP.
Only talking about LiveView is underselling Elixir.
Re: Elixir for Humans Who Know Python
#165Earlier quoted context omitted.
> Whenever I jumped into the JS world it often felt like I was fighting against Phoenix I've had the same experience and this is something I've tried to tackle recently. I've started working on LiveSvelte which allows you to plug in Svelte components directly into your LiveView, while still being able to push events to the server with a `pushEvent` function on the client. I've only started working on it this week but…
Noob here. Is this project different than in concept than Svonix ( https://github.com/nikokozak/svonix )?
LiveSvelte does allow you to communicate back to the server, which in turn updates the Svelte component from the server, getting you E2E reactivity.
Re: Elixir for Humans Who Know Python
#166I love functional programming because it feels natural to me to have functions that always return a value (method chaining or postfix notation FTW!) do not mutate data (and therefore avoid side effects), and use clear naming conventions for any potentially destructive functions. However, Python's popularity, vast library, and strong community make it a more practical choice for solving problems - at least when progra…
I don't think it's nonsensical to use less popular/exotic languages. I prefer to write code in languages that I like to write in, as long as it's a good enough tool for the job. The real problem with them is that while you and I might be interested in functional languages, our coworkers/managers aren't and we have to stick with the languages we might not find as immediately exciting, like python. Side node, python ha…
Re: Elixir for Humans Who Know Python
#167Earlier quoted context omitted.
The Phoenix docs don't look like they even hold a candle to Django. I spent 5mins in it and still don't know how to define a model. I eventually figured out a doc section called "Ecto" - so i had to know what ecto was to find it. Then, in those docs I still don't know how to define models. Do they expect me to manage my database and schemas separately and generate the models from that? That's completely opposite what…
You might be interested in the relatively new Ash Framework that builds on top of Phoenix and has much more built in: https://ash-hq.org/
Re: Elixir for Humans Who Know Python
#168Re: Elixir for Humans Who Know Python
#169Earlier quoted context omitted.
Real time like a chat app, or a video game or something. Not just a fast site. Seems like most "real-time" sites are slower as they have a harder time taking advantage of caching and the like, or use a lot of slow client-side javascript that inevitably works poorly. Basically if you need the server to be able to change the data a user is currently looking at, collaborative multi-user stuff mostly. Liveview could be g…
Been looking at CRDTs lately for this, sounds like Elixir would be a good fit. Although what I've seen before has used C++ or Rust? to compile to wasm for the graphics part of the front end. Do all these technologies work together well?
Re: Elixir for Humans Who Know Python
#170Earlier quoted context omitted.
You can pattern match on basically any shape, not just atoms. Imagine you’re parsing a protocol over tcp and want to grab groups of characters between deliverers, you can pattern match that. I rewrote an hl7 parser from Java to Ruby to Elixr some years ago and the elixir implementation performed as well as Java and was more readable by miles.
> You can pattern match on basically any shape, not just atoms. Imagine you’re parsing a protocol over tcp and want to grab groups of characters between deliverers, you can pattern match that. Ex: https://youtu.be/MaQqa21uxQ8?t=548 (note that "binary" here is a "binary blob of bytes"). Andreas pattern matches on the magic byte, then encoded string length, then the string (using the previous matched length), then an i…