Rather than being mutually exclusive, C and Perl fit together nicely.
As a starting point, writing a system in Perl is a good step. It works rather nicely as a rapid development language, due to it's easy syntax, and it's abstraction from the lower levels that are required for C (pointers, memory allocation etc).
C, for dedicated purposes, is faster than Perl in a good many areas, but, unfortunately takes far longer to develop, and is more prone to errors and undefined behavour.
A question you should ask yourself is: Do you actually require that extra speed that compiled C will be giving you? Is your program the bottleneck of data transfer rather than the database accesses?
If it seems that the database will be the main use of system resources, then you won't get much more kick for using C as your glue over Perl, and it could easily be a lot less maintainable.
A good way to start something such as this, is to design the initial system, and code in Perl.
Treat this as the prototype, as any major changes in functionality can be easily made.
Once you're happy that things run as they should, perhaps start profiling, to work out where your bottlenecks are.
You then have the option to either optimise these in Perl, or, recode in inline C.
If it seems to you then, that you
absolutely require the extra boost, then you have a working, functional model that can be used for reference while coding a C application that is logically identical, but, hopefully faster.
After programming in both C and Perl, I've found that nearly all the things that I'd previously have used C for, I now use Perl, and, in the instances I still do C coding, I usually use Perl as a prototyping language to ensure that I have the design correct.
So, to sum:
Perl advantages:
- Speed of development
- Good early stability
- Good prototyping language
- Easily maintainable
- A large base of existing libraries to use, which are already heavily optimised and debugged for a great many uses.
- Can use compiled C to replace Perl functions for extra speed where required.
C advantages:
- Very fast.
- Lower memory footprint.
- Higher degree of control over low level functionality.
Anyhow, hope this helps, among the rest of the advice,
Malk
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
|
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.