[Chicago] Differences between Interpreted and Compiled Languages.

Lewit, Douglas d-lewit at neiu.edu
Mon Aug 10 20:03:57 CEST 2015


Hi Joshua,

I never meant to start a "flame war"!

What is a PEP?

What is RPython?

Thanks!

Douglas.


On Mon, Aug 10, 2015 at 1:42 AM, Joshua Herman <zitterbewegung at gmail.com>
wrote:

> Dear Lewit,
> This is a very confusing question. This also starts a bunch of flame wars.
>
> Let us take an example of Python. You have a python interpreter correct?
> The .pyc files are byte code interpretations of python. This is not
> machine code but interpreted by the python runtime.
>
> Hypothetically could I compile python to another language?
>
> There is a project called PyPy. The purpose of this is to translate python
> into a restricted subset of python. Why would we want to do this?
>
> Then we can do cool things like specify other languages in python.  This
> may come in use somehow but it is cool that we have the ability to do so.
> There are implementations of Scheme (I like this language)  in Rpython.
>
> So the better question is "is my thing that I use to make my program work
> a python interpreter and what does it eventually do.
>
> Also your second question on ocaml is where the fashionalbe thing now is
> to add "optional types" to a dynamic languages so that people don't violate
> the rules of putting a string where an int should be etc. I believe this is
> a PEP that will go into python 3.
> Sincerely,
> Joshua Herman
>
>
>
>
> On Mon, Aug 10, 2015 at 12:42 AM, Lewit, Douglas <d-lewit at neiu.edu> wrote:
>
>> Hey guys,
>>
>> I've been playing around with Ocaml lately.  Definitely an interesting
>> language.  Very different from Python, although like Python's IDLE and
>> Anaconda implementations, Ocaml has an interactive "top level" that makes
>> it easy to try out the effects of various one-liners, etc.  When you
>> compile an Ocaml file you end up with a bunch of other files.  So if my
>> source code is FindPrimes.ml, after compilation I can see files like
>> FindPrimes.cmi and FindPrimes.cmx in my directory.  There's also a
>> FindPrimes executable in my directory.  (I could have called it something
>> else, but I think it's more logical and easier to remember if you name your
>> executables so that they have the same name as your source code.)
>>
>> Python is radically different.  There's the source file and that's it!
>> No linked files or executables or anything like that.
>>
>> Okay, so here's my question.  I ***THINK*** (and I'm really guessing
>> here) that interpreted languages interact with the operating system and
>> that's the end of it.  However, compiled languages go one step farther.
>> Because the source file is compiled to native code, I think that a compiled
>> language interacts with the operating system as well, but also has the
>> capacity to interact directly with the computer's underlying architecture,
>> which would explain why compiled languages tend to run faster than
>> interpreted languages.
>>
>> Interestingly enough, isn't Java sort of in between?  It is technically a
>> compiled language, but the JVM (the Java interpreter) reads the bytecode
>> file line by line just like Python's interpreter reads the .py file line by
>> line.  So then Java is not strictly compiled or strictly interpreted;
>> actually I think Java is both!
>>
>> Ocaml is definitely kind of cool, but can be challenging.  Ints and
>> floats cannot be mixed together in the same calculation.  But I think Ocaml
>> has one huge advantage.  I believe that the language is considered to be
>> very "safe", meaning that if your Ocaml file compiles then for sure it's
>> going to run.  So there are no runtime errors in Ocaml, just compile-time
>> errors.  (Unless at runtime the user inputs a value that is an invalid
>> argument to some function in the program, etc.)
>>
>> Best,
>>
>> Douglas Lewit
>>
>>
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org
>> https://mail.python.org/mailman/listinfo/chicago
>>
>>
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20150810/e638bcb5/attachment.html>


More information about the Chicago mailing list