It's UWAweek 44 (2nd semester, 1st exam week)

help2002

This forum is provided to promote discussion amongst students enrolled in CITS2002 Systems Programming.
Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.
Displaying the 2 articles in this topic
Showing 2 of 821 articles.
Currently 9 other people reading this forum.


 UWA week 36 (2nd semester, mid-semester break) ↓
SVG not supported

Login to reply

👍?
helpful
5:02pm Thu 5th Sep, ANONYMOUS

I have seen this sentence in the project sheet: "Writing a compiler for any programming language is an enormous task, clearly not one suited for this project. However, what many have recognised, is that C is an excellent language to support other languages and that C has an extensive toolchain supporting compilation and linking. " Does it mean we are not supposed to manually translate the language? Is there an existing one that we can use? Like functions or libraries? If we are supposed to manually translate it, does it mean we only need to solve those 8 sample ml files? Like the function may only do the same as what these 8 files do etc.


SVG not supported

Login to reply

👍?
helpful
5:20pm Thu 5th Sep, Joshua N.

ANONYMOUS wrote:
> I have seen this sentence in the project sheet: "Writing a compiler for any programming language is an enormous task, clearly not one suited for this project. However, what many have recognised, is that C is an excellent language to support other languages and that C has an extensive toolchain supporting compilation and linking. " > Does it mean we are not supposed to manually translate the language? Is there an existing one that we can use? Like functions or libraries? > If we are supposed to manually translate it, does it mean we only need to solve those 8 sample ml files? Like the function may only do the same as what these 8 files do etc.
I feel you are reading too deeply into that section of that paragraph. If you continue reading: "The strategy is to first translate programs written in other languages, such as our ml, to C, to compile that translated C code using a standard C compiler, and to finally execute the resultant program. This sequence is often termed transpiling, the 'joining' of the words translating and compiling. In this role, C is often described as a high-level assembly language, sometimes a 'wallpaper language'." The sample 8 files are just some examples to give everyone an idea of the possible ml files their project may be tested against. You need to (ideally) solve all ml files, not just the 8 provided. As stated in the project goal: "The goal of this project is to implement a C11 program, named runml, which accepts a single command-line argument providing the pathname of a text file containing a program written in ml, [added 28/8] and any optional command-line arguments to be passed the transpiled program when it is executed. Successful execution of runml will involve checking the syntax of the ml program, translating that valid ml program to a C11 program, compilation of the resultant C program and, finally, execution of the compiled program." I'm not sure what you mean by translating the file manually. The program you will write will translate the ml file into a c source file (as well as compile, run and then delete the files it created). You can use header files such as string.h, stdlib.h, etc. to help.

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  8:08AM Aug 25 2024
Privacy policy