@@ -644,4 +644,4 @@ The process of implementing the type checker and the interpreter was similar. Th
The next step would be to generate machine code from the parser output that has been accepted by the type checker and the interpreter. To do this could the code generator Crane-lift be used. The code could be optimized in several way, for example due to the rules for borrow checking is it possible to put together all changes to a mutable reference into one expression. This because we know that the interpreter only allows one mutable refernce at a time. One way to implement the intermediate representation could be by using the SSA form where each variable only can be assigned once.
I have not implemented this part, instead I focused on understanding the parser, type checker, intepreter and the borrow checking.
It has been difficult to write good structured code because this is the first time I worked with Rust. Therefor the rules and structure was new to me which ended up in very messy code. I focused on getting as much as possible to work to get a broad understanding instead. It would be really fun to rewrite everything from the beginning now with the knowledge and insight the course have given!
\ No newline at end of file
It has been difficult to write good structured code because this is the first time I worked with Rust. Therefor the rules and structure was new to me which ended up in very messy code. Neither of the parts work as well as I want to and there are some examples that will not be excepted. I decided to let is be and move on to learn more instead. So I focused on getting the different pars to work as much as possible to get a broad understanding instead of putting too much time into one part. It would be really fun to rewrite everything from the beginning now with the knowledge and insight the course have given!