Is there GUI Scala Console that I can download and run from command line? [closed]
Groovy has a nice GUI Console in which I can enter any java/groovy code and run. This is distributed with groovy.
As for as I know Scala does not have anything like that except for REPL.
Is there any third party Scala GUI Console that I can download and install and run from command line and not from a JNLP file using webstart?
One use case:
Suppose I have Scala program:
val lineWidth = 2.5
val axisWidth = 1.5
val white = ConstVec3(1)
val background = white
val axisColor = ConstVec3(0)
drawFunction("Plot") { (dims, pixel) =>
val mid = dims/2.0
val p = pixel - mid
val color: Vec3 = background
color *= {
val shade = clamp(abs(p.x)/axisWidth, 0, 1)
mix(axisColor, background, shade)
}
color *= {
val shade = clamp(abs(p.y)/axisWidth, 0, 1)
mix(axisColor, background, shade)
}
color *= {
val scale = 2/mid.x
val x = p.x*scale
val y = p.y*scale
val f = smoothstep(-1, 1, x)
val shade = clamp(abs(f - y)/(scale*lineWidth), 0, 1)
mix(Vec3(1, 0, 0), Vec3(1), shade)
}
color
}
In Groovy Console (which is a full blown GUI) I can easily copy and paste above program. I can easily modify the program in GUI and quickly hit the run button and quickly see the result. I can even easily copy and paste the results and post it somewhere else. I can easily copy lines of Scala code from somewhere else and copy into GUI Console and hit the run button and I can also copy certain jars into a location that is in the classpath of Groovy Console and so on and on long list of lot more features.
Can you do that in REPL or is there another tool you can use?
For the kind of exploratory coding that you're talking about, you should check out Kojo. Just ignore the parts designed for teaching children how to program (e.g. drag the border between the turtle window and the rest until it's as small as it can get), and you find that you have a full-fledged GUI with syntax highlighting and everything that lets you run code with a press of a button (or two presses of the keyboard). Or maybe you want to use the turtle to do the drawing, given the example you gave.
You might also be interested in ScalaConsole or Scalide.
You definitely looking for an Integrated Development Environment.
There is plugin for theses IDE:
- Eclipse
- IntelliJ IDEA
My personal favourite is using a simple text editor with SBT, you can use for example:
- VIM
- Emacs
For whatever it is worth, if you don't want to try out swing stuff, you might even go with Simply Scala.
精彩评论