Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #6273

Re: First Program with Python!

From Kaz Kylheku <330-706-9395@kylheku.com>
Newsgroups comp.programming
Subject Re: First Program with Python!
Date 2016-02-15 16:58 +0000
Organization Aioe.org NNTP Server
Message-ID <20160215085102.999@kylheku.com> (permalink)
References <56ee81f0-8542-49e5-a177-c7794f2d48d7@googlegroups.com> <n9ct09$phe$1@dont-email.me> <5ef3721a-7b0f-4dfd-8dbf-fac4a7172b94@googlegroups.com> <n9fg1k$jke$1@dont-email.me> <n9fki0$576$1@dont-email.me>

Show all headers | View raw


On 2016-02-10, David Brown <david.brown@hesbynett.no> wrote:
> On 10/02/16 15:07, BartC wrote:
>> On 10/02/2016 00:32, Öö Tiib wrote:
>>> On Tuesday, 9 February 2016 16:30:19 UTC+2, Richard Heathfield  wrote:
>>>> On 09/02/16 14:11, anitagoyal571@gmail.com wrote:
>>>>   > Python is an interpreted language.
>>>>   > Interpreter is a program that converts the high-level program we
>>>>   > write into low-level program that the computer understands.
>>>>
>>>> That sounds more like a compiler to me.
>>>
>>> Good catch. AFAIK Python is simply a programming language without
>>> requirement that it *must* be interpreted. There even are some
>>> JIT-compiling Python 3 implementations like PyPy and Pyston.
>
> There are few programming languages that /must/ be interpreted, or
> /must/ be compiled.

No programming language must be compiled, except those which explicitly
target environments that cannot support an interpreter.

> The exception is for code that is not known at "compile" time, such as
> creating Python code from a string - that would have to be interpreted
> or JIT-compiled.

There are other kinds of exceptions, like the use of fexprs.

fexprs are user-defined interpreter routines which get an unevaluated
AST and do something with it.

fexprs can do things which are impossible to compile.

Lisp shook off fexprs in the 1960's, but they are front and centre
in a dialect called NewLisp, which calls them macros.

The main point is that there are also ways for code to do introspection
without going through string evaluation.

The interpreter can open up an API to the data structures which
represent entities such as the program syntax tree, or variable binding
environments.

Code which does things like "look up the variable named by symbol X
in lexical environment object E" doesn't lend itself to compiling;
when compiling, we would X to go away and just be a register, or an
offset in some environment array. The introspection can be retained
through compiled code somehow, but at some great expense and perhaps
with restrictions (e.g. doesn't work at some optimization levels or
whatever).

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

First Program with Python! anitagoyal571@gmail.com - 2016-02-09 06:11 -0800
  Re: First Program with Python! Richard Heathfield <rjh@cpax.org.uk> - 2016-02-09 14:30 +0000
    Re: First Program with Python! Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-02-09 14:35 +0000
      Re: First Program with Python! Richard Heathfield <rjh@cpax.org.uk> - 2016-02-09 19:06 +0000
        Re: First Program with Python! Öö Tiib <ootiib@hot.ee> - 2016-02-09 16:55 -0800
          Re: First Program with Python! Richard Heathfield <rjh@cpax.org.uk> - 2016-02-10 09:20 +0000
          Re: First Program with Python! Kaz Kylheku <330-706-9395@kylheku.com> - 2016-02-15 16:49 +0000
    Re: First Program with Python! Öö Tiib <ootiib@hot.ee> - 2016-02-09 16:32 -0800
      Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-10 14:07 +0000
        Re: First Program with Python! David Brown <david.brown@hesbynett.no> - 2016-02-10 16:24 +0100
          Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-10 16:55 +0000
            Re: First Program with Python! David Brown <david.brown@hesbynett.no> - 2016-02-11 00:18 +0100
              Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-11 00:07 +0000
          Re: First Program with Python! Kaz Kylheku <330-706-9395@kylheku.com> - 2016-02-15 16:58 +0000
        Re: First Program with Python! Richard Heathfield <rjh@cpax.org.uk> - 2016-02-10 21:51 +0000
          Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-11 00:15 +0000
  Re: First Program with Python! Kaz Kylheku <330-706-9395@kylheku.com> - 2016-02-15 16:46 +0000
    Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-15 17:31 +0000
      Re: First Program with Python! Richard Heathfield <rjh@cpax.org.uk> - 2016-02-15 20:16 +0000
        Re: First Program with Python! BartC <bc@freeuk.com> - 2016-02-15 22:45 +0000
          Re: First Program with Python! Kaz Kylheku <330-706-9395@kylheku.com> - 2016-02-16 03:40 +0000

csiph-web