Live data from Hacker News

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

phoenixframework.org

51–60 of 249 posts

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

#51
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…

Thank you HN. If you're interested, I'm actually documenting my journey as a consultant building ideas on Elixir at https://medium.com/build-ideas/

Thank you.

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

#52

I've been following this project for 5 years now, and I've really hoped it would take off. However, part of what made (and to some extent, still makes) the Rails framework so great is the surrounding ecosystem of well supported gems that makes building tedious things a breeze. I built a few things in Phoenix in the past, and while the core framework is very simple and elegant to use, I recall having to write my own f…

In my experience, Elixir and Phoenix are both so straight forward you don't really need to rely on third-party libraries as much as you do in Rails. Some of the things you'd normally reach for a gem to accomplish is just built into Elixir itself (e.g., you don't need anything like Resque or Sidekiq because Elixir processes can do all of that and more for you).

The lack of magic is nice too. For example, it's easy to add a new custom Plug (that you wrote yourself) to your pipeline without resorting to third-party libraries to help you navigate all the magic and boilerplate you'd otherwise have to deal in other frameworks.

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

#53
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…

> When I say perfect, I mean, there has been never once in my career where I hit a roadblock due to the language's limitation or complexity or flawed assumption. I faced this with other languages, but not Elixir.

This is pretty amazing praise! Are many of the other languages you've used strongly typed? That's the thing that gives me pause - I feel like I rely on the compiler a lot in languages where it can do a lot for me, and that I'd be really frustrated managing a large project without it.

I'm not sure what other languages you have a lot of experience with, but does anything in Elixir stand out to you as the reason dynamic typing works well there? I think dynamic typing is the main reason I nod along with "horrible programming languages like Javascript", for instance.

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

#55
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…

Are there any good tutorials to get started? What major sites are currently using Elixir?

> any good tutorials?

https://elixir-lang.org/learning.html - Start here. It starts off kind of abstract, and then works its way into the concrete (from my experience) -- but is very easy to pick up.

> What major sites?

Last I heard, Discord was serving ~5 million concurrent users, and that was well before compelled isolation.

Bleacher Report is also using Elixir, and serving something like 100k requests per minute just to mobile clients.

Bet365 handles as much as 100k monetary transactions during a big sporting event like a Champions League final.

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

#56
post #27

Question to the former Rails devs out there: We mostly see threads fawn over Elixir and Phoenix, have you experienced any downsides to switching? Anything you miss from Rails? I'm convinced to give it a try after that demo!

It seems like a lot of companies are moving to Go for fast services. As a rails dev for 10+ years, I am looking at Go instead of Elixir and Phoenix, b/c Go is a much more popular language than Elixir.

Go may be popular, but is also a lot less complete.

Some other things to consider are that Go's concurrency model is quite bloated when compared to Elixir's, Go uses public memory for its goroutines vs. Elixir's private memory that protects processes, Go uses cooperative multitasking vs. Elixir's preemptive model, and Go's dependency handling is absolute rubbish. Elixir's process supervision is amazing and Elixir's pattern-matching allows you to write easier-to-read and more maintainable code, in my opinion.

While both are good languages, I've personally found Elixir > Go.

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

#57
post #42

I wrote a little app recently to test out live-view. It was my first time really working with it, though I've been writing elixir for years. https://gif.energy Didn't really have any issues. There were maybe one or two gotchas but they were explained clearly by the docs (appending vs updating elements) and I was able to get it sorted easily. That whole app took a couple days, but more than half the time was wasted on…

> It doesn't make sense for certain types of apps, but it really adds a ton of value and saves a lot of time when the use case is right

What are some of these use cases?

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

#58

Earlier quoted context omitted.

Wouldn't you typically run Nginx (or something similar) as a reverse proxy anyways in production?

correct. I was just wondering if it also has inbuilt http server as well to process things like static files etc or is that completely on 3rd party tools like nginx (which I love btw). Kinda like in Golang where you could technically use the static file server but I always use nginx for those things.

Cowboy is Elixir's built-in HTTP server. You can configure things like Nginx or Haproxy as you would with most other frameworks.

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

#59

I've been following this project for 5 years now, and I've really hoped it would take off. However, part of what made (and to some extent, still makes) the Rails framework so great is the surrounding ecosystem of well supported gems that makes building tedious things a breeze. I built a few things in Phoenix in the past, and while the core framework is very simple and elegant to use, I recall having to write my own f…

Coming from laravel, I've not used phoenix much, but often I find i'll need what a package 'brings' but different, or perhaps I need a package that's not updated for the latest laravel. Often if it's MIT I'll take the code and just put it in a service, modify it so it works w/ latest version, etc...

you could do the same potentially for any rails or laravel package you wanted for phoenix, obviously language constraints would be different and programming paradigm. It'd take a little bit but you could port things over, if you package it up - even contribute to the community growth.

I think choosing a framework solely because of available packages isn't a good thing. I mean nodejs probably has the most packages in it's ecosystem but a lot of them are pure shit.

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

#60
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 actually agree with every pain point that Dave Thomas described in his talk[1] and is outlined in the Component github repo[2]. Sadly, it's unclear to me if anyone else is as passionate and willing to continue the effort. Nonetheless, it put to words exactly what I hated about genservers and such.

[1]: https://www.youtube.com/watch?v=6U7cLUygMeI

[2]: https://github.com/pragdave/component

Post reply on HN