The most challenging part of this lab was understanding how JavaScript handles datatypes. The combination of no type checking in JavaScript and JavaScript converting types automatically made it difficult to debug at times. Another difficulty of JavaScript is understanding how variable scoping works. I did some research to understand how JavaScript automatically makes any variable that is not declared with "var" a global variable. I also learned quite a bit about closures.
I enjoyed the simplicity that JavaScript offers. It is not too difficult to pick up the syntax and begin messing with HTML objects. It is satisfying how quickly one can add functionality to an HTML page.
I least enjoyed having to hunt down the source of obscure bugs. For example, my function to create buttons was attaching the click event to the div element rather than the buttons, so I spent quite some time trying to figure out why each button I clicked would trigger all of the user-defined functions rather than only the one corresponding to the button.
I think in this case, it seems pretty lightweight to implement this interpreter in JavaScript since it's fairly easy to manipulate and display html objects. If I had to choose another language, I would probably do it with Python. I would have to explore some GUI libraries in Python, but I think it would not be too difficult since Python would let me know when something breaks.
The lack of types did hurt me somewhat. By this I mean that I did not necessarily run into any major bugs that resulted from mismatching types, and if any bug occured from JavaScript changing a type in order to not break, I usually found it quickly. The lack of types did make me very carefully when converting between types which I found to be a positive thing (not so much for my coding speed however).
I think many concepts from class came into play in terms of getting a handle of JavaScript. Before, learning any of the concepts in CS245, I would have been very confused as to why some things weren't working. For example, knowing about variable scoping helped me determine quickly why JavaScript would believe something was not defined or why some value was not updating.
A feature I would like to add to the interpreter that I do not really have the time for would be a way to have the user define a function and optionally add some text to describe what the function does. Then, I would allow the user to type "h" in the terminal which would then have the terminal display all available functions. If the user wanted more information on the usage/functionality of any function, they could simply type the functions name in this help screen and have the function's desciption pop up. Alternatively, I would like to have some command to display a user-defined function's description. The concepts from class that I can see getting me to implementing these features would be playing around with classes to organize my functions with their definitions and documentation. I would like to also refactor my code with more object-oriented design in areas such as having a class for my pre-defined functions, errors, etc.