« first day (396 days earlier)      last day (882 days later) » 

17:10
@user Yeah, it is a little bit. Like I planned to earlier, I'm using separate branches for the JVM and Scala.js versions, with two different build.sbt files and two somewhat different Main.scala files. Here's my JS build.sbt:
enablePlugins(ScalaJSPlugin)
name := "Half-Byte Lisp"
val hblVersion = "0.1.2"
version := hblVersion
scalaVersion := "3.0.2"
Global / onChangedBuildSource := ReloadOnSourceChanges
which is basically the same as the JVM build.sbt but with the ScalaJSPlugin line added and the unit test & JAR configuration removed.
I added this line to project/plugins.sbt:
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.7.1")
And then I replaced the Main.main method with this:
@JSExportTopLevel("runHBL")
def run(code: String, formatSpecifier: String, args: Array[String], debug: Boolean): Unit = {
  val format = formatSpecifier match {
    case "raw" => FileFormat.Raw
    case "hbl" => FileFormat.ASCII
    case "thimble" => FileFormat.Thimble
    case _ => FileFormat.ASCII
  }
  run(code, format, args, debug)
}
which requires these imports:
import scala.scalajs.js.Array
import scala.scalajs.js.annotation.JSExportTopLevel
And then if I include the compiled JS in an HTML page, I can go to the console on that page and do runHBL("'(1to arg1)", "thimble", ["5"], false) and get (1 2 3 4 5) back.
(It still needs more work because I need to have it return the result rather than logging to the console. So the run method should probably return String rather than Unit.)

« first day (396 days earlier)      last day (882 days later) »