(no title)
artpar | 3 months ago
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|3 months ago
[0]: https://github.com/acornjs/acorn
artpar|3 months ago
artpar|3 months ago
dunham|3 months ago
The language was for some configuration in a reporting system. The scripts were written by non-engineers, and the changes made the language more user friendly for them. I started from javascript because I expected it would be easier for them to find documentation.
Hendrikto|3 months ago
> llm did most of the work
> it was low effort
I really wouldn’t trust its supposed safety.
artpar|3 months ago