soywiz-archive / jtransc

Bytecode to source converting Java & Kotlin code into JavaScript, C++, D, C#, PHP, AS3, Dart and Haxe and run it everywhere. Also use JVM code in your favourite language as a library.
https://jtransc.soywiz.com/
Apache License 2.0
632 stars 67 forks source link

Scala to Dart #300

Closed shafqatevo closed 3 years ago

shafqatevo commented 5 years ago

Hi,

Amazing tool, thanks @soywiz !

How good is the Scala to Dart transpiling end result with this?

Thanks!

soywiz commented 5 years ago

IIRC in the latest versions I did an optimization to do all the static initialization at the beginning of the program instead of on request to improve runtime performance, that worked fine for Java and Kotlin, but the Scala version I tried later seemed to had problems and determining the initialization order at compile-time was not right. Also I'm not actively developing this project at this point, though I could accept PRs.

Scala provides metaprogramming and ways to obtain the AST. AFAIK Scala.JS uses that mechanism to generate its output. You could do the same for Dart using Scala.JS as reference, or use an untyped Scala.JS -> Javascript -> Dart chain of transpilers.

shafqatevo commented 5 years ago

@soywiz thanks for the great insights!

layinka commented 3 years ago

Please do you have a sample/guide for using this to convert scala to Haxe?

soywiz commented 3 years ago

@layinka the project don't have such guide and Scala is unsupported on latests versions. Right now the project is being worked on at a slower pace and the focus shift to Java/Kotlin and a reduced number of targets covering specific use-cases for my other project needs. I have update the description of the project to not state Scala being supported.