3 ms·
Is python the optimal language for writing a C parser? It seems like text manipulation is not one of python's strong points (not that that is a strong point of
by ColanR 7y ago
Is python the optimal language for writing a C parser? It seems like text manipulation is not one of python's strong points (not that that is a strong point of that many langugages anyway).
- sgillen 7y agoI certainly like text manipulation (well string manipulation at least) in python much more than other languages I use (C, C++, Matlab). It might just be the case that python is the best tool in the authors tool belt for this sort of work. I'm curious what language you would consider optimal for writing a parser in?
- ColanR 7y ago> I'm curious what language you would consider optimal for writing a parser in? I've been researching that question, and was hoping someone would reply and point me in a useful direction.
- anaphor 7y agoI've written a couple parsers in D using https://github.com/PhilippeSigaud/Pegged https://github.com/PhilippeSigaud/Pegged and they seem pretty fast and easy to verify. Of course since it generates a lot of code at compile time, you can end up with somewhat slow builds.
- userbinator 7y agoText manipulation is far easier in Python and a lot of other high-level languages than it is in C. Incidentally, this ease (such as string concatenation with '+') also makes it easy to unknowingly/accidentally create a quadratic or higher complexity algorithm.