synt7x/knightscript — reverse-engineered prompt

Reverse engineered prompt

Build me a small command line compiler called KnightScript. I want it to feel like a mix of Lua and JavaScript, where I can write files with a .kns extension and compile them into Knight code that can run with the Knight language tools.

It should run with Lua, so I can do something like lua main.lua example.kns -o example.kn, and there should also be a simple help flag. Use the grammar and examples in the repo as the source of truth, and make the language support the basics that are already described, like functions, conditionals, loops, arrays, indexing, and the built in constants and helpers such as print, write, read, prompt, join, pop, push, insert, length, random, ascii, and quit.

It is fine if a few edge cases are still marked as incomplete, especially the same ones called out in the README, but most normal programs should compile and work. If anything is unclear, check the Knight docs and the example files online.

Want more depth? Deep Reverse