Fork me on GitHub
#announcements
<
2021-07-18
>
Jakub19:07:12

I created an example of building terminal UI (TUI) with Clojure and native bindings to https://notcurses.com/, 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: https://github.com/dundalek/notcurses-clojure-example

πŸŽ‰ 24
❀️ 18
πŸš€ 13
ribelo21:07:44

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

Jakub07:07:00

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.

ribelo11:07:38

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

πŸ˜‚ 4
borkdude17:07:46

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

phronmophobic18:07:05

I have a demo of running a todo app terminal ui, https://github.com/phronmophobic/terminal-todo-mvc There are also examples using https://github.com/phronmophobic/membrane-re-frame-example and https://github.com/phronmophobic/membrane-fulcro 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 https://github.com/eccentric-j/cljs-tui-template. I haven't used it, but it looks pretty good.

Jakub21:07:27

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.

phronmophobic21:07:11

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

πŸ‘ 2
ribelo22:07:50

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.

borkdude09:07:17

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

Jakub20:07:12

@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.

Jakub20:07:10

@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.

ribelo20:07:09

@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.

borkdude20:07:41

@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.

ribelo20:07:16

By the way, I'm really rooting for https://github.com/dundalek/liz, although I haven't had a chance to use it yet.

Jakub20:07:01

@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.

borkdude20:07:20

what's ink again?

ribelo20:07:44

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

Jakub20:07:18

I have some examples in the section https://github.com/dundalek/liz#examples 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 πŸ™‚

Jakub20:07:45

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.

ribelo20:07:13

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

phronmophobic20:07:07

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

phronmophobic20:07:46

some c libraries are easier to wrap than java!

ribelo21:07:31

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

phronmophobic21:07:46

there's probably more

borkdude21:07:21

JNA isn't compatible with GraalVM tho

phronmophobic21:07:37

but dtype-next is

Jakub21:07:45

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: https://github.com/askonomm/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
3
❀️ 4
πŸŽ‰ 2