| ▲ | artpar 2 hours ago | |||||||||||||||||||||||||
I made a language for using in another project, so I'll answer your questions https://www.npmjs.com/package/wang-lang - this new language looks and behaves exactly like javascript, except it doesnt have "eval" and "new Function", so it is CSP safe. That's the only difference. I wanted to execute dynamically generated code in chrome extension - llm did most of the work of creating a nearley grammar and associated interpreter (whole thing is bundled, nearley is not a final dependency), elaborate tests make this quite sane to handle - took me about total of 1 weeks for the initial mvp to try out, and then have been fixing bugs and inconsistencies with javascript behavior, about 1 day a month of effort - mostly 0 The only reason to create was I couldnt find something similar and it was low effort thanks to llm I also created another even smaller DSL you can say https://www.npmjs.com/package/free-text-json-parser It parses json embedded in plain text | ||||||||||||||||||||||||||
| ▲ | yokljo an hour ago | parent | next [-] | |||||||||||||||||||||||||
Nice. I built something basically just like this for work for the same reason last year. It only look a few hours though, cause I just used Acorn [0] to parse my JS, then directly evaluated the AST. It also had an iteration limit and other configurable limits so I can eval stuff in the browser without crashing the tab. I did not use an LLM. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
| ▲ | Hendrikto 2 hours ago | parent | prev [-] | |||||||||||||||||||||||||
> safe > llm did most of the work > it was low effort I really wouldn’t trust its supposed safety. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||