Closed pickfire closed 5 years ago
thanks!
whats the rationale behind duplicating the entire parse function? the diff is broken due to that, so i can't really see what you changed that requires a difference between wasm and non wasm
@aep That's just temporary as for now, the error handling for wasm could be better. By the way, is it possible for me to put the bindings for nodejs with neon library here as well or should be start an organization for this?
totally happy putting it in here, if you want my review. :)
@aep Okay, I will put it in another issue. Maybe try to merge review this first.
as i said, the current PR is not ok. It duplicates most of the code.
@aep I removed the duplicates, can you please check again?
@aep What is the reason behind using pest
instead of nom
or manual parser other than resulting in more code? Would there be performance impact? I am kinda interested to see how does it differs after rewriting it in nom
or manual parser.
As well, I haven't figure out how do we parse the #{stuff}
? Passing it into from webassembly? Calling deno?
pest separates grammar from parser, making it alot easier to read. nom is probably faster.
interpolation could be supported by passing it to a JS engine, yes. But at that point i'm not sure what the use case would be. If someone wanted to put javascript in their templates, why not just use the original pug parser?
@aep The rust version of parsing can be a lot faster than the original.
Right, I guess that makes some sense.
If you feel like working on that, let me know if you need my peer review :)
Next is to put a package and deploy it. I also tested out neon as well but not included here.