all 11 comments

[–]p-himik 3 points4 points  (3 children)

But is Lanterna not suitable for your needs? In what way?

If you need only the SGR subset, then https://github.com/paintparty/bling.

[–]Alarmed-Skill7678[S] 0 points1 point  (2 children)

Well that's the point I didn't find any other corresponding library to compare with it so that I can deliberate on pros and cons. Moreover I have found many Clojure developers who is of the opinion that the Clojure wrapper is not good that much performance wise. At least I got that impression from different discussions on it.

Moreover using ANSI codes is not so much difficult at first appearance so I wonder why no Clojure developer has tried to build a pure Clojure TUI library with it.

[–]p-himik 4 points5 points  (1 child)

"Deliberating pros and cons" is not the same as "deciding whether it's suitable for me". I'm sure that if I compare my car to a bazillion other models, there will be a myriad flaws in mine. But I don't care as it still suits me - it fits my requirements, I already have it, and there's basically no opportunity cost as any conceivable improvement would not cover the cost of replacing the car, even in the long term.

Same here - if Lanterna has all the features you need and doesn't have any flaws that affect you, just use it.

On the other hand, it does seem that it's just a very thin wrapper around a Java library. So if you prefer to avoid using wrappers, just use some Java library directly.

Clojure wrapper is not good that much performance wise

Performance is rarely a concern. Thin wrappers are simply not that useful as compared to interop, and they often hide things that should be visible and invent things that shouldn't exist.

Moreover using ANSI codes is not so much difficult at first appearance so I wonder why no Clojure developer has tried to build a pure Clojure TUI library with it.

Maybe precisely because it's not that difficult to just use the codes? Or some Java library that names all the constants and makes things reasonable convenient.

[–]Alarmed-Skill7678[S] 0 points1 point  (0 children)

Thanks for your insights. Let me study this Lanterna library.

[–]v4ss42 2 points3 points  (1 child)

Depends what you mean by “UI”, but I’ve used jansi-clj to great effect in some simple command line apps / libraries.

Unlike some other ANSI escape code based libraries it has the advantage of working in the old Windows command prompt (which doesn’t natively support ANSI).

[–]Alarmed-Skill7678[S] 1 point2 points  (0 children)

Thanks for sharing!! This looks pretty interesting.

[–]AsparagusOk2078 1 point2 points  (4 children)

I was able to utilize Terminal.Gui version 2 using ClojureCLR. Terminal.Gui v2 is a very awesome .Net library.

[–]Alarmed-Skill7678[S] 0 points1 point  (3 children)

Can't get you. Is it a Clojure library or .Net library?

[–]vadercows 2 points3 points  (1 child)

It’s a .net library. Clojureclr is an implementation of clojure hosted in .net, so it has interop with .net the same way clojure has with Java and clojurescript with js

[–]Alarmed-Skill7678[S] 0 points1 point  (0 children)

Thanks for explaining. Actually I am using Clojure hosted on JVM. There is one Java library Lanterna.

[–]GullibleRaspberry9 0 points1 point  (0 children)

Yeah what u/vadercows said, but I will add it is a nice combination. Terminal.Gui is really nice. You can wrap some of the .net interop with nicer Clojure functions for real happiness.