typelevel / scala

Typelevel Scala, a fork of Scala
http://typelevel.org/scala/
372 stars 21 forks source link

valueOf in scala.js #164

Open cquiroz opened 6 years ago

cquiroz commented 6 years ago

I'd like to use scala.Predef.valueOf in scala.js but it is not present on their scala.Predef since it follows the LB compiler

Would it be possible to have another implementation of valueOf as a library perhaps?

/cc @sjrd

sjrd commented 6 years ago

In general, any addition to the standard library in TLS would refuse to work with Scala.js out of the box. That's simply because scalajs-library.jar is built from the sources of LBS. IMO, if TLS starts having additional methods/classes in the standard library, and wants to support Scala.js, someone needs to build and publish a tls-scalajs-library.jar or whatever it's called, built with the Scala.js compiler from the sources of TLS' standard library.

milessabin commented 6 years ago

@sjrd would you be willing to collaborate on something along those lines?

sjrd commented 6 years ago

I can give some guidance if someone wants to setup the necessary build. Probably the easiest way to do so is to copy the parts of the Scala.js build involved in making up the scalalib subproject, and make it use the Typelevel sources. Then it should probably merge the content of the official scalajs-library.jar with the .sjsir files produced by that alternative scalalib, to make tls-scalajs-library.jar. Alternatively, also replicate the parts of the subprojects javalib, javalanglib, libraryaux and library to build it all from scratch.