I see that Alvin Alexander recently updated some of his blog pages. In particular:
How to use Scala as a scripting language
I have a set of spaghetti shell scripts which I use to grade my students scala homework exercises. The shell scripts copy around student submission files, together with other files needed which were provided in the lecture, and also copies the test suite files. The scripts build a directory structure in
/tmp with a
build.sbt file and launches
sbt in batch to compile and run the tests. The scripts then look at the exit status and log files to decide whether the student code was correct.
I’d love to convert these scripts to a coherent program, because the scripts are plagued with problems such as spaces in file names, special characters (my students often have names including french special characters, accents, circumflexes, etc). There is a huge amount of duplication in the scripts which would be much easier in Scala than in a shell scripting language.
Unfortunately, I don’t really know how to develop scala code which is intended to be run from the UNIX command line. I only know how to develop code in IntelliJ which contains the HUGE boiler plating maven directory structure, and run it by pressing the little green rectangles provided in IntelliJ.
When I say boiler plate: I have 106 scala files which I have created for my project, but IntelliJ has created 830 directories and 4139 additional files in the project.
QUESTION: To develop the scala shell-script replacement, should I abandon IntellJ and use emacs to develop the code and debug it by just running it from the shell, inserting
println calls to figure out what’s happening? Or is there a better way?