Second fortnight 14/08/2021

 Progress:

This fortnight I finished the base execution engine, worked on the primitive semantics checker and the integration between primitive and non-primitive functions. 

For the first few days I cleaned up the code to make it readable, I decided not to go all-in on the oop but instead to use it in a few places that are particularly unreadable. Finishing the base execution engine ended up being fairly quick and breezy and it worked like a charm first try, which is a rarity. The stack base bytecode ended up being really useful and helped organize the code better than having to work through all the embedded lists as I used to do. It did cause some issues sometimes when I forgot I was using it but for the most part, they were a great idea.

After that for the first week, I mostly procrastinated and worked on other projects so I ended up working less on the project than I hoped for. Although even though I spent far less time than I thought I would on this project, the primitive checker and integration ended up being way easier than I thought it would be and I made far more progress than I assumed I would and that my timetable (from previous) said I would.

Although it was fairly easy, both of these algorithms were a challenge to implement. It took me a fair while to get the primitive checker written, not just from procrastination but also from a lack of planning. I dove headfirst into trying to implement the primitive checker without properly defining what a primitive function was, so it was a complete mess. I then started again and really thought through exactly what I needed, wrote it up in pseudocode and had it finished flat in a couple days. Almost exactly the same thing happened with my asynchronous/multi-stack integration. I dove right in and it was another huge mess. After reverting my changes I wrote out the exact way it would work and how all the data structures would hold the information and was able to get it finished in about a day of work. Although it's not quite finished and there are a couple bugs I'm quite chuffed about my use of proper design and planning strategies. It was especially cool because I don't do many large projects where it becomes necessary to spend this time design algorithms and programs like this.

I am particularly proud of the implementation of the total checker, which checks whether a given function definition's arguments cover all possible inputs. The pseudocode is below

1. If the function takes no arguments then return true

2. Group the arguments by the first argument, being a generic, 0 or a successor constructor, and recurse on each group without the first argument (this is to test that all combinations exist)

3. Assuming that the above is true, call and return the subroutine that checks whether or not the first argument covers all (instruction 4 in this pseudocode). If it's false return false

4. If there exists a generic argument in the first arguments then return true. (this is because any calls in this function will at least encounter this definition). 

5. If there doesn't, check if there exists a 0 in the first arguments definition. If there isn't return False

6. If there is check that at least one successor function exists. If there isn't then return False. 

7. Otherwise get the inner arguments from each successor (the a in s[a]) and return the recursive call (instruction 4) on all deconstructed successors.

I am very happy with the current state of the project and am now thinking about maybe looking at further extensions to the project. But that will come later after everything is completely finished and well tested.

Comments

Popular posts from this blog

Fifth post

Twelfth post (end post)

Fourth Post