Live data from Hacker News

Elixir for Humans Who Know Python

hibox.live

161–170 of 198 posts

Re: Elixir for Humans Who Know Python

#161

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.

Thanks!

Re: Elixir for Humans Who Know Python

#163
post #132

I'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…

Noob here. Is this project different than in concept than Svonix (https://github.com/nikokozak/svonix)?

Re: Elixir for Humans Who Know Python

#164
post #44

No 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…

LiveView is great, but it is just one of many great reasons to use Elixir (and the ErlangVM ecosystem).

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

#165
post #132

Earlier 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 )?

It's different, I've looked into Svonix for my usecase but it wasn't sufficient. Svonix does not support LiveView. It gets you a Svelte component in your Phoenix app without any interaction with the server. It also doesn't support Server Side Rendering which means on your first page load the Svelte component is not visible.

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

#166
post #77

I 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…

There's also Hissp. You could start out in readerless mode (it's still Python!) and introduce Lissp afterwards as a convenience.

Re: Elixir for Humans Who Know Python

#167
post #106

Earlier 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/

This actually looks like it has a lot of potential.

Re: Elixir for Humans Who Know Python

#169

Earlier 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?

Phoenix has used CDRTs going back to version 1.2 when Phoenix Presence was introduced. Here's a podcast about it (2016): https://changelog.com/podcast/208

Re: Elixir for Humans Who Know Python

#170
post #88

Earlier 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…

[deleted]
Post reply on HN