Hacker News new | past | comments | ask | show | jobs | submit | floodfx's comments login

Love this! Agree that kids educational content often crosses the line into too flashy and overproduced.

Great idea on the collectible stickers!

This is meant to be used while sitting with the kid as opposed to handing them my phone right?


Yep, exactly. The idea is that this is time for a parent and kid to spend together learning + having fun. There's a "prompt" on each screen that gives the parent guidance around what to say and then there are some fun interactions that you can do together - holding a button while sounding something out slowly and then fast. I've found that the 1 on 1 time is as motivating as the actual stickers!


From the article - Joist provides:

- Bullet-proof N+1 prevention,

- Tracking loaded relation/subgraph state in the type system, and

- Backend reactivity, for declarative cross-entity validation rules and reactive fields.

Wow!


There are LiveView backends written in Javascript (http://liveviewjs.com), Go (https://github.com/canopyclimate/golive), Java (https://github.com/floodfx/undead), and Python (https://github.com/ogrodnek/pyview).

Disclaimer: I wrote or helped write the first three.


Back when I was in an office, we switched desks once a quarter. We randomized the selection order each time and the only rules were you couldn't sit at the same desk or next to the same people. The value was that sitting next to new people created more social connections and created more trust and a change in scenery was refreshing.


Also forces you to artificially build social connections which for some introverts might be challenging and upsetting.


Many necessary and/or good things are challenging and upsetting.

It's a thing, but it's not automatically the most important thing. That depends on other factors.


The premise here is that most desk changes are neither necessary nor good.


I think String Templates are pretty cool. For example it enables "tagged template literal"-like behavior which is super powerful in JS land.

I used it to support a LiveView implementation for Java: https://github.com/floodfx/undead

Sure the syntax isn't "pretty" but understandable and you get used to it like anything else.


The whole reason for string interpolation is to have a “pretty” syntax.


But the security problems that string interpolation introduces are one of the reasons why Java has decided to reject string interpolation as a language feature in favour of string templates (you can use string templates for interpolation as a special case of a template processor, but that's not the feature's raison d'être). The reason for string templates is to improve the convenience and (very poor) security of string manipulation.

The JEP explains why Java is getting string templates and is not getting string interpolation (as a language feature).


This idea being it will speed up navigation? And by static site you mean not SPA static site but traditional separate pages? Smart!


Yes, exactly. It's just a bog-standard set of separate HTML pages (generated with a static site generator).


Me too! On my Tandy 1000 iirc.


The link that @helb sent is a good summary from the Phoenix docs but it is sort of hard to "get" just by reading about it. My attempt to be more concise is "a LiveView is a server process that receives events (clicks, form input, etc) from the browser, updates its state on the server, and sends back diffs which are applied to the browser."

You can think about it as a server-rendered HTML page that gets updated via Websocket updates.

That doesn't really do it justice either. I think writing a little bit of code and running a LiveView server is probably the best way to truly grok it.

Like any new paradigm, it takes a bit of a mind shift to see the value.

If you can, try running the Undead example server by downloading the repo and running:

`mvn package exec:exec`


I think it is more exciting and more innovative to think about LiveView as a new architectural approach to building reactive applications. Yes in Elixir land it is a Process and there are some amazing things about the BEAM. But LiveViews have the potential have an impact beyond just the Elixir ecosystem and folks should embrace that.

I’ve been a part of porting the Phoenix LiveView Protocol to both Javascript (https://LiveViewJS.com) and Go (https://github.com/canopyclimate/golive) backends and supported a friend that is porting it to Python.

Ironically I think taking LiveViews outside of Elixir could actually make it easier for folks to adopt Elixir-based LiveViews in the future.


Porting this is cool but why would people adopt Elixir if they can have LiveViews in their preferred language?


Ergonomics matter.

Because outside of Go (and maybe Rust) it will be very difficult to actually do what Elixir does, with the same level of concurrency and fault tolerance, etc, with the same ergonomics.

Ruby/Rails/StimulusReflex does something very similar, but kind of falls over unless you replace ActionCable with AnyCable which is written in Go.

So now, you have to support Go and Ruby runtimes. Some developer who decided that the above was a nightmare to work with, __might__ start a new project in Elixir, to get something that actually does what Elixir does instead of just mimicking it.

I'm not sure I buy this, personally, but I can understand the argument.


> Because outside of Go (and maybe Rust) it will be very difficult to actually do what Elixir does

It's just as difficult in Go and Rust. BEAM, the Erlang VM that powers Elixir, is not just about lightweight processes. It's also about guarantees that neither Go nor Rust provide. E.g. to do what Elixir does you need robust process supervision trees. You can imitate, but not replicate those in other languages.


Virding's Law: Any sufficiently complicated concurrent program in another language contains an ad hoc informally-specified bug-ridden slow implementation of half of Erlang.


Comments like this push people away from Erlang rather than draw them in.


I find it quite the opposite: what is it that other languages are trying to re-implement, and why they can't?



If you look at my comment history, you'll see I'm well familiar with the BEAM.

I'm in full agreement with you, but I'm not sure you need full robust process supervision trees to mimic what the BEAM does in the context of LiveView on a single machine.

I do want to say, I 100000% times prefer Elixir, it's tooling, ecosystem, web frameworks, easy of scaling vertically and horizontally, etc over Go or any other lang that probably do something analogous to LiveView via what ever concurrency primitives that language/runtime champions; Go with it's Communicating sequential processes(CSP) and Rust with the Ractor lib (https://github.com/slawlor/ractor).


In Go you’d run a goroutine and then send either a result or an error over a channel. I’m curious what else would be needed for “robust” supervision of the goroutine like Elixir/Erlang? I haven’t really felt a need for anything more.


What happens when a channel abruptly closes? Or when it throws an error?

Erlang VM guarantees that [1]

- all processes are isolated. Fatal error in one process will not affect other processes. Crucial: it will not affect the VM.

- If you set up process monitoring, and that process dies for whatever reason the monitor will be notified, with the actual reason. This lets the monitor (the supervising process) decide what to do next: restart, do nothing, stop entirely etc.

- Other relevant things like processes suspended when waiting for messages, or running out of reductions (number of allocated calls and messages) so that other processes can be executed, a bunch optimizations in the VM about CPU caches etc.

So what you have is "kubernetes for processes, inside the VM".

And the reason you don't have supervision for either Go or Rust is simple. Both Go and Rust for some completely asinine reasons decided that an unhandled error should kill the entire running application, with no chance of recovery.

And later they both awkwardly bolted on a half-assed solution to catch panics. That's it. That's the extent of error handling and guarantees in those languages. Of course no one builds supervision trees there.

[1] Of course it's not a 100% guarantee, nothing is, but other languages don't have even that.


Thanks for the explanation. I see your point about panics, though using panics is rare in Go and not what would normally happen in a goroutine that has an error. If you know your goroutine won’t panic, getting the result or error from a channel seems sufficient in most cases, but it’s true that you can’t always know that.


The problem isn't about using panics, or "knowing that your goroutine won't panic". Things happen. Unhandled errors happen. Unhandled errors from processes happen :)

Erlang'd documentation used to have a section called "Do not program defensively" [1] This is known as "let it crash" philosophy. Or, better put, that Erlang has auto healing mechanisms [2]

When applied correctly, it significantly reduces the amount of boiler plate code you need to write because you're only concerned with the happy path in most of your code.

[1] A copy is available here: https://docs.jj1bdx.tokyo/Erlang_Programming_Rules.html#HDR1...

[2] Erlang has auto healing mechanisms


And yet it doesn't matter.


It should.

Then in the vast majority of cases we wouldn't run kubernetes clusters running docker containers for one-off tasks and single services. Or "serverless functions".

Unfortunately even the otherwise very smart folks of Go and Rust only see "ah, lightweight threads, got you". That's why, for example, you get irrecoverable panics in both languages and awkward attempts to patch over them in later versions.

Meanwhile Armstrong's thesis "Making reliable distributed software in the presence of hardware/software errors" is over thirty years old now.


> It should

Should it?

> otherwise very smart folks of Go and Rust

Ahh, everyone else is wrong. Gotcha. RabbitMQ is life(LOL), god save the BEAM!


Understanding LiveViews as a concept could make it easier to commit to learning a new language. I am not saying one should but that one could and it would probably be easier since you don't have the additional overhead of also learning what is a LiveView.


Same reason why people may get hooked on some fp library can lead to them trying Haskell.


Is your friend's python library open source by any chance? I was thinking about doing the same.



There is a port of it to JavaScript/Typescript. https://LiveViewJS.com

It uses the same front end javascript from Phoenix and speaks the same protocol.

Note: am author


Does this work with Astro (or Next.js)?


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: