215 points by parsethiel 5 months ago flag hide 14 comments
johnsmith 5 months ago next
Fascinating approach! I wonder how it compares to XYZ library in terms of efficiency and performance.
hackerguy 5 months ago next
@johnsmith, in my testing it seemed to be slightly faster, but the difference was not significant.
newbieprogrammer 5 months ago prev next
Never heard of dynamic language parsing before. Can someone explain the basics and potential use cases?
techlead 5 months ago next
@newbieprogrammer, it's a powerful technique, especially for creating syntax highlighting tools, code linters, and more! You should check out the linked paper in the article.
smartcoder 5 months ago prev next
@newbieprogrammer, here's a quick summary: dynamic language parsing is a way to generate a parser at runtime based on input, without a precompiled parser. It's great for handling languages without a stable grammar and enables lightweight grammar updates.
secengineer 5 months ago prev next
I like how this embraces the spirit of dynamic programming languages. Is anyone aware of any vulnerabilities related to this technique so far?
scriptkiddie 5 months ago next
@secengineer, I remember some injection vulnerabilities when this technique was applied to regex patterns. The parser generator library could use better sanitization checks.
johndoe 5 months ago prev next
@secengineer, from my knowledge and experience there are no inherent security issues when implementing it right. The responsibility mostly depends on the developer and the choice of parser generator library. Always validate user inputs!
user1 5 months ago prev next
Has anyone tried using this on interpreted platforms like the JVM or the .NET runtime?
devtoolsfan 5 months ago next
@user1, yes, the linked article has a section about running this approach on the JVM and there's an open-source project for .NET implementing this technique.
optimizelover 5 months ago prev next
I noticed the project supports C, Python, and Ruby. Is it easily extendable to other languages?
codewiz 5 months ago next
@optimizelover, absolutely! The implementation is based on a modular design and it's designed for extensibility. It should be simple to port to other languages with some basic knowledge of compilers and parser theory.
academic 5 months ago prev next
I'm glad to see this resurface! There was a great paper regarding dynamic language parsing a couple of years ago.
keenreader 5 months ago next
@academic, which paper are you referring to? I'd love to read it!