Live data from Hacker News

Build a real-time Twitter clone with LiveView and Phoenix 1.5

phoenixframework.org

201–210 of 249 posts

Re: Build a real-time Twitter clone with LiveView and Phoenix 1.5

#201
post #25

I have been watching Phoenix/Elixir for a while and wondering if it has gained a lot more traction compared to say 2 years ago ? My choice of full web app framwork is Symfony/Laravel (PHP) or Python (Flask/Django) but I really like what Phoenix has to offer. However, does it have a mature ecosystem now ? What about deployments and tools around it ? Does it work with generic web servers like Nginx or does it run its o…

I’m a long time Python dev converted to Elixir (for ~3 years now, mainly web dev and data pipelines). The tooling and developer experience in Elixir is first class and the ecosystem is highly mature.

Coming from Python as well I'm really impressed with the tooling. `mix new` is just amazing.

Re: Build a real-time Twitter clone with LiveView and Phoenix 1.5

#202
post #95

Earlier quoted context omitted.

To add to this, it's worth noting that Elixir would have difficulty _ever_ becoming statically typed because of how message-passing works. For example, if you look at Gleam [0] -- the recent project that's trying to create a statically typed language for the BEAM -- it can't handle message-passing [1]. And I totally agree with you here: > I've found that it's possible to pretend it is a statically typed language if y…

Hi, I'm the author of Gleam. We have fully type safe message passing, we just don't have any special syntax for it. I'll update the documentation to make this clearer.

Typing messages is considered a PhD (?) level problem. Could you talk more about how you went about solving it? Thanks!

Re: Build a real-time Twitter clone with LiveView and Phoenix 1.5

#204
post #112
post #103

Earlier quoted context omitted.

I've heard a number of times that static typing would be near impossible for Erlang because of how message-passing works, but just the other day I read a quote where one of the creators (I think it was Joe Armstrong, but not completely certain) indicated that the primary reason they decided against static typing was the hot code reloading, not the feasibility. or not primarily anyways. Not disagreeing with you, I gue…

I'm the author of Gleam, a statically typed language on the BEAM. What you've said matches my findings. Messages can be typed, however hot code upgrades cannot be. For Gleam we've sacrified hot code loading in exchange for types, which I think is a good trade for most use cases.

I'd really like to read about your finding wrt hot code loading. Is there anything you can point me to?

Re: Build a real-time Twitter clone with LiveView and Phoenix 1.5

#205
post #95

Earlier quoted context omitted.

Hi, I'm the author of Gleam. We have fully type safe message passing, we just don't have any special syntax for it. I'll update the documentation to make this clearer.

Thanks for commenting. Do you have any code somewhere that demonstrates type-safe messages?

Certainly, there are some links to relevent libraries here -> https://gleam.run/faqs.html#how-is-message-passing-typed

Re: Build a real-time Twitter clone with LiveView and Phoenix 1.5

#206
post #95

Earlier quoted context omitted.

Hi, I'm the author of Gleam. We have fully type safe message passing, we just don't have any special syntax for it. I'll update the documentation to make this clearer.

Typing messages is considered a PhD (?) level problem. Could you talk more about how you went about solving it? Thanks!

It would be difficult (or perhaps impossible) to type all of Erlang's message passing features, so we reduced scope to not include distributed message passing or hot upgrades- so the types of all actors in the system can be known up front in order to be checked.

In practice this is enough for the vast majority of applicatinos, and messages with runtime checks (like in regular Erlang) can be used for the other situations if required.

Re: Build a real-time Twitter clone with LiveView and Phoenix 1.5

#207
post #14

I was a Rails user for almost a decade. I switched to Phoenix/Elixir 3 years ago. Elixir is a super simple language. It has no OO concepts and everything is functions first. In fact, it's so good that I started teaching it for universities. All my production web applications are now fully on Elixir. Elixir is one of those languages where everything has been done perfectly as of the time of this comment. When I say pe…

>Elixir is one of those languages where everything has been done perfectly as of the time of this comment. Including GenServers? I find writing GenServers to be needlessly painful. Their syntax is one of my least favorite things about Elixir.

Why is that? The GenServer API very similar to Erlang version.

You can add your own abstractions with macros on top of that if you like.

Re: Build a real-time Twitter clone with LiveView and Phoenix 1.5

#208

Earlier quoted context omitted.

Can you explain in your own words for elixir where the balance between "joy" (productivity, flow, whatever you want to call it) and what you call "rethinking the way you write code". As another example of a functional oriented language that prides itself in the same thing look at Haskell. I wouldn't say most people think that Haskell is an easy or productive language (that is until after you have years of experience…

So as someone who worked in Erlang (and is familiar with Elixir), I can answer that a little bit. They hit a sweet spot. Enough rigor, enough limitation, at the language level, to force you to do things "the right way" for a broad swath of problems (there are certain problems they're poorly suited for), but enough simplicity and freedom to keep a minimal learning curve, and minimal runtime complexity to figure out is…

> with supervisors, you mostly have just one concern for reliability ("how do I start this into a known, good, consistent state?"), rather than hundreds ("what happens if -this- fails? Or that? Or that other thing?")

Thank you for this comment. I have used Elixir for a couple of years and is a concept I have always understood but have never been able to explain coherently and succinctly.

Re: Build a real-time Twitter clone with LiveView and Phoenix 1.5

#209
post #14

I was a Rails user for almost a decade. I switched to Phoenix/Elixir 3 years ago. Elixir is a super simple language. It has no OO concepts and everything is functions first. In fact, it's so good that I started teaching it for universities. All my production web applications are now fully on Elixir. Elixir is one of those languages where everything has been done perfectly as of the time of this comment. When I say pe…

I'm a full-stack Typescript dev (React, Node.js, etc.). Lately I've been more intrigued by functional programming. I feel like I've gone pretty deep into OO and classes, inheritance, etc. Looking back, I feel like there is a better way to structure that, and the glimpse of functional programming that I've seen seems to help with this boilerplate.

I've heard only good things about Elixir/Phoenix, so I'm thinking about picking it up for my next project. One thing about JS/TS is that the ecosystem is well developed, especially on the deployment side. For side projects especially, I like to minimize my dev ops configs and utilize "serverless" type stuff (i.e. Zeit/Vercel, FaaS, etc). I haven't seen much of this in Elixir-land, but hey, maybe that's an area I can help innovate in.

Re: Build a real-time Twitter clone with LiveView and Phoenix 1.5

#210
post #204
post #112

Earlier quoted context omitted.

I'm the author of Gleam, a statically typed language on the BEAM. What you've said matches my findings. Messages can be typed, however hot code upgrades cannot be. For Gleam we've sacrified hot code loading in exchange for types, which I think is a good trade for most use cases.

I'd really like to read about your finding wrt hot code loading. Is there anything you can point me to?

I'm afraid not, it's not been a fruitful area of research so we've not written anything down about the limitations.
Post reply on HN