Fork me on GitHub

I created an example of building terminal UI (TUI) with Clojure and native bindings to, a modern library with advanced graphics support (different from ncurses, check out the video on their homepage to see what terminals are capable of). It includes a compilation step with GraalVM native-image to produce an excutable binary with instant startup time:

πŸŽ‰ 24
❀️ 18
πŸš€ 13

I would give a lot for something like rs-tui or termui for clojure....


That would be the next step, I think we can build some higher level widgets in Clojure on top of Notcurses, which will handle the lower-level tricky terminal bits.


Once it gets to the point where I understand what's going on, I'm in.

πŸ˜‚ 4

Probably @U7RJTCH6J has some ideas here as well, as he has a UI framework which abstracts reagent, lanterna (similar thing), etc.


I have a demo of running a todo app terminal ui, There are also examples using and for state management. Currently, lanterna is used for "graphics", and events, but it wouldn't be too hard to add another backend based on notcurses. That might be useful if notcurses makes it easy to draw certain elements like graphs. Fwiw, cljs has I haven't used it, but it looks pretty good.


Previously I tried react-blessed and react ink, but I found some limitations and also it would be nice to have something with react-like interface that works in Clojure proper. Membrane looks really cool, from a quick glance it looks exactly what I was looking for, will definitely give it a try.


:thumbsup: . if you run into any issues or have questions, feel free to ask in #membrane

πŸ‘ 2

I also used react-blesed and got disappointed, now I basically forked ink and write most things myself from scratch in cljs. However I would still prefer to use clj instead of cljs.


@U70QD18NP Perhaps I should try to learn some Zig, it looks useful.


@U0BBFDED7 yeah, react-blessed being a wrapper over imperative library it has bunch of issues that surface out. ink is much nicer, more in line with modern react, simpler and better layout support using flexbox. The issue with ink is that it does not support layering (no modal windows), does not support labels on boxes and glitches with newer unicode versions.


@U04V15CAJ I can recommend it, Zig is a nice tool to have in a toolbelt. For me it covers the remaining use cases that are not covered by clj, cljs, and babashka. It is also a pretty small and simple language, most of it can be learnt in one afternoon.


@U70QD18NP I don't need layering, although I'd probably be happy if there was. I added the labels to myself and would be happy to do a PR if @vadimdemedes is interested, which he probably won't be. Regarding the glitches, commits were merged yesterday that seem to fix it. I think it was even your commits if I remember correctly.


@U70QD18NP Can you show me any fun Zig projects I can hack and play with, besides your notcurses project? I did do some Rust programming, but Zig sounds really cool as well. Perhaps I can make a babashka pod with it.


By the way, I'm really rooting for, although I haven't had a chance to use it yet.


@U0BBFDED7 I am currently working on a project using ink so I made a PR to fix the most glaring bug. But there are more subtle ones, which I am not sure if they are fixable withhout a major rewrite.


what's ink again?


very bad name to find and even the black belt in google fu does not help


I have some examples in the section which include both Liz and Zig source, last year I did some advent of code with it, thanks to low level speed was able to brute force a solution instead of coming up with proper algo πŸ™‚


Also if you have some lower level project i a drawer perhaps using some C library or OS syscals it might be a good fit. Zig has seamless interop with C like Clojure interops with Java.


zig looks very good, like something between rust and c. The problem is that it is very young and there is no ecosystem around it yet


Clojure's interop with C is pretty good with clojure-jna and/or dtype-next


some c libraries are easier to wrap than java!


@U7RJTCH6J Is there an example on the web of how to use this?


there's probably more


JNA isn't compatible with GraalVM tho


but dtype-next is


I also have some experiments writing JNI bindings in Liz which should be graal compatible, I can try clean it up and publish.

Asko Nōmm20:07:48

I started developing a block-based WYSIWYG editor in CLJS (for use within JavaScript and CLJS projects) called Blocko: The idea is to create something similar to what WordPress Gutenberg editor is, albeit a lot simpler. It’s currently in a 0.1 with a lot of things still pending to do, but it does work and I’m quite excited about it - and how surprisingly easy it is to build something like that with Clojure.

πŸ‘€ 24
πŸ‘ 20
❀️ 4
πŸŽ‰ 2