humbleui

yuhan 2024-02-06T10:49:10.828179Z

Are there any example setups out there integrating HumbleUI with a Cider/cider-nrepl workflow? I've managed to start up an nrepl server from the main ns, but for example this doesn't afford the use of Cider's tooling to analyse stacktraces of exceptions thrown from the UI thread.

Niki 2024-02-06T13:24:17.540749Z

Do you know why? Is there a problem specific to Humble UI or it’s just the fact that they originate from another thread?

yuhan 2024-02-06T15:15:27.303949Z

I'm not too familiar with the internals of nREPL but pretty sure it's the latter

yuhan 2024-02-06T15:23:04.058789Z

There's probably a way to take the *e value and pass it to the relevant nrepl op, to manually simulate what would 'normally' happen with all clojure code evaluations passing through Cider's middleware

yuhan 2024-02-06T15:42:21.440739Z

HumbleUI seems like a exciting and really promising approach, but the last couple of hours trying to take it for a spin have felt frustratingly opaque given the lack of documentation and tooling support 🫤 (of course I realise the caveats of it being pre-alpha software that dev UX probably isn't a big priority for now)

Niki 2024-02-06T15:46:15.885999Z

Yep, and the fact that I don’t use nREPL or Cider probably doesn’t help either

Niki 2024-02-06T15:46:36.000579Z

In my setup errors are just printed to console

yuhan 2024-02-06T15:54:02.034289Z

yeah, also a lot of my errors at the start were of the fatal REPL-crashing kind, I think due to wrong types of arguments being passed to functions, eg.

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000001615d6be0, pid=22112, tid=259
#
# JRE version: OpenJDK Runtime Environment Temurin-21.0.2+13 (21.0.2+13) (build 21.0.2+13-LTS)
# Java VM: OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (21.0.2+13-LTS, mixed mode, tiered, compressed oops, compressed class ptrs, g1 gc, bsd-aarch64)
# Problematic frame:
# C  [libskija.dylib+0x12be0]  Java_io_github_humbleui_skija_TextLine__1nGetTextBlob+0x0
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

yuhan 2024-02-06T15:54:19.757669Z

not sure if these can be made recoverable

Niki 2024-02-06T16:21:15.368819Z

Yeah, no, this is unrecoverable. I should put more checks before interfacing with Skia. Basically this is simple null pointer but because it was passed to native it unrecoverably died

yuhan 2024-02-06T16:37:58.901889Z

As a concrete example for feedback, I spent a good chunk of time trial-and-error debugging these fatal crashes just trying to write a minimal "Hello world" from the ground up ... it turned out that I hadn't wrapped the overall UI in default-theme, I guess causing the crash due to uninitialized attributes.

Niki 2024-02-06T16:52:14.890799Z

Yeah, that’s a common gotcha. Will think what to do with it

yuhan 2024-02-06T16:51:07.391869Z

Another nit related to dev tooling - the import-vars macro adds a lot of friction jumping to the implementation of any of the core API functions from their call sites - something I often did when trying to understand them due to lack of docstrings

Niki 2024-02-06T16:51:54.675809Z

Interesting, thanks!

yuhan 2024-02-06T16:55:11.548069Z

btw Potemkin's version of import-vars works out of the box, Cider tooling reports and jumps straight to the original definition

Niki 2024-02-06T16:55:31.985689Z

Also interesting

yuhan 2024-02-06T17:00:38.077489Z

also poked around in the vdom branch where it seems to use even more unconventional way of splitting up the ns into multiple files - clj-kondo's static analysis doesn't recognize any of this and throws up a bunch of linting errors