Virtual Threads for a scripting language in Java 8 without Loom
jactl.ioNice article.
I think this is similar to the way Kotlin implements coroutine.
I believe Kotlin goes to the extra miles to also capture parts of the stack frames when creating the Continuation object so even when the runtime resume the continuation, the exceptions thrown later get the "correct" stack trace (not the one that shows that you come from a call through a MethodHandle).
Author here: Jactl is a secure embeddable scripting language that compiles to bytecode and supports Java 8 and later versions. The article describes how Continuations were used to provide Virtual Thread-like behaviour for scripts. Blocking operations suspend a script which is then resumed from where it left off once the operation completes.
TIL about jactl! Just reading the site right now. Many thanks for: no colored function (no async/wait) !
Any tips on using with gui/swing? rendering images/simple html, that would be awesome!
And what about (gasp) JSP? Or any other templating? It is old school, yeah but I like jsp include (with params) and jsp 'web components' (tags).
Anyway, thanks for writing jactl!