Live data from Hacker News

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

phoenixframework.org

131–140 of 249 posts

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

#131
post #125
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. That is interesting. I've gone from Geocities pages to ASP Classic, PHP, WP, Rails, Flask and have been dabbling with Elixir and Phoenix for a bit. So far LiveView (and some bits of Elixir in general) has be…

I agree. I’ve tried learning a ton of times but I always hit something I don’t understand and struggle to find help except asking. I think because it’s such a niche language still. With Rails there aren’t a lot of questions left to ask. They’ve already been asked and answered. That’s not the case with Elixir and especially Phoenix.

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

#132

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…

The other side of that coin is the huge amount of unmaintained risk in the Ruby community. When you delegate business logic to someone else's efforts you taking on the risk that the library will be maintained and patched for the lifespan of your application.

As someone else already pointed out, many of the solutions in Elixir are significantly more simple to just "roll your own" rather than have to worry about pulling 50 gems.

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

#133
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.

Hi, thank you for contributing! I have gotten into the functional programming paradigm conceptually from working with react/redux. We do all of our development work using TypeScript, rather than JavaScript. Typescript isn’t really static typing, but more like type assertions on top of a dynamic language, but hot reloading works fine and is a core component of the workflow, especially with the ability to maintain state in between loads. I’m new to this world and haven’t yet tried Elixir, but what is it about the type system that prevents hot reloading? Is it because the underlying execution system is using types for something? Could a typescript-style language be built on top of Elixir and BEAM that would allow hot reloading and type assertions together?

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

#134

Earlier quoted context omitted.

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

The Elixir video courses at https://pragmaticstudio.com/ are the best available, in my opinion. There are some free tutorials available and some other good paid courses, to be sure, but I think Mike and Nicole over at Pragmatic Studio offer the most complete and easy-to-follow courses available. The cost-to-value ratio of their courses is really good, I think. I'm not affiliated with them in any way. I'm just a happy…

Thanks for the recs. If you're willing to share what other paid courses you consider good, I'd appreciate it!

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

#135

How would this scale for, I don't know, 10k concurrent users? Would a live chat app be reasonable?

Here's an example of using it with 2 millions users: https://www.youtube.com/watch?v=c6JcVwbOGXc

I'm assuming the parent meant how would this specific configuration of elixir + phoenix + liveview scale.

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

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

Wait, for loops and nested conditions is an OO concept? What does Elixir do instead?

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

#137
post #24

Earlier quoted context omitted.

I'm really amazed this sort of functionality can be implemented in such a nice and clean manner. Your presentation is mind blowing! Just out of curiosity (please don't consider this as a feature request, more like a thought exercise), in case you wanted the application to have offline editing functionality, could the framework provide it in a similar manner? having a generic JS handler that manages pushing state when…

"offline support" is strictly on the side of needing to run a lot of code on the client, so this is where we draw a line and say you need a js framework, of which there are number of great options. We have javascript interop via phx-hook, so it could be made to work, but you'd necessarily have to have a lot of js running on the client, and any feature you wanted to work online & offline would not share a code path or…

Sounds fair, thank you for your reply!

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

#138
post #136
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…

Wait, for loops and nested conditions is an OO concept? What does Elixir do instead?

It seems since Elixir is purely functional you don't mutate things. So basically you use tail call optimised recursion for everything. Neat.

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

#139
post #46
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 100% agree about Elixir and its surrounding ecosystem being almost perfect. It's insane how simple the building blocks are and how easy the code is to read and write. Here are a few pain points I've ran into: 1. Typespecs leave something to be desired compared to other type systems 2. Maps vs structs and easily using one in place of the other Things that my team would like to see: 1. Components in addition to templ…

Hey, just a friendly Elixir user here! Could you explain why you think that maps vs. structs is a pain point? I found this interesting because I personally really like how they are so similar, because you can almost always manipulate a struct like a map, just like you'd expect. It lets you use standard operations for working with structs.

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

#140

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…

I totally agree. I love phoenix and elixir but it's been hard to roll out a really significant site to production because many of the things you take for granted in the rails world don't exist in the elixir world. Friendly id, acts as follower, public activity, file uploading and more are not as easy in the elixir world as rails. I think rails is still king when it comes to developer productivity but elixir's performance is amazing. And for those of you that are "roll your own", when it comes to business decisions you always have to make a trade off. Heck authentication in the elixir world is just now finally getting official support via a generator (thank Jose!) but it's not even close to devise levels of easy.
Post reply on HN