# Check out Qwik; Could Elm adapt?

**URL:** <https://discourse.elm-lang.org/t/check-out-qwik-could-elm-adapt/8690>\
**Category:** Learn\
**Created:** [October 3, 2022, 2:51pm UTC](https://discourse.elm-lang.org/t/check-out-qwik-could-elm-adapt/8690 "2022-10-03T14:51:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tails](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/tails/32/4359_2.png) [@Tails](https://discourse.elm-lang.org/u/Tails)\
**Post date:** [October 3, 2022, 2:51pm UTC](https://discourse.elm-lang.org/t/check-out-qwik-could-elm-adapt/8690/1 "2022-10-03T14:51:09Z")

</div>

There is a new kind of JS framework called ‘Qwik’ that only downloads and parses code/handlers when needed, speeding up a frontend application immensely:

[![](https://img.youtube.com/vi/0dC11DMR3fU/maxresdefault.jpg "WWC22 - Qwik + Partytown: How to remove 99% of JavaScript from main thread") ](https://www.youtube.com/watch?v=0dC11DMR3fU)

It actually reminds me of something in Clojure that is also being developed:

> **[Notion – The all-in-one workspace for your notes, tasks, wikis, and databases.](https://hyperfiddle.notion.site/Reactive-Clojure-You-don-t-need-a-web-framework-you-need-a-web-language-44b5bfa526be4af282863f34fa1cfffc)**
>
> A new tool that blends your everyday work apps into one. It's the all-in-one workspace for you and your team

Since Elm is functional, something similar could perhaps be done by slicing the app in separate functions that are JIT-loaded.

What are your thoughts?

---

<div class="post-metadata">

**Author:** ![mattpiz](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/mattpiz/32/860_2.png) [@mattpiz](https://discourse.elm-lang.org/u/mattpiz)\
**Post date:** [October 3, 2022, 5:08pm UTC](https://discourse.elm-lang.org/t/check-out-qwik-could-elm-adapt/8690/2 "2022-10-03T17:08:07Z")

</div>

The pure functional nature of Elm could definitely help it do smarter things. However, in the current state, the JS code delivered from the compilation of your Elm code is very rarely the bottleneck of your webpage loading performance issues.

If you follow the compilation and optimization + minification steps of the guide ([Minification · An Introduction to Elm](https://guide.elm-lang.org/optimization/asset_size.html)) your compiled and zipped Elm code becomes really small. This is thanks to the ability of the Elm compiler to only include used functions in your compiled call where most JS framework can only work at the module frontier, or at least cannot remove as much as the Elm compiler can.

Companies with 100K line codes of Elm can get JS bundles for the elm part of couple hundreds Kb. Considering this huge scaling advantage, there hasn’t been much need for more advanced strategies yet.

---

<div class="post-metadata">

**Author:** ![ceddlyburge](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/ceddlyburge/32/2316_2.png) [@ceddlyburge](https://discourse.elm-lang.org/u/ceddlyburge)\
**Post date:** [October 5, 2022, 10:29am UTC](https://discourse.elm-lang.org/t/check-out-qwik-could-elm-adapt/8690/3 "2022-10-05T10:29:54Z")

</div>

I saw this talk and Qwik looks truly excellent. As Matthieu says though, maybe not required for Elm unless you have really huge projects.

---

<div class="post-metadata">

**Author:** ![solificati](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@solificati](https://discourse.elm-lang.org/u/solificati)\
**Post date:** [October 6, 2022, 9:24am UTC](https://discourse.elm-lang.org/t/check-out-qwik-could-elm-adapt/8690/4 "2022-10-06T09:24:34Z")

</div>

Elm doesn’t even try to be the same solving problem space as Qwik. We barely have SSR in Elm.

Qwik is quite complicated under the hood and it is not a pluggable solution. To reimplement something like that in framework of choice we need SSR and partial hydration and then a way to slice code base by behaviour. Elm can’t do this on granular level. Elm architecture requires our favourite tuple of functions and you can’t divide it further (Cue all blog posts that explain to beginners that we don’t do components in Elm).

And to clarify one thing - Qwik is a solution to real problems and Elm compiler is not a different solution. If you’re conscious of performance metrics of your page Elm is still a naive solution. And maybe it is ok, because most of Elm applications are not concerned with performance and their users can deal with longer LCP/TTI times. That let us keep Elm focused.

But let’s not undermine big advancements in this field by frontend community with solutions that can shave off more and more milliseconds from these metrics.

---

<div class="post-metadata">

**Author:** ![gampleman](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/gampleman/32/43_2.png) [@gampleman](https://discourse.elm-lang.org/u/gampleman)\
**Post date:** [October 6, 2022, 10:52am UTC](https://discourse.elm-lang.org/t/check-out-qwik-could-elm-adapt/8690/5 "2022-10-06T10:52:33Z")

</div>

Also there are different performance metrics to consider and are important in different contexts.

The speaker mentions that most of their customers are in the e-commerce sector. I think that really shows on what they prioritised in their design, as e-commerce is notorious for being highly sensitive for initial page load performance. The impulsive shopping behaviour can really be optimised by putting as little opportunity for you to change your mind before actually paying for something.

Is Elm the ideal technology for that use case? I wouldn’t think so. It optimises for different goals. For instance I’ve been mostly using it in complex B2B use cases, where user sessions can be very lengthy and deal with large amounts of data. Here initial load time is not the most crucial of metrics (albeit it still is something we pay attention to), so much as the time individual user interactions take as you move to complete various tasks within the application. Having a Qwik like design is likely to hurt some of these metrics as you are loading code on demand, so you may have to wait for code to load before an action can be processed (although they seem to be able to at least partially mitigate this by preload tags).

The other important metric that Elm optimises for is developer productivity and happiness. The importance of this again depends on business needs.

---

<div class="post-metadata">

**Author:** ![wolfadex](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/wolfadex/32/2461_2.png) [@wolfadex](https://discourse.elm-lang.org/u/wolfadex)\
**Post date:** [October 6, 2022, 11:39am UTC](https://discourse.elm-lang.org/t/check-out-qwik-could-elm-adapt/8690/6 "2022-10-06T11:39:30Z")

</div>

The closest thing to this that I’m aware of in Elm would be elm-pages. I know the alpha of v3 is available and a beta is being worked towards.

It’s not the same as Qwik, but it does off features like prerendering pages on serverless. It’s probably closer to Remix or Next/Next which are trying to solve similar problems.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [October 16, 2022, 11:39am UTC](https://discourse.elm-lang.org/t/check-out-qwik-could-elm-adapt/8690/7 "2022-10-16T11:39:47Z")

</div>

Closed on October 16, 2022, 11:39am UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
