DSL processing in Scala(denis.papathanasiou.org) |
DSL processing in Scala(denis.papathanasiou.org) |
The full source code is here: https://gist.github.com/dpapathanasiou/b9d85685a0381f1deea0
One tiny cosmetic suggestion that popped to my eyes since you asked for comments :)
def parseInputRange (s: String): Array[Int] = {
val ab = s.split(":").map(_.toInt)
(ab(0) to ab(1)).toArray
}
the `to` method is inclusive on the end of the range, so it is the same as until x + 1Good luck!
https://wiki.scala-lang.org/display/SW/Parser+Combinators--G...
Code looks solid otherwise...at least where I work the style would be to favor functional idioms over for loops but I think that's just personal preference.
The meta-language is available here: https://github.com/combinatorylogic/mbase
As for feature set, we did code reviews across the whole team to keep everyone on the same page. That said, we used a very large part of Scala, and never really made an attempt to keep out of parts of the language. Our biggest battle was always with Scalaz, which we were always on the verge of adding, but never got enough team buyin.
Martin Odersky has commented many times [1] that scalac won't be as fast as javac. The only link I could find right now is http://stackoverflow.com/questions/3490383/java-compile-spee... which is rather old; but I remember watching more recent videos (< 2 years old) where he makes the same points.
Yeah I call BS on that.
Scala's slow compilation doesn't really bother me that much but Java compiles at least ten times faster.
Well said.
Additionally, I think people often forget that the same JVM tuning parameters available for production deployments are available for Scala compilations. These can make a huge difference in build times, especially since the default JVM parameters are understandably conservative.
I never looked at that way before. We were a shop that used scala and Ruby.
So many of us come from interpretted languages and are used to code and tests reloading with no downtime. How does scalac match up to C# and Java compilation? I'd be interested in seeing the numbers.
Thank you!
For running my app I use the revolver plugin that offers the same thing: as soon as I save a file it is compiled and the app is restarted. When I use the Play framework this is supported out of the box: I save my file and refresh in the browser and see the changes.
This works very well.
> I call BS on that [...] Java compiles at least ten times faster
Then it must be Gradle that's slow, probably the Groovy in it.
2. The Scala compiler is itself a Scala program.
1 + 2 => Optimizing JVM parameters can speed up the Scala compiler.