3 ms·
i feel like js is flexible enough that you can probably use an embedded dsl instead of writing a parser; maybe something like { a: '-bff+affa+ffb-'
by kragen 3y ago
i feel like js is flexible enough that you can probably use an embedded dsl instead of writing a parser; maybe something like
{
a: '-bff+affa+ffb-',
b: '+aff-bffb-ffa+',
c: ['a', {p: .1}, 'b', {p: .9}],
}
- smusamashah 3y agoIt's similar to this already. But this isn't flexible enough to implement methods etc which abop expands towards. My goal was to do almost everything all other browser based lsystems are doing while keeping it fast which most tools are not.
- kragen 3y agoyou'll probably be pleasantly surprised by how easy it is to write a parser using a parser generator; unfortunately i don't know which one to recommend for js (i've used yacc, ocamlyacc, hammer, and a few i've written myself, but i don't recommend using the js one i wrote) if you aren't pleasantly surprised, maybe try a different parser generator