/math-ai

Primary LanguageTypeScript

Math AI

A Node.JS CLI application that evaluates user input as mathematical expression and returns the result.

Goals

  • write as less code as possible
  • use AI tools to:
    • get knowledge about parsing and evaluating mathematical expressions
    • generate as much code as possible
    • do not use Javascript's eval() function

Achievements and lessons learned

  • Common understanding of tokenization, parsing and interpretation of simple arithmetic expressions.
  • Most of the code generated by AI tools (Copilot and ChatGPT)
  • Received concise theoretical knowledge about parsing algorithms

ChatGPT showed itself as a better tool for generating code than Copilot. It is more consistent and generates more code. A huge help using ChatGPT is its constant awareness of the context. It is able to generate code that is consistent with the code that was generated before. Copilot is not able to do that. It is not aware of the context and generates code that is not consistent with the code that was generated before.