I'm planning on writing a language interpreter for a custom language of mine. The language will work similarly to PHP in that it will be run off of a web server and the code will be executed in the browser.

I know that C is obviously faster than Python but what I'd like to know is, how noticeable would the speed difference be from an end-user perspective? I like Python because it would allow me to make my language quickly, also is there a way to write part of it in Python and leave the code generation to something else, like LLVM or C?

Thanks, Francis

closed as off-topic by Ramhound, nerdwaller, Scott, slhck Feb 2 '14 at 12:11

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question is not about computer hardware or software, within the scope defined in the help center." – slhck
If this question can be reworded to fit the rules in the help center, please edit the question.

  • This question seems not to be on topic. We cannot tell you which one you should use. Only you know what your requirements are. – Ramhound Feb 1 '14 at 21:33
  • As a general rule of thumb though, would you use C or Python? – user3242139 Feb 1 '14 at 21:36
  • 1
    I would use the best language for the job given my requirements. Implementing either one would be trivial at my skill level. I don't agree that a C solution would be "obviously" faster then Python solution. – Ramhound Feb 1 '14 at 21:40
  • Unless your resources are extremely limited, the end user probably wouldn't see much of a difference between the two options. Not generally, anyways. – nerdwaller Feb 1 '14 at 21:44
  • Should be on Programmers.SE, but this is not an option for moving. – Scott Feb 1 '14 at 21:51

Both. Python is a rapid prototyping language so your first iteration of the program should be in that. Python will let you get up and running much faster than if you had to twiddle minutae in C. Once you have a working Python program you may be done. However, if some parts of the program are not fast enough - and only profile speed when your Python implementation is complete, it's a waste before - then only the parts that are too slow can be reimplemented in C for speed and then called from Python. Python will let you call C with no hassles at all.

Not the answer you're looking for? Browse other questions tagged or ask your own question.