![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 243
Rep Power: 3
![]() |
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?
__________________
Project::Soulstorm (personal homepage) |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Feb 2006
Location: Ohio
Posts: 93
Rep Power: 3
![]() |
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.
__________________
Neeley.org |
|
|
|
|
|
#3 |
|
Caffeinated Neural Net
![]() Join Date: Jun 2005
Location: Dry west coast of Canada
Posts: 1,034
Rep Power: 5
![]() |
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.
__________________
And once again, Probability proves itself willing to sneak into a back alley and service Drama as would a copper-piece harlot. - Vaarsuvius, Order of the Stick |
|
|
|
|
|
#4 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Check out Boost. It has a regex library and a parser library (Spirit). OS X is supported.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#5 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5
![]() |
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. |
|
|
|
|
|
|
#6 |
|
Hobbyist Programmer
Join Date: Jan 2006
Location: Menidi, Athens, Greece
Posts: 243
Rep Power: 3
![]() |
OS X is supported... only in documentation. When building with the standard build method (configure, make install) all I get is a long compile time, just to show in the end that some files were not compiled. Why? I don't know.
__________________
Project::Soulstorm (personal homepage) |
|
|
|
|
|
#7 |
|
Professional Programmer
Join Date: May 2006
Location: Maryland, USA
Posts: 306
Rep Power: 3
![]() |
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.
__________________
Robotics @ Maryland AUV Team - Software Lead |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Thinking about moving to USA to work in software - advice please! | funkey_monkey | Coder's Corner Lounge | 3 | Jan 23rd, 2007 7:56 AM |
| 26 Year Old, Considering Programming (advice plz) | Zephirus | C++ | 23 | May 25th, 2006 3:01 AM |
| Python programming game? | commodore | Python | 7 | Feb 7th, 2006 6:26 PM |
| [tutorial] Python for programming beginners | coldDeath | Python | 30 | Dec 14th, 2005 11:35 AM |
| Python - A Programmers Introduction | coldDeath | Python | 17 | Aug 19th, 2005 12:41 PM |