Report can be seen by clicking here or by navigating to report/report.pdf
Slides from the presentation can be seen by clicking here or by navigating to slides/CLP-G07-3.5.pdf
Final grade: 20/20
-
Requirements
-
Clone the repository and move the downloaded
wat2wasmto<root of the project>/bin/ -
Run the following command in order to install the required packets
~/$ npm install
-
Generate WebAssembly bytecode for amy source files (with sbt)
run [LIBFILES ...] [REQUIRED_FILES ...] Main.amy [--charset=CHARSET]~/cs320-group07$ sbt sbt:epfl-amyc> run ./library/Std.amy ./examples/Hello.amy
-
Run the compiler output
node ./wasmout/Main.js~/cs320-group07$ node ./wasmout/Hello.js Hello World!
You will find generic examples in the /examples folder and examples more specific to the extension we proposed in the /extension-examples folder.
The same process as above applies for running the programs. Programs in extension-examples need the following libraries: ./library/Std.amy ./library/StringImpl.amy. More dependencies can be required, see table below.
| Program | Description |
|---|---|
| Hotel.amy | Small program for hotel room reservation. Requires ./library/List.amy and ./library/Option.amy. |
| NamePrinter.amy | Asks for user's last name. Formats it by stripping and capitalizing it then outputs it to the console. |
| HelloChars.amy | Declares two Char, checks for equality and ouputs the result. Then transforms them to string, concatenate them and output the result. |
| EscapeChars.amy | Declares two escape sequence characters and outputs them. Uncommenting the commented out "invalidEscapeChar" will generate an error in the parsing phase. |
| StringOps.amy | Demonstration of length, equals, charAt, substring, strip, toLowerCase and indexOf. |
| StringNewLine.amy | Demonstration of a string that is split into two lines with the new-line character. |
| IndexOf.amy | Demonstration of indexOf. |
| UpperCase.amy | Demonstration of toUpperCase. |
| More examples | Which are also available in the extension-examples folder. |
Edouard Michelin
Suhas Shankar