Back to News
Advertisement
Advertisement

⚡ Community Insights

Discussion Sentiment

65% Positive

Analyzed from 1209 words in the discussion.

Trending Topics

#liveview#app#phoenix#blazor#don#why#elixir#language#erlang#apps

Discussion (31 Comments)Read Original on HackerNews

lwouisabout 1 hour ago
I like this familly of technologies. Having an SPA-type app that's mostly backend.

Recently i've redone my app website (https://alt-tab.app), and I implemented a minimal spa.js that has a similar approach. I find the end result blazing fast, simple to maintain / reason about, few moving pieces. I used Early Hints, compressed every single thing, inlined CSS, etc. I don't know how i could even make it faster.

I recommend this approach for websites that are not very complex. Of course if i made a browser-based music player with a super dynamic UI, that would have been a different story~

Intermernet33 minutes ago
Can't the website be literally static HTML for 99% of it? I don't really see any user defined input that would change the output.

It's really fast, and seems fine, but is it just static pages? If not, why not. That's the question most front end devs don't ask themselves enough.

epolanski28 minutes ago
> I don't really see any user defined input that would change the output.

And that can also be part of a normal static website...We have had JavaScript for more than 30 years to add reactivity.

App-like behavior is not about having dynamicity and reactivity on the single-page level, but about smooth app-like transitions between pages.

It's like we forgot that "back-in-time" each navigation had to reload the whole page.

sebmellen41 minutes ago
Very cool concept with AltTab. Have always been looking for something like it!
orliesaurusabout 1 hour ago
I've been using Phoenix for super basic things for a very long time since I first discovered it at the Elixir meetup in ATX.

I haven't touched it in a while, Since writing code these days, as most of us know, it's basically steering an LLM.

So I wonder how good are LLMs at writing Phoenix or Elixir so to speak? Time for me to create another side project... and figure it out.

cpursley13 minutes ago
I'd argue that it's one of the best, especially with Tidewave:

https://dashbit.co/blog/why-elixir-best-language-for-ai

johnisgoodabout 1 hour ago
They were pretty good a year ago, so I am sure it is even better than that now.
cpursleyabout 3 hours ago
LiveView is such a breath of fresh air, especially over the vibe coded NextJS rats nests that have become the norm (that need specialized hosting, are dog slow and require a ton of proprietary paid services bolted on like caching, background workers and even auth which Elixir and Phoenix provide out of the box).

https://elixirisallyouneed.dev

AdamConwayIEabout 1 hour ago
I've been loving LiveView. Been using it for a project for a client recently and it's so... chill. I like it a lot.
Tinkeringzabout 2 hours ago
What caching is provided out of the box for Phoenix framework?
conradfrabout 2 hours ago
Doesn't seem to be mentioned in the page but if you're talking about request caching there's libraries like PlugHTTPCache or RequestCache.

Otherwise I usually use Nebulex (annotations are nice for Ecto queries) with ETS as it's faster than with Redis (if you don't care about losing the cache on deployment).

cpursley12 minutes ago
Out of the box in Elixir/Erlang, Phoenix is the web framework layer.
Traubenfuchs43 minutes ago
> specialized hosting

What do you mean?

My private next.js fullstack slop runs dockerized on my kubernetes cluster and for auth I use auth0, because I am too lazy to run keycloak or whatever dockerized auth slop is currently en vogue.

cpursley15 minutes ago
It's possible but most default to vercel and it's required if you want the fancy stuff (hybrid). And you made my point, Kubernetes is overkill as well.

Regarding auth, in phoenix it's literally as simple as "mix phx.gen.auth Accounts User users" and boom, your users live right in your database for free.

candlabout 3 hours ago
What are the pros and cons compared to ASP.Net/Blazor?
weatherlightabout 3 hours ago
The BEAM virtual machine. Its has lightweight isolated processes, message passing, supervisors, hot-ish runtime introspection, and fault containment are not libraries bolted on later. They are the substrate. not an after thought.

if you are build an app that needs the following: + many concurrent users + real-time UI + background jobs + workflows + stateful sessions + distributed events + failure isolation + “this thing should keep running for months”

You're going to want the thing built on the BEAM.

zerrabout 3 hours ago
But it doesn't have neither AOT nor JIT.
arcanemachinerabout 2 hours ago
I believe BEAM bytecode is now JIT-ed.

EDIT: It is, since OTP 24 was released in 2021:

https://www.erlang.org/downloads/24

> The BeamAsm JIT-compiler has been added to Erlang/OTP and will give a significant performance boost for many applications. The JIT-compiler is enabled by default on most x86 64-bit platforms that have a C++ compiler that can compile C++17.

conradfrabout 2 hours ago
foxesabout 2 hours ago
elixir/erlang gets compiled into beam byte code. It's a vm. why does this matter..
noodletheworld29 minutes ago
Many people love liveview.

Many people dislike blazor and it has had its reputation sullied by Microsoft treating it as “new webforms” (yes, they do. It is literally the official migration path for legacy webforms projects).

The pro of blazor, arguably, is c# and the .Net ecosystem.

If I personally had to choose, I wouldn't choose blazor over almost any other technology because I’ve had bad experiences with it.

Technically, they're very similar, but the devexp matters, in my oppinion.

rubyn00bieabout 2 hours ago
TLDR; LiveView is web only.

There have been efforts to make LiveView native, but it’s extremely difficult to do so, and thus far (to my knowledge) all have failed.

I was thinking about this the other day because carsandbids (Doug DeMuro’s car auction site) uses Blazor (at least as far as I can tell). And I think that’s one of its biggest advantages of Blazor—- is that it is capable of producing native apps and web apps while LiveView is resolutely not. And that’s because Microsoft can pay for it (or at least sponsor huge amounts of supporting infrastructure).

And FWIW— that’s an extremely difficult problem to solve. It requires an enormous amount of funding, both a huge team capable of both understanding Android and iOS SDKs and capital to employ folks on pure engineering challenges (hence why MS or Meta can). End users don’t care if it’s made with LiveView, Blazor, React, Java, SwiftUI, et. al. And, the list of companies that can facilitate that long term is extremely small.

There’s also the issue of OTP being non-trivial to implement or meaningfully transpile into another language/runtime. Erlang, BEAM, and OTP were made together for each other in a very peculiar and specific way, for a specific set of problems, and if it wasn’t a necessity that they were developed together it would be a dead language, runtime, and platform (and for the record it’s absolutely not).

cyberpunkabout 1 hour ago
I am a fan of the idea, but the websocket is also quite a big attack surface; you can do a lot more by sending messages over this socket to your phoenix app than you would likely expect to have exposed via some api on another framework.

It’s difficult to secure, in my opinion. Perhaps not impossible but the cost of doing so pretty much eclipses the benefits of using liveview imo.

mcintyre1994about 1 hour ago
I haven’t used it for anything in production so I haven’t seen these issues, could you give a bit more detail? I’m mostly wondering why you’d have any more websocket messages that you respond to than you would APIs if you were using any other approach. Does LiveView itself respond to certain messages bypassing your app?
kitdabout 1 hour ago
Why? It's the client that initiates the connection.
cpursleyabout 2 hours ago
Why not just build mobile apps in their native language (Swift etc)? Anyways, end users absolutely notice and care - cross platform mobile apps are all hot garbage without exception.
epolanskiabout 2 hours ago
Especially now that you can likely throw the mobile conversion to an LLM and judge the feasibility of it's maintenance once it's done.
rubyn00bieabout 2 hours ago
That’s what I would do that personally. I hate wrappers around native SDKs. But I also learned them.

A lot of folks assume mobile apps are “difficult” because of the underlying language. But it’s not the language that’s an issue, it’s the SDKs. They’re so wildly different from each other, and the way things work on the web, that it’s (IMHO) a losing proposition to do so.

That’s not to say things like Blazor or React Native don’t have a place but that place is one that’s inherently difficult to maintain without huge amounts of ongoing effort and capital invested in non user facing features.

rubyn00bieabout 2 hours ago
I’m not sure how I feel about the CSS integration. Nor the collocated JS that was somewhat recently released.

On one hand, yes it is convenient, but on the other it could become a huge mess. It reminds me of Rails 2.x where it became almost impossible to debug, or fix front end code that used rjs or whatever it was called. Because disparate snippets of JS were littered throughout your code base in files that were hard to find.

I’m sure the Phoenix team has put a lot of effort into it, and I truly hope it slaps. I myself am just really hesitant to use it, when CSS files and non colocated JS work just fine. I’ll probably be waiting a couple years before giving it a try

conradfrabout 1 hour ago
To be honest that's copied from the JS frameworks. I tend to agree with you but sometimes scoped CSS is nice to have.