Personally, I don’t have a proper understanding of how TeaVM uses the classloader that I provide. For example if I try to log from findClass
, nothing happens. TeaVM still does not find Scala library classes like scala.App.
Anyone with experience setting up TeaVM to work with Scala 3?
UPDATE: I found out that getResourceAsStream is used by TeaVM resulting in the above mentioned issue, though I’ll still be happy to know about successful TeaVM adoptions
Can I ask why you want to do this? rather than use Scala.js for example?
I ran into an issue that required me to divert from the standard approach of Scala.js, like for example I can’t do the implementation relying on existing Scala.js plugins. I had to deal with isolated classloaders in my implementation to be able to run the Scala.js linker on already generated sjsir files. When the related issues did not stop emerging (like handling Scala 2 - 3 binary compatibility issues), I decided to compare ScalaJs with TeaVM.
On the long run I may choose ScalaJs, but for the short term, if TeaVM works out of the box, it can be a good workaround.