I actually tried to do something similar to the SHRDLU project in JavaScript. It was a few years ago and I thought it would be fun to see how much I could accomplish over a weekend, and I slowly realized just how hard this type of project (NLP/NLU) is.
https://danielborowski.github.io/site/etaoin/