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.

Puny GUI – A tiny cross platform GUI Kit in Janet

130 pointsby ahungryabout 5 years ago

15 comments

overgardabout 5 years ago
GUI frameworks are big because they do a lot. These minimalist things usually only work until you reach the limits of what they can do and then you have to rewrite in something like Qt anyway, or sacrifice what your users want in a GUI for your own code aesthetics.
评论 #22978865 未加载
评论 #22978639 未加载
评论 #22981257 未加载
评论 #22985712 未加载
评论 #22978789 未加载
FraKtusabout 5 years ago
I disagree with the author, it&#x27;s really easy to test the examples of Nuklear.<p>I made applications with Nuklear that runs on Android, iOS, macOS, Windows and share the same main C code. For me, it&#x27;s a dream come true if you create a cross-platform application that needs a simple GUI.<p>Dear ImGui is also fantastic and more complete than Nuklear.<p>What I like a lot with Nukear and Dear Imgui is that you have a GUI that is GPU accelerated and so can be updated at 60 FPS without burning resources.
评论 #22977826 未加载
评论 #22976772 未加载
评论 #22977636 未加载
pierrecabout 5 years ago
&quot;<i>The solution (hint: there wasn&#x27;t one until now)...</i>&quot; That&#x27;s quite the bold statement. I actually thought of IUP&#x2F;Lua when I saw this line, and it turns out you precisely used IUP for the UI portion of your framework! Except you didn&#x27;t use the Lua binding, instead you created a Janet binding.<p>Using something like luastatic[1], with whatever Lua libraries you want (including IUP), you can get something pretty similar to this system, except of course you&#x27;d be using Lua instead of Janet. Janet is really interesting and that alone justifies this framework very well.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;ers35&#x2F;luastatic" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;ers35&#x2F;luastatic</a>
评论 #22975738 未加载
评论 #22976249 未加载
评论 #22978680 未加载
评论 #22982424 未加载
liuliuabout 5 years ago
Seems to be based on iup that supports both Windows and Linux? <a href="http:&#x2F;&#x2F;webserver2.tecgraf.puc-rio.br&#x2F;iup&#x2F;" rel="nofollow">http:&#x2F;&#x2F;webserver2.tecgraf.puc-rio.br&#x2F;iup&#x2F;</a><p>The new crop of immediate mode cross platform GUI libraries are more interesting (such as nuklear and Dear Imgui). I also did some experimentation with these libs a few days ago: <a href="https:&#x2F;&#x2F;liuliu.me&#x2F;eyes&#x2F;write-cross-platform-gui-in-swift-like-it-is-1998&#x2F;" rel="nofollow">https:&#x2F;&#x2F;liuliu.me&#x2F;eyes&#x2F;write-cross-platform-gui-in-swift-lik...</a>
评论 #22977687 未加载
csb6about 5 years ago
For anyone needing a simple and fast cross-platform toolkit for C++, FLTK is really good. It is easy to build and statically link only the parts you need, and the API&#x2F;widget selection is pretty good. It looks a little old school&#x2F;non&#x2F;native, but it has been useful for me.
评论 #22977127 未加载
评论 #22977609 未加载
vidugaviaabout 5 years ago
Cool. I fell in love with Janet during last advent of code, so I&#x27;ll definitely give it a try
ashkankianiabout 5 years ago
With opengl, libuv, and libcurl, and Dear Imgui, I can write a C program resulting in a binary that&#x27;s about 400kB unstripped, to put 5MB in perspective. And for a simple program like what you wrote, I don&#x27;t even bother trying to free the memory myself sometimes, I just let the OS free it when I exit. With that design choice in mind, the end code is like &lt;1000 lines, and a decent bit is reused snippets.<p>In the end, this feels like a an appraisal of IUP and Janet more than a demo of anything new. If that&#x27;s the case, then familiarity with your stack is more important for this kind of productivity than anything else, so trying something new is less appealing to me.<p>But I was curious about Janet, so seeing some examples was nice.
评论 #22975928 未加载
9214about 5 years ago
Interesting pitch for Janet. Here [1] is a quick rewrite in Red language, which lives up to the author&#x27;s requirements: 10 LOC, native support for all 3 major platforms, can be shipped as a single binary, and all that&#x27;s required is a 1MB toolchain.<p>[1] <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;9214&#x2F;dfa15d37342065dbf368eae35abcdc37" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;9214&#x2F;dfa15d37342065dbf368eae35abcdc3...</a>
crispinbabout 5 years ago
<i>However, the elephant in the room (which I also like to ignore as a Clojure enthusiast) is that the start up time of a Java based GUI app is too slow (this is exacerbated even moreso when Clojure is involved)</i><p>I&#x27;m expecting a GraalVM rejoinder from someone. For anyone who&#x27;s used GraalVM (particularly with Clojure) - what are the downsides and limitations?
评论 #22976570 未加载
评论 #22975754 未加载
评论 #22976389 未加载
_emacsomancer_about 5 years ago
What about macOS? So far Racket seems like the easiest solution for a lisp with easy cross-platform GUI support (Linux, Mac, Windows). It would be nice to have more easy choices, but also nice if all 3 major platforms were supported.
评论 #22976582 未加载
评论 #22979073 未加载
评论 #22976786 未加载
bmn__about 5 years ago
Subtracting all the delusional fluff about small sizes, this article is about a Janet binding to Gtk3.<p>ldd app.bin|rg -o &#x27;&#x2F;usr&#x2F;lib[^ ]+&#x27;|xargs stat -L -c %s|perl -lne&#x27;$s += $_; END {print $s}&#x27;<p>38120904
评论 #22977953 未加载
andrewncabout 5 years ago
I love new programming languages, I&#x27;ll have to give Janet a go and see how I like it
评论 #22975770 未加载
asimjalisabout 5 years ago
Neat. Are there screenshots?
coleiferabout 5 years ago
Tcl&#x2F;Tk dabs on your gui frameworks from the unreachable pinnacle of the heavens.
CharlesMerriam2about 5 years ago
How about English? This is just programed as:<p>&gt; Puppy is an app<p>OK, you run &#x27;Puppy&#x27;. It doesn&#x27;t do anything.<p>&gt; RandomHost is &#x27;<a href="https:&#x2F;&#x2F;dog.ceo&#x2F;api&#x2F;breeds&#x2F;image&#x2F;random&#x27;" rel="nofollow">https:&#x2F;&#x2F;dog.ceo&#x2F;api&#x2F;breeds&#x2F;image&#x2F;random&#x27;</a><p>OK, &#x27;RandomHost&#x27; is a constant, looks like a URL<p>&gt; Get an image from RandomHost<p>OK, I think you meant Set Message to Read RandomHost retreiving UUENCODE.<p>&gt; No. Get an image using json<p>Not the previous thing. I think you meant Set Message to Read RandomHost retrieving JSON, field Message.<p>&gt; Get Image at Message<p>OK. I think you meant Read the URL Message and retrieve an image file<p>&gt; Show the Image<p>OK. Displaying the Image on the screen<p>&gt; Add Repeat Button<p>OK. Displaying a button named &#x27;Repeat&#x27;<p>&gt; App is While on Repeat, do the Display.<p>OK. App is set. Do display, Wait for Repeat button, Loop<p>&gt; Puppy?<p>Puppy is an application:<p><pre><code> Repeat RandomHost = &#x27;https:&#x2F;&#x2F;dog.ceo&#x2F;api&#x2F;breeds&#x2F;image&#x2F;random&#x27; Message = fetch(RandomHost, JSON).&quot;message&quot; anImage = fetch(Message, DATA).ensure(IMAGE_TYPE) Display.reset(Items [ Image: An Image, Button: Repeat text &quot;Repeat&quot; ]) ClientSideWait Repeat.onPress Forever </code></pre> &gt; Problems?<p>Your app can run.<p>You have eight error conditions to discuss. Use &#x27;Talk about errors&#x27; to decide how to handle them. Right now, the answer is &#x27;ignore first, or just explode&#x27;.<p>&gt;Push<p>Pushing transcript to GitLab.... Building App.... Pushing Build to GitLab.<p>&gt; Move button above image.