| ▲ | candl 6 hours ago |
| What are the pros and cons compared to ASP.Net/Blazor? |
|
| ▲ | weatherlight 6 hours ago | parent | next [-] |
| 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. |
| |
| ▲ | zerr 6 hours ago | parent [-] | | But it doesn't have neither AOT nor JIT. | | |
| ▲ | arcanemachiner 6 hours ago | parent | next [-] | | 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. | |
| ▲ | foxes 6 hours ago | parent | prev | next [-] | | elixir/erlang gets compiled into beam byte code. It's a vm. why does this matter.. | | |
| ▲ | zerr 5 hours ago | parent [-] | | It's an interpreted byte code run (interpreted) by BEAM. Not a native binary run by CPU. But apparently BeamAsm JIT solves the issue? As mentioned in the sibling comment. |
| |
| ▲ | conradfr 6 hours ago | parent | prev [-] | | What about https://www.erlang.org/doc/apps/erts/beamasm.html |
|
|
|
| ▲ | noodletheworld 4 hours ago | parent | prev | next [-] |
| 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. |
|
| ▲ | rubyn00bie 6 hours ago | parent | prev [-] |
| 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). |
| |
| ▲ | cpursley 6 hours ago | parent | next [-] | | 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. | | |
| ▲ | epolanski 5 hours ago | parent | next [-] | | 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. | |
| ▲ | rubyn00bie 6 hours ago | parent | prev | next [-] | | 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. | |
| ▲ | 5 hours ago | parent | prev [-] | | [deleted] |
| |
| ▲ | cyberpunk 5 hours ago | parent | prev [-] | | 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. | | |
| ▲ | mcintyre1994 5 hours ago | parent | next [-] | | 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? | | |
| ▲ | GCUMstlyHarmls 3 hours ago | parent [-] | | There is some propensity to forget that you're basically making a REST API because its all "in my process, responding to messages", it feels like you're writing your regular server side render controller. But really instead of `PUT /create/post` its `websocket.send("create_post", {})`, so you need to understand that if you only want to operate on `user_id=1`, you need to not just accept `{user_id: 1, ...data}`. I dont think its inherently any more insecure than another method, you just have to recognize that clients can create malicious requests to `handle_event(my_event, params, socket)`, just like you might to `my_action(params, conn)`. It's also pretty painless, normal, to just crash on bad data, it will only effect that one naughty lv process. You could also send "control" signals to the phoenix liveview process via the same socket but I dont think that actually as much surface outside of heartbeats and closing the socket. |
| |
| ▲ | kitd 5 hours ago | parent | prev [-] | | Why? It's the client that initiates the connection. |
|
|