News for hackers. Stuff that matters.
Re:Show HN: LiveViewJS – TypeScript back end for LiveView Ap... by searchableguy on Friday February 11, 2022 @01:29PM (#30305185)
How is the performance and scaling story compared to live view?

Live view works so well because of elixir and BEAM. The same model may not translate well to other languages depending on their concurrency and recovery pattern. There are also many optimizations in BEAM for keeping latency consistent over throughout alone which is important for live view applications.

I also wonder if it will be possible to have push only live view application. One of the reasons for this is you can use server events instead of sockets. It would be cool for building visualization or showing metrics from backend.

Awesome job all around. I love the examples folder.

Re:Show HN: LiveViewJS – TypeScript back end for LiveView Ap... by floodfx on Friday February 11, 2022 @01:43PM (#30305383)
Thanks for checking it out searchableguy. Tbh, I haven't run any performance/scaling tests just yet. :) I certainly don't expect it to be as performant or scale as well as BEAM right now and agree with your point that BEAM is particularly well suited for this paradigm.

That said, I think there are other server technologies to back LiveViewJS apps that may be able to scale out and perform just as well as BEAM including: Redis and DynamoDB. I plan to experiment with these in the near future.

Additionally, a big motivation for me was that I wanted to write apps in a language that I am very productive in (namely Typescript) which also has a large ecosystem and larger population of developers.

Lastly, in terms of other languages that I think could be well suited for this paradigm, Golang stands out (with channels and goroutines) but I haven't experimented with that yet.

Re:Show HN: LiveViewJS – TypeScript back end for LiveView Ap... by mrkurt on Friday February 11, 2022 @01:52PM (#30305501)
It's going to be hard to get close to BEAMs scaling story. I think you could build something on top of, like, nats.io and get similar scaling semantics. But centralized DBs are brittle for this kind of platform. Redis and DynamoDB are great ... just not for this.

This is extreme and maybe true. The best way to make TypeScript scale like BEAM might be to build a TypeScript -> Beam compiler. :D

Re:Show HN: LiveViewJS – TypeScript back end for LiveView Ap... by floodfx on Friday February 11, 2022 @02:05PM (#30305658)
Agree that BEAM is great and very scalable. I guess I disagree with the notion that Redis and DynamoDB are "centralized" and "brittle". Rather both are distributed, robust, and, I would add, battle-tested.

I do like the idea of a Typescript to BEAM compiler but that is beyond my capabilities and interests. Maybe someone lurking here could do that?

Re:Show HN: LiveViewJS – TypeScript back end for LiveView Ap... by evol262 on Friday February 11, 2022 @02:17PM (#30305796)
They're not brittle when running -- they're brittle if/when there's a failure.

Bringing a Redis cluster back up is either "start each node in exactly the right order", "wait 10+ minutes", or "establish quorum yourself". Ten minutes can be a really long time in production.

Re:Show HN: LiveViewJS – TypeScript back end for LiveView Ap... by jfyne on Friday February 11, 2022 @07:44PM (#30308841)
I've been working on a Go implementation if you fancy trying it out

https://github.com/jfyne/live

Re:Show HN: LiveViewJS – TypeScript back end for LiveView Ap... by floodfx on Friday February 11, 2022 @09:01PM (#30309213)
Very cool. I noticed you are writing your own client libraries? Curious if you've tried using the Phoenix client libraries? LiveViewJS uses the same libraries as a Phoenix LiveView app on the front-end.

I'll join your discord and we can chat more...

Re:Show HN: LiveViewJS – TypeScript back end for LiveView Ap... by searchableguy on Friday February 11, 2022 @11:44PM (#30310009)
I love typescript too. Any plan to support deno?

I think deno may work out of the box with --compat flag but i haven't tried it.

Re:Show HN: LiveViewJS – TypeScript back end for LiveView Ap... by floodfx on Saturday February 12, 2022 @09:02AM (#30312879)
I have not tried Deno and not my highest priority. I've added to the issues in Github. If you try it, would be great to update that issue with your results!