scala/README
author Christian Urban <christian.urban@kcl.ac.uk>
Thu, 22 Feb 2024 13:38:10 +0000
changeset 298 ac5461882f3e
parent 270 ccec33db31d4
permissions -rw-r--r--
test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
193
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     1
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     2
The packages can be compiled with
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     3
270
ccec33db31d4 some tests are commented out
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 226
diff changeset
     4
  scalac lib.scala turing.scala abacus.scala recs2.scala comp1.scala comp2.scala
193
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     5
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
If you get an error, it is advisable to clean 
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
out the existing class-files
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
  rm */*.class
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
After compilation, the examples can be run in
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
the REPL as well as in scala. For example
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
196
a69607b7f186 corrected README
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 193
diff changeset
    15
a69607b7f186 corrected README
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 193
diff changeset
    16
  scala ex.scala
a69607b7f186 corrected README
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 193
diff changeset
    17
a69607b7f186 corrected README
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 193
diff changeset
    18
or
a69607b7f186 corrected README
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 193
diff changeset
    19
193
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    20
  scala -cp $PWD ex.scala
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    21
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    22
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    23
The directory can be cleaned with
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    24
200
8dde2e46c69d added all recursive functions needed for the UF
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 196
diff changeset
    25
  rm -rf *~ lib turing abacus comp1 comp2 recs
193
317a2532c567 split up scala-file into separate components
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    26
225
0974c59e7029 added an abacus to javabyte code compiler
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 205
diff changeset
    27
0974c59e7029 added an abacus to javabyte code compiler
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 205
diff changeset
    28
0974c59e7029 added an abacus to javabyte code compiler
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 205
diff changeset
    29
0974c59e7029 added an abacus to javabyte code compiler
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 205
diff changeset
    30
------------------------------
0974c59e7029 added an abacus to javabyte code compiler
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 205
diff changeset
    31
Abacus to Javabyte compilation
0974c59e7029 added an abacus to javabyte code compiler
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 205
diff changeset
    32
0974c59e7029 added an abacus to javabyte code compiler
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 205
diff changeset
    33
requires the jasmin assembler for Java
0974c59e7029 added an abacus to javabyte code compiler
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 205
diff changeset
    34
avilable from
0974c59e7029 added an abacus to javabyte code compiler
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 205
diff changeset
    35
226
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 225
diff changeset
    36
  http://jasmin.sourceforge.net
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 225
diff changeset
    37
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 225
diff changeset
    38
Calling
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 225
diff changeset
    39
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 225
diff changeset
    40
  scala -cp $PWD ex_jvm.scala
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 225
diff changeset
    41
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 225
diff changeset
    42
generates a Prog.j intermediate file.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 225
diff changeset
    43
This will be assembled using jasmin.