![]() |
Thinking of programming in Python but I need some advice...
Learning programming, I stumbled upon some problems I have.
I am fairly proficient with C++, and Objective C with Cocoa, and I have developed programs that many people use with Cocoa. But lately, I had the idea of writing my own parser in C++ (I think that for this task I should avoid Objective C). However, I found that C++ can be very frustrating when writing a parser, even a recursive descent one. So, I decided to learn another language. So, what I want is a language that can be used in conjunction with C++. I want to be able to write parsers in it, and then use the results with C++. And I want to write it on OS X. I was thinking of learning Python, but I thought I should ask someone first. Your ideas? |
I've thought about using Perl/C++ for such things, because of Perl's regular expressions. Could be worth a look. There are probably some good regular expression C++ libraries out there, tho.
|
I agree with dr.p's advice, in particular the bit about looking for a regex library for C++. These problems have been encountered before, and as you're already comfortable with C++, it makes sense to see how others have approached them. One possible idea is to check out the source for gcc or some such; any compiler will have to do non-trivial parsing.
|
Check out Boost. It has a regex library and a parser library (Spirit). OS X is supported.
|
Quote:
Otherwise, functional languages like Haskell and OCaml are generally considered good choices for writing parsers in, if you're willing to spend the time learning them. |
Quote:
|
Maybe you shouldn't spread FUD? You do realize libraries like boost are used by C++ heavy weights like Adobe on OS X every day right? I work with boost on OS X everyday. Darwin ports works out of the box and we have compiled it by hand as well.
So in summary: Just because you can't get the library to work doesn't mean it doesn't. |
| All times are GMT -5. The time now is 3:07 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC