Live data from Hacker News

Popcorn: Run Elixir in WASM

popcorn.swmansion.com

21–30 of 31 posts

Re: Popcorn: Run Elixir in WASM

#21

I'm honestly surprised at how slow WASM is moving. As a very experienced web dev, when I first learned about WASM I was sure people would be building production UIs in Python and Golang and other traditionally server-side languages.

I really hope nobody plans to make web front-ends in Python. Jesus.

Re: Popcorn: Run Elixir in WASM

#22

I'm honestly surprised at how slow WASM is moving. As a very experienced web dev, when I first learned about WASM I was sure people would be building production UIs in Python and Golang and other traditionally server-side languages.

That's what the .NET folks have been doing for many years now. Blazor is .NET on the client-side

Re: Popcorn: Run Elixir in WASM

#23
post #13

I'm honestly surprised at how slow WASM is moving. As a very experienced web dev, when I first learned about WASM I was sure people would be building production UIs in Python and Golang and other traditionally server-side languages.

That’s actually what I feared the most and I’m glad we haven’t seen it happen. Python and Go are not small languages, making users download entire runtimes to do something that can be done fine without them would be a huge shame. The performance problem with web UI is the DOM, not JavaScript.

At least with Go static analysis should allow you to tree shake the bits you aren’t using.

The problem with the CDN solution was always that it assumed that everyone would be on a couple versions and that never happens. With success comes more contributors and with more contributors come more point releases and more users who are not on the latest version.

So soon you could have five versions for five sites you visit.

Re: Popcorn: Run Elixir in WASM

#24
post #13

I'm honestly surprised at how slow WASM is moving. As a very experienced web dev, when I first learned about WASM I was sure people would be building production UIs in Python and Golang and other traditionally server-side languages.

That’s actually what I feared the most and I’m glad we haven’t seen it happen. Python and Go are not small languages, making users download entire runtimes to do something that can be done fine without them would be a huge shame. The performance problem with web UI is the DOM, not JavaScript.

I kind of thought popular runtimes would just be bundled with the browser if we could get an "official" enough source (e.g. Python Software Foundation or Google). Then users wouldn't need to download a million different versions and sources of Python for each website.

Re: Popcorn: Run Elixir in WASM

#25
post #12

Earlier quoted context omitted.

I thought blazor failed because people didn't like websites that take minutes to load up all the websites assets. I'm not sure why, it could be: - Technical issue with blazor performance or blazor makes perf regressions hard to fix - blazor technical framework encourages programming style that is bad for perf - blazor or blazor ecosystem attracts programmers that can't deal with perf issues

As I understand it, blazor really needs WasmGC in order to have good performance and small bundle sizes. Otherwise, blazor is forced to ship a GC inside the wasm bundle - and that adds a lot of weight. And it also makes it more complex to share C# objects with javascript. WasmGC is supported in all browsers + nodejs now, but its still pretty new. Safari only started shipping it in December last year. I'm not sure if…

.NET doesn't use WasmGC because Microsoft found it too different from how .NET's GC works. Which is quite unfortunate

Re: Popcorn: Run Elixir in WASM

#26
post #20
post #4

AtomVM is something like 1m when compiled, isn't it?

Compiled to WASM it's ~700K, gzipped only 190K. But there's also BEAM code - the whole standard library is ~3M gzipped. We plan to do tree shaking to only include the used parts of the stdlib - then it should get way smaller for most use cases.

That's a lot of wasm and beam. I tried to do it the other way -- compile beam straight to wasm and it seems to work in straightforward cases, producing wasm binaries in kilobytes sizes. With wasm fx it's even possible to do processes natively. You can find the link in bio.

Cool thing would be to somehow wire it up to liveview to make it possible to run some parts on the frontend side transparently.

I'm not doing any active development on it right now, but it looked pretty doable when I tried last time.

Re: Popcorn: Run Elixir in WASM

#27
post #12

Earlier quoted context omitted.

As I understand it, blazor really needs WasmGC in order to have good performance and small bundle sizes. Otherwise, blazor is forced to ship a GC inside the wasm bundle - and that adds a lot of weight. And it also makes it more complex to share C# objects with javascript. WasmGC is supported in all browsers + nodejs now, but its still pretty new. Safari only started shipping it in December last year. I'm not sure if…

.NET doesn't use WasmGC because Microsoft found it too different from how .NET's GC works. Which is quite unfortunate

Oh what a pity. Anywhere I can read more about that?

Re: Popcorn: Run Elixir in WASM

#28
post #27

Earlier quoted context omitted.

.NET doesn't use WasmGC because Microsoft found it too different from how .NET's GC works. Which is quite unfortunate

Oh what a pity. Anywhere I can read more about that?

I can't find the actual decision, but there was some discussion here: https://github.com/WebAssembly/gc/issues/77 Microsoft later in 2023 said that that discussion "is the current state we are in. We will keep eye on wasm GC in the future."

edit: found a more concrete statement https://github.com/dotnet/runtime/issues/94420

Re: Popcorn: Run Elixir in WASM

#29
post #12

Earlier quoted context omitted.

I thought blazor failed because people didn't like websites that take minutes to load up all the websites assets. I'm not sure why, it could be: - Technical issue with blazor performance or blazor makes perf regressions hard to fix - blazor technical framework encourages programming style that is bad for perf - blazor or blazor ecosystem attracts programmers that can't deal with perf issues

As I understand it, blazor really needs WasmGC in order to have good performance and small bundle sizes. Otherwise, blazor is forced to ship a GC inside the wasm bundle - and that adds a lot of weight. And it also makes it more complex to share C# objects with javascript. WasmGC is supported in all browsers + nodejs now, but its still pretty new. Safari only started shipping it in December last year. I'm not sure if…

Then explanations 2&3?

Re: Popcorn: Run Elixir in WASM

#30

I'm honestly surprised at how slow WASM is moving. As a very experienced web dev, when I first learned about WASM I was sure people would be building production UIs in Python and Golang and other traditionally server-side languages.

[dead]
Post reply on HN