TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Thoughts on Clojure UI framework

262 pointsby lycopodiopsidaover 3 years ago

24 comments

Zababaover 3 years ago
&gt; Did I miss something important that should be covered?<p>Accessibility. Outside of that everything seems reasonable. But I don&#x27;t know much about cross-platforms GUI. I expect someone will come and explain that Delphi or something like that already does everything the author wants except for the integration with Clojure.<p>I would add that I&#x27;m not sure which value Clojure provides here. Does the REPL adds anything to the live-reload environment? If not, the choice of Clojure seems to be arbitrary.
评论 #28473777 未加载
评论 #28475421 未加载
评论 #28505004 未加载
评论 #28484081 未加载
cosmoticover 3 years ago
I think the article is conflating people&#x27;s acceptance of web apps with people&#x27;s appreciation of web apps. Web apps (or electron apps) are always worse than a well-written native counterpart in every verifiable UX metric. Let&#x27;s not kid ourselves: web apps and electron apps are developer-experience focused, not user centered.
评论 #28473374 未加载
评论 #28478432 未加载
评论 #28475686 未加载
评论 #28473239 未加载
throwaway34241over 3 years ago
From &quot;Why not web&quot;:<p>&gt; I think the fundamental problem of the web is that its APIs are too high‑level.<p>Frameworks like Flutter (at least one backend) [1] [2] and Gio [3] use low-level APIs like WebGL and WebAssembly. That might not be the right choice for a web-first framework but seems reasonable for apps that would otherwise be desktop-only and need low-level access to be compatible with the native version.<p>It looks like he&#x27;s using Skia for rendering so the WebGL&#x2F;WebAssembly Skia port that Flutter uses might be a particularly good fit.<p>I assume a Clojure project would use Clojurescript if it had a web target, but I&#x27;m not familiar enough to know if the Clojure&#x2F;Clojurescript differences [4] pose a big obstacle for this sort of UI framework or not.<p>[1] <a href="https:&#x2F;&#x2F;flutter.dev&#x2F;docs&#x2F;development&#x2F;tools&#x2F;web-renderers" rel="nofollow">https:&#x2F;&#x2F;flutter.dev&#x2F;docs&#x2F;development&#x2F;tools&#x2F;web-renderers</a><p>[2] <a href="https:&#x2F;&#x2F;skia.org&#x2F;docs&#x2F;user&#x2F;modules&#x2F;canvaskit&#x2F;" rel="nofollow">https:&#x2F;&#x2F;skia.org&#x2F;docs&#x2F;user&#x2F;modules&#x2F;canvaskit&#x2F;</a><p>[3] <a href="https:&#x2F;&#x2F;gioui.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gioui.org&#x2F;</a><p>[4] <a href="https:&#x2F;&#x2F;clojurescript.org&#x2F;about&#x2F;differences" rel="nofollow">https:&#x2F;&#x2F;clojurescript.org&#x2F;about&#x2F;differences</a>
zorrover 3 years ago
This is a great writeup and good to see I&#x27;m not the only one looking at JVM for cross platform desktop apps.<p>Recently I&#x27;ve been experimenting with TornadoFX and it is very nice to work with. It&#x27;s a Kotlin wrapper for JavaFX providing a &quot;declarative builder DSL&quot; to compose views. It uses a MVVM approach where the View components are bound to the ViewModel using observables. JavaFX supports CSS for styling components including variables without the clunky web css variable syntax. And with Kotlin coroutines&#x2F;suspend functions it&#x27;s trivial to add async IO for network and disk access.<p>Combine all that with modern JVM and Gradle tooling for native packaging (deb&#x2F;rpm&#x2F;msi&#x2F;dmg) and access to the huge ecosystem of JVM libraries.<p>Of course there are drawbacks. JVM startup time isn&#x27;t great but even with Spring Dependency Injection my project starts up in under a second which is fine for a long-running desktop app imho. It will never be as fast or consume as little memory as a native toolkit does but to me it&#x27;s the pragmatic sweet spot in between native toolkits and packaging a full webbrowser like Electron.<p>I&#x27;m not affiliated with TornadoFX or JavaFX, just a happy user that has rediscovered joy in building desktop apps again.
thomover 3 years ago
I have been enjoying working on a cljfx project recently. Extremely fast to get a prototype together, proper multi core support for number crunching, whole JVM ecosystem to reach out for functionality. Probably not for the faint hearted but it has the advantage that it exists today.
评论 #28479669 未加载
评论 #28473708 未加载
Zelphyrover 3 years ago
&quot;The web started to get more suitable for apps probably since Gmail in 2004. It’s very convenient, yet still very limited and has shortcomings.&quot;<p>Yes. I worked for over a decade to make web apps behave more like native apps. I finally realized it was a fruitless endeavor. The browser and the web are amazing but, trying to make them behave like native apps just doesn&#x27;t offer the same experience and, in most cases, offers a worse experience. All one need as proof are all the Electron apps or the Apple Music desktop app.
评论 #28473639 未加载
评论 #28472741 未加载
tadfisherover 3 years ago
Compose is still data-oriented! It&#x27;s not only possible to pass a Button around, it&#x27;s encouraged. The representation you should pass is a higher-order function, or lambda:<p><pre><code> val button: @Composable () -&gt; Unit = { Button(...) } List(button) &#x2F;&#x2F; definitely possible </code></pre> The advantage is encapsulation: Button as a lambda exposes no external state, so you don&#x27;t create tangled graphs of data dependencies in your UI.<p>You should definitely take another look at Compose, because this concept maps extremely well onto Lisps in general (code is data) and Clojure in particular (tight composition of immutable state).
评论 #28505131 未加载
pgtover 3 years ago
Go go go Nikita! If there is anyone in the Clojuresphere who could pull this off, it is Tonsky.
评论 #28505121 未加载
chrismorganover 3 years ago
&gt; <i>[Electron] can’t […] render smooth 144Hz animations</i><p>Hmm? I’m on a 165Hz screen, Arch Linux&#x2F;Sway, and Firefox and Chromium both do 165Hz just fine¹, both with CSS animations and with JavaScript requestAnimationFrame. I would expect Electron to behave the same way.<p>To be sure, you’ll have to be a tad more careful at higher frame rates, but my point is that it <i>can</i> render smooth 144Hz animations.<p>—<p>¹ When run under Wayland; XWayland is apparently still locked to 60Hz.
评论 #28484629 未加载
brundolfover 3 years ago
As someone who believes Electron is genuinely the best existing option for cross-platform desktop apps (and possibly desktop apps in general), I&#x27;m excited to see someone trying to make something better by <i>incorporating</i> that context and that progress instead of ignoring it. The goals and the ideas here sound well-thought-out, and not tone-deaf, and I really hope this goes somewhere.
评论 #28473659 未加载
评论 #28473822 未加载
评论 #28505193 未加载
zerrover 3 years ago
Qt doesn&#x27;t wrap the native controls, wxWidgets does.
评论 #28505150 未加载
tharneover 3 years ago
This is really cool. It&#x27;s great to see someone pushing for good desktop applications. I&#x27;m not an electron hater, but I don&#x27;t love it either, and I&#x27;m happy to see new alternatives emerge, in a fun language like clojure no less.
评论 #28475543 未加载
elias94over 3 years ago
Clojure ecosystem really need something similar. The ability to not have to deal with Clojuscript and to pack-ship an app with desktop UI easily.<p>With the work you did on Skija we have high hope! Good luck and keep us updated
cosmoticover 3 years ago
I thought Swing did an excellent job with native UIs, though it did take some care by the developer.
评论 #28473179 未加载
webmobdevover 3 years ago
While I appreciate the time invested in researching all this, I feel this is &quot;reinventing the wheel&quot;. Native GUIs almost always offer superior performance and already offer everything that the developer(s) of a new framework would have to reinvent. Thus, a wrapper around native GUIs makes the most sense. (GUI frameworks on Linux though does need an improvement or a complete revamp. )
评论 #28473794 未加载
评论 #28473974 未加载
评论 #28487276 未加载
czabajover 3 years ago
&gt; CSS in JS as a good idea (we won’t start from CSS separated from layout, but it’s good to not to repeat HTML’s mistake).<p>The HTML and CSS separation is great for accessibility. It is also great for machine processing. On the web &quot;content is the king&quot; which might not be true on native apps, but I tend to feel that separation of content and its _visual_ appealing is a good thing in general, only if CSS would have substantially less quirks.
chrisweeklyover 3 years ago
Brilliant! Love it! Good luck! Keep us posted!
solarkraftover 3 years ago
Interesting that yesterday&#x27;s submission of this got buried. Let me repeat and elaborate because it&#x27;s somewhat close to my heart.<p>&gt; I plan to focus on the high‑quality desktop instead of finding a mediocre middle ground between desktop and mobile.<p>Oh god damn it. This space is severely under-served. It&#x27;s only filled by Xamarin Forms, React Native (kinda), Flutter and web. They all kind of suck for desktop apps.<p>It doesn&#x27;t even have to do both well. It just has to be a great experience on one platform and an okay one on others. Phone apps can be good desktop apps with minimal modification (as Apple realizes 5 years after Microsoft almost did) and not many things are worse than happening to use one platform and your data&#x2F;functionality just <i>not being available</i> on it.<p>Stop it, please. Smartphones are computers. They&#x27;re used for the same things and <i>increasingly so</i>. Stop pretending they&#x27;re fundamentally different. They&#x27;re not.<p>Guess why the Web is eating everything. It&#x27;s WORA. And there&#x27;s close to no competition.
评论 #28473345 未加载
评论 #28473610 未加载
评论 #28475601 未加载
meowphiusover 3 years ago
I read somewhere when someone was criticizing Rust for GUI stuff, that lack of OO and inheritance can be a real problem. Is that also true for Clojure?
评论 #28476352 未加载
评论 #28473609 未加载
评论 #28505240 未加载
Taruchoover 3 years ago
GUIs are one of the domains where object orientation shines. The ability to express in code a set of physically bounded widgets with visual a representation that matches their state is probably a biggest win for OOP. FP, I guess its not that intuitive.
billfruitover 3 years ago
Will it support shipping apps as a single jar?
评论 #28505251 未加载
creamytacoover 3 years ago
You criticize Electron and then proceed to make pretty much the same mistake by using ... JVM. I don&#x27;t think this is going to fly as a better alternative to JavaScript. It&#x27;s just one evil exchanged for another.<p>And I&#x27;ll be extremely surprised if you manage to do smooth animations at 144Hz in Clojure without killing battery life.
Scarbuttover 3 years ago
Why use the language with the most horrible startup time for a GUI framework though? The core might be C&#x2F;C++, but users will write their app in Clojure. GraalVM also still has big limitations.
评论 #28475677 未加载
评论 #28473578 未加载
mosdlover 3 years ago
Hates on Electron and bloat, but is fine using vdom which also adds memory bloat? Seems like a wierd combo.
评论 #28475722 未加载
评论 #28473072 未加载
评论 #28473031 未加载