documenting formal operational semantics of Python

G

gideon

Hi Everybody,

In the context of a master's thesis I'm currently looking into
Python's operational semantics. Even after extensive searching on the
web, I have not found any formal model of Python. Therefore I am
considering to write one myself. To make a more informed decision, I
would like to ask you:

What previous work has been done that I should be aware of? Currently
I have found exactly nothing on python itself. There is some
interesting work on other, related languages like Smalltalk.

Which version of Python is the most interesting? Python 3.0, although
it would be a moving target, seems promising. Because it will simplify
the language in some aspects by ditching backwards compatibility (e.g.
old style classes and coercion), the semantics will be more clean.

Of course I will get, answers to many questions I did not ask. In
fact, I would like you to vent your opinions on this matter.

Thanks!
 
D

davidj411

Python 3.0 might end up better, but converting all those scripts will
be a chore.
I'd be curious to know how that will be done.
 
P

Paul Rubin

gideon said:
In the context of a master's thesis I'm currently looking into
Python's operational semantics. Even after extensive searching on the
web, I have not found any formal model of Python. Therefore I am
considering to write one myself.

I doubt if anything serious has been done in that area, and I don't
think Python culture operates like that very much. Python programming
tends to use informal processes with a lot of reliance on test-driven
development and unit tests, rather than formal specifications. A lot
of the operational behavior that people rely on basically comes from
accidents of implementation, e.g. file descriptors being closed
automatically when the last reference goes away. But of course that
should not be included in a formal semantics, yet that means the
semantics wouldn't describe actual production programs out there.
 
M

Matthew Woodcraft

gideon said:
In the context of a master's thesis I'm currently looking into
Python's operational semantics. Even after extensive searching on the
web, I have not found any formal model of Python. Therefore I am
considering to write one myself. To make a more informed decision, I
would like to ask you:
[...]

Which version of Python is the most interesting? Python 3.0, although
it would be a moving target, seems promising. Because it will simplify
the language in some aspects by ditching backwards compatibility (e.g.
old style classes and coercion), the semantics will be more clean.

Why not start with a common subset? Presumably the easiest thing will
be to start with a small core of the language and work up anyway. It
might turn out that all the interesting work has been done by the time
2.x/3.x makes any difference.

-M-
 
K

Kay Schluehr

Hi Everybody,

In the context of a master's thesis I'm currently looking into
Python's operational semantics. Even after extensive searching on the
web, I have not found any formal model of Python. Therefore I am
considering to write one myself. To make a more informed decision, I
would like to ask you:

What previous work has been done that I should be aware of? Currently
I have found exactly nothing on python itself. There is some
interesting work on other, related languages like Smalltalk.

Which version of Python is the most interesting? Python 3.0, although
it would be a moving target, seems promising. Because it will simplify
the language in some aspects by ditching backwards compatibility (e.g.
old style classes and coercion), the semantics will be more clean.

Of course I will get, answers to many questions I did not ask. In
fact, I would like you to vent your opinions on this matter.

Thanks!

Specifying Python formally could be a life work if this is anyhow
possible. So one has to restrict on certain aspects. I guess the issue
most people inside the discipline but also outside academia would be
most interested in is evaluation contexts: how are dictionaries and
tuples used in evaluation of Python bytecodes? How are stack frames
built and what information do they contain? Some of this stuff is
beyond what ordinary Pythonistas look at ( other than runtime
developers ) and building an abstract Python machine would be
invaluable.

The class semantics alone might fill a master thesis but then you are
also already involved in the question on how dicts and scope are used
to store/access contextual information.

Specifying how garbage collection works would be another highlight.
There is incredibly many stuff lying around and being untouched by
language researchers who usually write appendices to the work of the
heroes of their own professors ( who really wants to read another work
about Scheme or Smalltalk? ). Let us know when you got done something.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top