Use of Quasar in JVM Languages Other than Java, Kotlin or Clojure?

48 views
Skip to first unread message

Steven Stewart-Gallus

unread,
Jan 26, 2019, 3:47:36 PM1/26/19
to quasar-pulsar-user
Hi,

I am writing a toy language for the JVM for fun. I am considering adding fiber support (really I need continuations for a bunch of reasons) and because this is just a side project I'd rather look into existing solutions as much as possible over writing my own.

How possible is it to get to Quasar working with JVM languages other than Java, Kotlin or Clojure?

The documentation seems to state that Quasar works mostly at a bytecode level so the task should not be too difficult but the area seems to be not documented well.

In order to eliminate boxing of primitives and variadic function arguments into arrays I plan to do a lot of tricky dynamic stuff such as generating classes on the fly and use constantdynamic and invokedynamic a lot which I am unsure Quasar would handle well. I am writing the compiler so I could manually save/restore state for Quasar but such functionality seems to be to be deliberately undocumented? for future proofing. Pretty sure this could be reimplemented in a pretty generic way using invokedynamic though such that the internals of saving state could be easily changeable in the future. Resume could be reimplemented as an invokedynamic call too but would require allocating and returning a single large object which I guess would be suboptimal. But I digress.

Anyway, I am wondering:
  • Is it reasonably possible to add Quasar support to a new language on the JVM?
  • Would it save time to do this?
  • Is there any substantial documentation on how to do this and where problems might arise?
  • Especially how does Quasar interact with MethodHandles? For genericity I need to stitch together a bunch of calls with this and I doubt Quasar can rewrite calls hidden inside this API.
Reply all
Reply to author
Forward
0 new messages