By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,766 Members | 1,295 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,766 IT Pros & Developers. It's quick & easy.

A 'Python like' language

P: n/a
Well after all this discussion it would appear that a 'Python like'
language has appeared => Prothon. http://www.prothon.org/index.html

Very alpha, sort of like Python (if you consider the indenting is what
makes Python unique) and sort of Ruby in its use of prefixes to define
scoping etc (although there is no reference to this trait being borrowed
from Ruby). It also quotes Self as being an influence.
Jul 18 '05 #1
Share this Question
Share on Google+
105 Replies


P: n/a
On Fri, 26 Mar 2004 16:42:54 +0000, Peter Hickman
<pe***@semantico.com> wrote:
Well after all this discussion it would appear that a 'Python like'
language has appeared => Prothon. http://www.prothon.org/index.html

Very alpha, sort of like Python (if you consider the indenting is what
makes Python unique) and sort of Ruby in its use of prefixes to define
scoping etc (although there is no reference to this trait being borrowed
from Ruby). It also quotes Self as being an influence.


Very interesting ...

Quoting from Prothon's home page:
'''
Over time capabilities have been added to the core Python language,
.... and Python has became loaded with features, some quite complex.
'''

So all they need is an automatic translation from Python to Prothon,
then they can grab all of Python's libraries, and bypass ten years of
development. :>)

We really need in Python a clear separation of advanced features from
the basic syntax. No more lambda calculus in the basic part. :>)

-- Dave

Jul 18 '05 #2

P: n/a

"David MacQuigg" <dm*@gain.com> wrote in message
news:p1********************************@4ax.com...
On Fri, 26 Mar 2004 16:42:54 +0000, Peter Hickman
<pe***@semantico.com> wrote:
Well after all this discussion it would appear that a 'Python like'
language has appeared => Prothon. http://www.prothon.org/index.html

Very alpha, sort of like Python (if you consider the indenting is what
makes Python unique) and sort of Ruby in its use of prefixes to define
scoping etc (although there is no reference to this trait being borrowed
from Ruby). It also quotes Self as being an influence.


Very interesting ...


Yes, especially since they didn't learn their lessons about
tab as an indentation character. That means that I can't send
a Prothon program (or snippet from one) using Outlook
Express, which automaticlly strips tabs from the front of
lines, thus destroying the indentation.

An interesting language that has just dropped off of
my radar screen as being unusable in my environment.

John Roth
Jul 18 '05 #3

P: n/a
"John Roth" <ne********@jhrothjr.com> wrote:
Yes, especially since they didn't learn their lessons about
tab as an indentation character. That means that I can't send
a Prothon program (or snippet from one) using Outlook
Express, which automaticlly strips tabs from the front of
lines, thus destroying the indentation.


Are you objecting specifically to the use of the tab character for
indenting, or to the use of white space for statement grouping in
general?
Jul 18 '05 #4

P: n/a
Il Fri, 26 Mar 2004 13:53:45 -0500, Roy Smith ha scritto:
"John Roth" <ne********@jhrothjr.com> wrote:
Yes, especially since they didn't learn their lessons about tab as an
indentation character. That means that I can't send a Prothon program
(or snippet from one) using Outlook Express, which automaticlly strips
tabs from the front of lines, thus destroying the indentation.


Are you objecting specifically to the use of the tab character for
indenting, or to the use of white space for statement grouping in general?


Just the tab, python coding style says that 4 spaces is the standard for
indentation and you should try to avoid tab (unless for very old projects).
A single space is always a single space while a tab is often managed in obscure
ways...

Anyway GvR just posted on the python-dev saying this:

==
No, I want to reserve the leading dot for attribute assignment to a
special object specified by a 'with' statement, e.g.

with self:
.foo = [1, 2, 3]
.bar(4, .foo)
==

So another feature of this prothon (and a major one) is going to be a python one
too.

--
Valentino Volonghi aka Dialtone
Linux User #310274, Gentoo Proud User
X Python Newsreader developer
http://sourceforge.net/projects/xpn/

Jul 18 '05 #5

P: n/a

3 solutions:

1. Use spaces instead of tabs. Hit the space bar yourself, or an editor
that replaces tabs with spaces.
2. Include as a .py or text file instead of inline.
3. Get a different email program.

"John Roth" <ne********@jhrothjr.com> wrote in message
news:10************@news.supernews.com...

"David MacQuigg" <dm*@gain.com> wrote in message
news:p1********************************@4ax.com...
On Fri, 26 Mar 2004 16:42:54 +0000, Peter Hickman
<pe***@semantico.com> wrote:
Well after all this discussion it would appear that a 'Python like'
language has appeared => Prothon. http://www.prothon.org/index.html

Very alpha, sort of like Python (if you consider the indenting is what
makes Python unique) and sort of Ruby in its use of prefixes to define
scoping etc (although there is no reference to this trait being borrowedfrom Ruby). It also quotes Self as being an influence.


Very interesting ...


Yes, especially since they didn't learn their lessons about
tab as an indentation character. That means that I can't send
a Prothon program (or snippet from one) using Outlook
Express, which automaticlly strips tabs from the front of
lines, thus destroying the indentation.

An interesting language that has just dropped off of
my radar screen as being unusable in my environment.

John Roth

Jul 18 '05 #6

P: n/a
begin John Roth <ne********@jhrothjr.com> quote:
Yes, especially since they didn't learn their lessons about
tab as an indentation character. That means that I can't send
a Prothon program (or snippet from one) using Outlook
Express, which automaticlly strips tabs from the front of
lines, thus destroying the indentation.


Lumberjack with dull saw should not blame tree.

--
Karl A. Krueger <kk******@example.edu>
Woods Hole Oceanographic Institution
Email address is spamtrapped. s/example/whoi/
"Outlook not so good." -- Magic 8-Ball Software Reviews
Jul 18 '05 #7

P: n/a
DH
> Anyway GvR just posted on the python-dev saying this:

==
No, I want to reserve the leading dot for attribute assignment to a
special object specified by a 'with' statement, e.g.

with self:
.foo = [1, 2, 3]
.bar(4, .foo)
brilliant!
this is in VB so neither of us can claim to have invented it. :-)
oh wait, this sucks :)
(And "with" was in Pascal 30+ years ago, without the leading dot.)


lemme ask my grandfather for his opinion
Jul 18 '05 #8

P: n/a

"D Martin" <dg*****************@hotmail.com> wrote in message
news:ax%8c.9470$wg1.4018@edtnps84...

3 solutions:

1. Use spaces instead of tabs. Hit the space bar yourself, or an editor
that replaces tabs with spaces.
2. Include as a .py or text file instead of inline.
3. Get a different email program.
All of these fail for one simple reason. Let's hit
the chorus, guys:

"We're right, everybody else needs to change..."

The hard fact is, lots of utility programs treat
tabs in wild and wonderful ways, many of which
are not under the control of the user. There's
a reason why the Python standard is spaces, and
why tabs will be eliminated as an option in 3.0.

John Roth
"John Roth" <ne********@jhrothjr.com> wrote in message
news:10************@news.supernews.com...

"David MacQuigg" <dm*@gain.com> wrote in message
news:p1********************************@4ax.com...
On Fri, 26 Mar 2004 16:42:54 +0000, Peter Hickman
<pe***@semantico.com> wrote:

>Well after all this discussion it would appear that a 'Python like'
>language has appeared => Prothon. http://www.prothon.org/index.html
>
>Very alpha, sort of like Python (if you consider the indenting is what >makes Python unique) and sort of Ruby in its use of prefixes to define >scoping etc (although there is no reference to this trait being borrowed >from Ruby). It also quotes Self as being an influence.

Very interesting ...


Yes, especially since they didn't learn their lessons about
tab as an indentation character. That means that I can't send
a Prothon program (or snippet from one) using Outlook
Express, which automaticlly strips tabs from the front of
lines, thus destroying the indentation.

An interesting language that has just dropped off of
my radar screen as being unusable in my environment.

John Roth


Jul 18 '05 #9

P: n/a
On Fri, 26 Mar 2004 16:42:54 +0000, Peter Hickman
<pe***@semantico.com> wrote:
Well after all this discussion it would appear that a 'Python like'
language has appeared => Prothon. http://www.prothon.org/index.html

Very alpha, sort of like Python (if you consider the indenting is what
makes Python unique) and sort of Ruby in its use of prefixes to define
scoping etc (although there is no reference to this trait being borrowed
from Ruby). It also quotes Self as being an influence.


What I found most interesting about this language is that it *doesn't
use classes* !! All objects are derived directly from other objects,
some of which are "prototypes", that is, objects which were designed
to be just templates to produce other objects.

I downloaded the interpreter, and it installed flawlessly on my XP
machine! I ran through the examples from their webpage, and they
worked as shown! As I am generating objects from prototypes, I am
thinking - How can this be so simple? Surely we must need classes for
something. What about static methods? Is all of this just cruft in
Python?

The torture never stops. :>)

-- Dave

Jul 18 '05 #10

P: n/a
It's getting near to April 1 so is prothon http://www.prothon.org/ real?
--
Robin Becker
Jul 18 '05 #11

P: n/a
"Robin Becker" <ro***@jessikat.fsnet.co.uk> wrote in message
news:Me**************@jessikat.fsnet.co.uk...
It's getting near to April 1 so is prothon http://www.prothon.org/ real?
--
Robin Becker


If so, it's a pretty elaborate hoax: the interpreter is downloadable and
even works! :) There are also three active mailing lists.

Daniel Ellison
Jul 18 '05 #12

P: n/a

"David MacQuigg" <dm*@gain.com> wrote in message
news:o5********************************@4ax.com...
On Fri, 26 Mar 2004 16:42:54 +0000, Peter Hickman
<pe***@semantico.com> wrote:
Well after all this discussion it would appear that a 'Python like'
language has appeared => Prothon. http://www.prothon.org/index.html

Very alpha, sort of like Python (if you consider the indenting is what
makes Python unique) and sort of Ruby in its use of prefixes to define
scoping etc (although there is no reference to this trait being borrowed
from Ruby). It also quotes Self as being an influence.


What I found most interesting about this language is that it *doesn't
use classes* !! All objects are derived directly from other objects,
some of which are "prototypes", that is, objects which were designed
to be just templates to produce other objects.

I downloaded the interpreter, and it installed flawlessly on my XP
machine! I ran through the examples from their webpage, and they
worked as shown! As I am generating objects from prototypes, I am
thinking - How can this be so simple? Surely we must need classes for
something. What about static methods? Is all of this just cruft in
Python?

The torture never stops. :>)

-- Dave


That's what I love about prototype-based languages: they're just so simple.
Class-based language suffer from the meta-class complication, where in
Prothon (or in Self, or JavaScript, or Io, etc.) this is a non-issue.

If the Prothon people can somehow convert the Python libraries, we'll have a
very interesting situation...

Daniel Ellison
Jul 18 '05 #13

P: n/a
In article <10************@news.supernews.com>, John Roth
<ne********@jhrothjr.com> writes
......
Yes, especially since they didn't learn their lessons about
tab as an indentation character. That means that I can't send
a Prothon program (or snippet from one) using Outlook
Express, which automaticlly strips tabs from the front of
lines, thus destroying the indentation.

An interesting language that has just dropped off of
my radar screen as being unusable in my environment.
luckily I learned the opposite and outlook has been off my radar since
its inception. I prefer tabs, but it seems hard to convince many
programs that they have meaning so probably the prothoneers have it
wrong.John Roth


--
Robin Becker
Jul 18 '05 #14

P: n/a
Valentino Volonghi aka Dialtone wrote:
Anyway GvR just posted on the python-dev saying this:

==
No, I want to reserve the leading dot for attribute assignment to a
special object specified by a 'with' statement, e.g.

with self:
.foo = [1, 2, 3]
.bar(4, .foo)
==

So another feature of this prothon (and a major one) is going to be a
python one
too.


Not quite the same, as with Prothon it looks like it always relates to
the self object, whereas in a `with' clause you can make it relates to
any object you wish.

--
__ Erik Max Francis && ma*@alcyone.com && http://www.alcyone.com/max/
/ \ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
\__/ Drifting from woman-who-tries misconstrued / Shifting to
woman-wise -- Lamya
Jul 18 '05 #15

P: n/a
In article <ax%8c.9470$wg1.4018@edtnps84>, D Martin wrote:

3 solutions:

1. Use spaces instead of tabs. Hit the space bar yourself, or an editor
that replaces tabs with spaces.
Which is exactly what he said you can't do with Prothon, since Prothon
has settled on tabs not spaces.
2. Include as a .py or text file instead of inline.
Which means that you can't post sample code interspersed with
discussion.
3. Get a different email program.


Sorry, you'll have to talk to the sysadmin about that.

Joe
Jul 18 '05 #16

P: n/a
In article <c4*************@ID-227230.news.uni-berlin.de>, Daniel Ellison wrote:
That's what I love about prototype-based languages: they're just so simple.
Class-based language suffer from the meta-class complication, where in
Prothon (or in Self, or JavaScript, or Io, etc.) this is a non-issue.

If the Prothon people can somehow convert the Python libraries, we'll have a
very interesting situation...


I would like to point out that you can make Python work pretty much the
same way, too, with only a few rough edges. (Summary starts at
http://www.advogato.org/person/JoeNo...y.html?start=2 - I
already posted a link to that in response to the initial announcement.)

This has the benefit that you can choose to make just your new classes
prototyped - say, by creating a ProtoBase class with the "__metaclass__ =
Prototype" attribute, so that any subclass of ProtoBase works as in
Prothon and everything else as in classic Python. That means you can
keep using any existing libraries you want, mix it with new code, etc.

The complexity of the metaclass, of course, can be hidden in a library
so that users don't need to know about it any more than they know how
Prothon works under the hood.

I prefer this to Prothon (he says without having done more than read the
summary on the web page) because it makes only the minimal changes
needed to make Python prototype-based - all the various other changes,
like the tab problem, don't have to be taken into account when deciding
whether to use the language or not.

Joe
Jul 18 '05 #17

P: n/a
On 2004-03-26, John Roth <ne********@jhrothjr.com> wrote:
"D Martin" <dg*****************@hotmail.com> wrote in message
news:ax%8c.9470$wg1.4018@edtnps84...
3 solutions: 1. Use spaces instead of tabs. Hit the space bar yourself, or an editor
that replaces tabs with spaces.
2. Include as a .py or text file instead of inline.
3. Get a different email program.

All of these fail for one simple reason. Let's hit
the chorus, guys: "We're right, everybody else needs to change..."


Hey, that's the Chorus from the Microsoft song! You're the one using
Lookout! You're the one complaining about the shortfalls in your tools
because Microsoft sings that song. *YOU* deal with it.

--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
PGP Key: 8B6E99C5 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
Jul 18 '05 #18

P: n/a
In article <40***************@alcyone.com>,
Erik Max Francis <ma*@alcyone.com> wrote:
Valentino Volonghi aka Dialtone wrote:
Anyway GvR just posted on the python-dev saying this:

==
No, I want to reserve the leading dot for attribute assignment to a
special object specified by a 'with' statement, e.g.

with self:
.foo = [1, 2, 3]
.bar(4, .foo)
==

So another feature of this prothon (and a major one) is going to be a
python one
too.


Not quite the same, as with Prothon it looks like it always relates to
the self object, whereas in a `with' clause you can make it relates to
any object you wish.


Prothon seems to have a `with' clause, which overrides
the default thus:

.name # refers to the name attribute of the self object
....
with other:
.name # refers to other.name
though I won't know for sure until I've found a copy of
MSVCR70.DLL
Regards. Mel.
-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
Jul 18 '05 #19

P: n/a
David MacQuigg <dm*@gain.com> wrote in message news:<o5********************************@4ax.com>. ..
What I found most interesting about this language is that it *doesn't
use classes* !! All objects are derived directly from other objects,
some of which are "prototypes", that is, objects which were designed
to be just templates to produce other objects.


Yes, this seemed interesting to me too. But when arrived at the sentence
"Prothon only allows tabs for indentation" I couldn't continue reading ;-)

Michele Simionato
Jul 18 '05 #20

P: n/a
> David MacQuigg <dm*@gain.com> wrote in message
news:<o5********************************@4ax.com>. ..
What I found most interesting about this language is that it *doesn't
use classes* !! All objects are derived directly from other objects,
some of which are "prototypes", that is, objects which were designed
to be just templates to produce other objects.


Yes, this seemed interesting to me too. But when arrived at the sentence
"Prothon only allows tabs for indentation" I couldn't continue reading ;-)


I think the move to tabs-only for indentation was to allow for
single-pass compiling. I'm not saying it was a good move, just that
that's my guess for the reason :)

What I found interesting was:
- the use of the Apache Portable Runtime
(to provide threads, file and network services)
- native threads via locks on each object
- the stackless-ness
- multiple interpreters via native threads

It remains to be seen whether those sorts of changes result
in any significant speed differences. I may try writing some
multithreaded test scripts and running them this weekend to see if
an actual performance increase exists over multi-threaded python
- if so, the internals may be of interest to the python community
itself.
Has anyone else already performed that sort of performance
comparison?

~Jon Franz
NeuroKode Labs, LLC
513.260.5788
Jul 18 '05 #21

P: n/a
Michele Simionato wrote:
David MacQuigg <dm*@gain.com> wrote in message
news:<o5********************************@4ax.com>. ..
What I found most interesting about this language is that it *doesn't
use classes* !! All objects are derived directly from other objects,
some of which are "prototypes", that is, objects which were designed
to be just templates to produce other objects.


Yes, this seemed interesting to me too. But when arrived at the sentence
"Prothon only allows tabs for indentation" I couldn't continue reading ;-)


The implementation of indentation is a minor issue.
Many editors have facilities to deal with them.
The point is that Prothon uses indentation. I hope
this will help in making it at least as easy to read
and maintain as Python. Who knows, at some point Prothon
might 'fall back' to spaces...

I like the prototypes _very_ much. They leave out many of the
implicit mechanisms in classes and they are relatively easy
to explain.

My first impression is that one can use prototypes like classes,
but they allow more flexibility. I wonder what influence they
will have on the classic class/object dichotomy in OO land.

As for the 'with' statement: I remember getting introduced to it
in Pascal, where it led to confusion an did not contribute to
code readability because of that. Pascal allowed more than
one variable to be used in the 'with' statement iirc.

On the contrary, the examples in Prothon are quite readable:
no confusion because there is only one implied variable, and
there is syntax (the leading dot) to show where it is used.

I do not yet know in detail how Prothon deals with module
namespaces. These are important for larger scale programs,
so I hope they got that right.

One thing I'm missing on the website is support for basic
structured datatypes like the list and the dictionary in Python.
The syntax support that Python has for these greatly
contributes to useability.

Regards,
Ype

Jul 18 '05 #22

P: n/a
"Daniel Ellison" <da****@syrinx.net> wrote in message news:<c4*************@ID-227230.news.uni-berlin.de>...
That's what I love about prototype-based languages: they're just so simple.
Class-based language suffer from the meta-class complication ...


Sorry, but this statement makes no sense. Plenty of class-based languages
(Java, C++, early versions of Python, etc.) do not expose metaclasses to
the user, so there is no metaclass complication. For what concerns languages
that expose metaclasses to the user (such as Smalltalk, Lisp, Python), you
must notice that you are not forced to use metaclasses. Also, it is
unlikely that you will be in the situation of maintaining code using
metaclasses and written by others, so there is no risk your brain will
explode ;)

Metaclasses are intended as a tool for framework designers, not for the
casual programmer. It is true that as time passes they will probably becomes
more popular and more used (as I hope) but still 99% of Python code will
be written without metaclasses.

It makes no sense to say "look, Python was a beatiful and simple language
until a couple of years ago: now they have added metaclasses and it has
become a mess, I must switch to something simpler". All the code you
wrote before metaclasses is still clean, simple and still works!

I don't think Python has become significantly more complex for the
average user (actually I think it has become even simpler); OTOH,
it has become more useful for the sophisticated user.

What I like of Python is its layered structure: it can be used at
many levels and it is as good for the beginner as for the advanced
user. Most other languages are for beginners only or for experts only:
Python is for everybody.

Finally, just to conclude, I don't think metaclasses are that complicated;
they just have a bad reputation ;)

Michele Simionato
Jul 18 '05 #23

P: n/a
"John Roth" <ne********@jhrothjr.com> wrote
... they didn't learn their lessons about
tab as an indentation character. That means that I can't send
a Prothon program (or snippet from one) using Outlook
Express, which automaticlly strips tabs from the front of
lines, thus destroying the indentation.

An interesting language that has just dropped off of
my radar screen as being unusable in my environment.

By that you mean that you'll never again use Outlook Express?

Jim
Jul 18 '05 #24

P: n/a
"Jon Franz" <jf****@neurokode.com> wrote:
What I found interesting was:
- the stackless-ness


What does stacklessness do for me as an application programmer?
Jul 18 '05 #25

P: n/a

D> 3 solutions:

D> 1. Use spaces instead of tabs. Hit the space bar yourself, or an
D> editor that replaces tabs with spaces.

Won't work. Prothon requires tabs.

D> 2. Include as a .py or text file instead of inline.

Thanks to Microsoft, attachments frequently don't pass through mail servers
these days. I know I filter all attachments out of a couple small mailing
lists I manage.

D> 3. Get a different email program.

That would be the tail wagging the dog. I suspect everybody writes far more
email which doesn't include programs. They should be able to use whatever
email program suits them best.

At any rate, I agree with John that the Prothon folks got this particular
bit dead wrong. If they wanted to avoid tab/space problems they should have
required that all indentation use only spaces, not only tabs.

Skip

Jul 18 '05 #26

P: n/a
On Sat, 27 Mar 2004 07:58:44 -0600, Skip Montanaro <sk**@pobox.com>
wrote:
Thanks to Microsoft, attachments frequently don't pass through mail servers
these days. I know I filter all attachments out of a couple small mailing
lists I manage.
I've never had this problem. Is this something MS exchange does?
At any rate, I agree with John that the Prothon folks got this particular
bit dead wrong. If they wanted to avoid tab/space problems they should have
required that all indentation use only spaces, not only tabs.


The advantage of tabs ( a small one in my opinion ) is that the reader
can adjust the actual spacing to his preference. Another advantage is
that you can add leading spaces for purely cosmetic reasons (lining up
columns in a continuation line ). The tabs control the syntax.

x = 1.23 + 2.34 + 3.45 + 4.56 + \
5.23 + 6.34 + 7.44 + 8.56 # Which number is slightly off ?

The solution I believe, is to have a special 'publishing' mode where
tabs are replaced by the character sequence '. ' with however many
spaces the sender wants. The dots actually make large, deeply-nested
blocks easier to read.

Of course, we will need a matching import mode, converting the
dot-space sequences back to tabs.

-- Dave

Jul 18 '05 #27

P: n/a
On 26 Mar 2004 20:49:00 -0800, mi***************@poste.it (Michele
Simionato) wrote:
David MacQuigg <dm*@gain.com> wrote in message news:<o5********************************@4ax.com>. ..
What I found most interesting about this language is that it *doesn't
use classes* !! All objects are derived directly from other objects,
some of which are "prototypes", that is, objects which were designed
to be just templates to produce other objects.


Yes, this seemed interesting to me too. But when arrived at the sentence
"Prothon only allows tabs for indentation" I couldn't continue reading ;-)


I almost had the same reaction when I first read this, but I did
continue reading, and I'm glad. I remember making the same mistake
when I first read about Python using whitespace to control structure.
"Oh no, not another FORTRAN.", and I didn't look again for 3 months.

This is a small problem with a simple solution (see my earlier post),
and one that will retain the advantages of tabs.

-- Dave

Jul 18 '05 #28

P: n/a
On Fri, 26 Mar 2004 13:53:45 -0500, Roy Smith <ro*@panix.com> wrote:
"John Roth" <ne********@jhrothjr.com> wrote:
Yes, especially since they didn't learn their lessons about
tab as an indentation character. That means that I can't send
a Prothon program (or snippet from one) using Outlook
Express, which automaticlly strips tabs from the front of
lines, thus destroying the indentation.


Are you objecting specifically to the use of the tab character for
indenting, or to the use of white space for statement grouping in
general?


I don't know about David, but I know that I specifically dislike the
use of the tab character. The *real* evil happens when people mix tabs
and spaces for indentation, but I always preferred to use spaces
rather than tabs.

Different people have different tab sizes set up in their editors. As
long as you don't mix tabs and spaces, the indentation itself will be
clear - but having a different tab size can break other aspects of
vertical alignment, damaging readability in other ways. It isn't as
bad as the problems that arise when mixing tabs and spaces for
indentation, but IMO it is bad enough.

Reading (and maintaining consistency with) someone elses preferred
indent size isn't really a hassle. Compared with dealing with tab size
issues, IMO it's by far the least hassle. And of course any decent
editor can convert tab keypresses to equivalent numbers of spaces as
you type.
On a separate issue, the Prothon developers seem to have the mistaken
view that commas influence line continuation in Python. They don't -
but parentheses, square brackets and braces do. Though the Prothon
extra-indentation system (which is similar to Haskells offside rule, I
suppose) is an interesting idea.
--
Steve Horne

steve at ninereeds dot fsnet dot co dot uk
Jul 18 '05 #29

P: n/a
David MacQuigg <dm*@gain.com> wrote in message news:<mn********************************@4ax.com>. ..
On 26 Mar 2004 20:49:00 -0800, mi***************@poste.it (Michele
Simionato) wrote:
This is a small problem with a simple solution (see my earlier post),
and one that will retain the advantages of tabs.


Which advantages?
Jul 18 '05 #30

P: n/a
David MacQuigg <dm*@gain.com> wrote in message news:<mn********************************@4ax.com>. ..
This is a small problem with a simple solution (see my earlier post),
and one that will retain the advantages of tabs.


Just to be clear, the previous one was a rethorical question. Use any
editor
with decent Python support and pressing the tab key will insert four
spaces,
indenting your code just fine. Even if you are using Notepad on
Windows, it is
best if you use spaces, otherwise you risk to be beaten by Outlook
Express the Tabs Eater.
Plus, the size of a tab (8 spaces? 4 spaces?) and the output you get
is totally dependent on the system you are using. Seriously, even
doing an effort I cannot imagine a single advantage of tabs. Tabs are
evil.
They are an historical wart, they should just be banned from modern
computing.

Michele Simionato
Jul 18 '05 #31

P: n/a

Michele> It makes no sense to say "look, Python was a beatiful and
Michele> simple language until a couple of years ago: now they have
Michele> added metaclasses and it has become a mess, I must switch to
Michele> something simpler". All the code you wrote before metaclasses
Michele> is still clean, simple and still works!

Step 1. Admit you have a problem.

Hello, my name is Skip and I am metaclass-unaware. I've been programming in
Python for about ten years and I have yet to write a metaclass. At first I
thought it was just that metaclasses were new to the language, but now as
more and more people use them and proclaim their widespread benefits, I have
come to realize that through years of abuse my brain has become addicted to
classic classes.

what-was-step-2-again?-ly, y'rs,

Skip

Jul 18 '05 #32

P: n/a
Thanks to Microsoft, attachments frequently don't pass through mail
servers these days. I know I filter all attachments out of a couple
small mailing lists I manage.


David> I've never had this problem. Is this something MS exchange does?

No. It's just that with so many virii running around attached to email that
often the simplest thing to do is to strip delete all attachments passing
through mailing list manager software.

Skip

Jul 18 '05 #33

P: n/a

Stephen> Different people have different tab sizes set up in their
Stephen> editors. As long as you don't mix tabs and spaces, the
Stephen> indentation itself will be clear - but having a different tab
Stephen> size can break other aspects of vertical alignment, damaging
Stephen> readability in other ways. It isn't as bad as the problems
Stephen> that arise when mixing tabs and spaces for indentation, but IMO
Stephen> it is bad enough.

Tim Peters used to complain often enough that email messages I posted which
contained bits of Python code I typed into them contained mixtures of tabs
and spaces (which muffed the layout in his mail reader) that I finally added
a little bit of code to my XEmacs setup to untabify all outgoing mail:

(defun untab-buffer ()
(untabify (point-min) (point-max)))
(add-hook 'mail-send-hook 'untab-buffer)

Tim hasn't complained about that aspect of my Python since then. (Other
things, yes, but not tabs).

Skip

Jul 18 '05 #34

P: n/a
>>At any rate, I agree with John that the Prothon folks got this particular
bit dead wrong. If they wanted to avoid tab/space problems they should have
required that all indentation use only spaces, not only tabs.
The advantage of tabs ( a small one in my opinion ) is that the reader
can adjust the actual spacing to his preference.


Funny, but I can do a search and replace to do the same. In fact, I use
search and replace to get rid of the tabs that newbies use in Python code. *
Another advantage is
that you can add leading spaces for purely cosmetic reasons (lining up
columns in a continuation line ). The tabs control the syntax.
When you have line continuations, spacing on the subsequent line doesn't
matter, so this "advantage" you cite, is not an advantage.

The solution I believe, is to have a special 'publishing' mode where
tabs are replaced by the character sequence '. ' with however many
spaces the sender wants. The dots actually make large, deeply-nested
blocks easier to read.
For you, it makes large, deeply-nested blocks easier to read. That may
not be the case for other people. Furthermore, having a special
"publishing" mode, in order to replace tabs with spaces (and a .), is
just trying to fix the problem of tabs, which can be fixed much easier
with not using tabs in the first place.

Of course, we will need a matching import mode, converting the
dot-space sequences back to tabs.


* The trick is that '. ' is a valid stream of characters not inside an
indent sequence:

def blah():
"""I am a docstring with some bullet-like things.
.. bullet point 1
.. bullet point 2
.. bullet point 3
.. bullet point 4
"""
When you replace '. ' with tab characters, you end up changing the
contents of the docstring. It also makes it less straightforward to
give code to people who /don't/ have editors that are aware of this
arbitrary method of representing tabs.

Tabs as scope was a mistake, Guido has pronounced it as such. The fact
that Prothon is using it as its /only/ scope delimiter, means that they
are making an even bigger mistake, that they won't be able to get out of
easily if/when they get many users.

- Josiah
Jul 18 '05 #35

P: n/a
>>What I found interesting was:
- the stackless-ness


What does stacklessness do for me as an application programmer?


Head to the main stackless Python page to find out what it can do for
you. I don't know how much of this is applicable to Protheon, but it
should give you some idea:
http://www.stackless.com/

- Josiah
Jul 18 '05 #36

P: n/a

P: n/a
Michele Simionato wrote:
David MacQuigg <dm*@gain.com> wrote in message news:<mn********************************@4ax.com>. ..
On 26 Mar 2004 20:49:00 -0800, mi***************@poste.it (Michele
Simionato) wrote:
This is a small problem with a simple solution (see my earlier post),
and one that will retain the advantages of tabs.


Which advantages?

If the contest you're submitting your program to has hard byte limit,
and you need large indents to properly document your code. (That is
one thing.)
--
CARL BANKS http://www.aerojockey.com/software
"If you believe in yourself, drink your school, stay on drugs, and
don't do milk, you can get work."
-- Parody of Mr. T from a Robert Smigel Cartoon
Jul 18 '05 #38

P: n/a
>
If the contest you're submitting your program to has hard byte limit,
and you need large indents to properly document your code. (That is
one thing.)


Usually contests of the sort offer the opportunity to submit a "pretty"
and a "small" version of your code. One that contains proper spacing,
another that contains minimal spacing. Show me a contest that doesn't
allow it, and I'll show you a contest that isn't worth entering.

- Josiah
Jul 18 '05 #39

P: n/a
"Jon Franz" <jf****@neurokode.com> writes:
Yes, this seemed interesting to me too. But when arrived at the sentence
"Prothon only allows tabs for indentation" I couldn't continue reading ;-)
I think the move to tabs-only for indentation was to allow for
single-pass compiling. I'm not saying it was a good move, just that
that's my guess for the reason :)


I can't comprehend how tabs instead of spaces makes single-pass
compiling any easier. The main advantage I can see is it messes up
some Windows mailers, so maybe Windows won't pollute the dev process
as much ;-).
What I found interesting was:
- the use of the Apache Portable Runtime
(to provide threads, file and network services)
- native threads via locks on each object
- the stackless-ness
- multiple interpreters via native threads


Also of interest, the mark/sweep garbage collector instead of
reference counting. That may make it easier to write C extensions
(fewer PY_DECREF errors to make).
Jul 18 '05 #40

P: n/a
On Sat, 27 Mar 2004 13:07:51 -0600, Skip Montanaro <sk**@pobox.com>
wrote:
Tim Peters used to complain often enough that email messages I posted which
contained bits of Python code I typed into them contained mixtures of tabs
and spaces
GET THEE BEHIND ME, SATAN!!!
Tim hasn't complained about that aspect of my Python since then. (Other
things, yes, but not tabs).


When reading other peoples code, there is *always* something to
complain about ;-)
--
Steve Horne

steve at ninereeds dot fsnet dot co dot uk
Jul 18 '05 #41

P: n/a
On Fri, 26 Mar 2004 20:25:11 +0100, Valentino Volonghi aka Dialtone
<di**********************@virgilio.it> wrote:
Anyway GvR just posted on the python-dev saying this:

==
No, I want to reserve the leading dot for attribute assignment to a
special object specified by a 'with' statement, e.g.

with self:
.foo = [1, 2, 3]
.bar(4, .foo)
==


I missed that. There's good precedent - it's the Pascal 'with' block,
but better (the leading dot tells you that you're dealing with a
'with' item rather than normal scoping rules). But - well - just
recently, people keep telling me that indented blocks are purely about
control flow. I keep disagreeing, but no-one has bothered agreeing
with me so I was feeling rather lonely and miserable in this crusade
:-(

A 'with' block clearly has nothing at all to do with control flow. All
it does is provide some kind of local context for the contents of the
block. Very much like a suggestion or two that I have made recently
(none of which all that original, as far as I can tell).

Nonetheless, I will object. The with block, in this form, provides an
abbreviated alias for one identifier. Zero length is quite severely
abbreviated, of course, but better 'compression' could frequently be
achieved by abbreviating two or more identifiers.

For general applications, I'd rather have a small blocks and a simple
alias facility. An alias would never make it into dictionaries - it
would be handled entirely by the compiler. For example...

someverylongname = 1

block :
alias x = someverylongname

x = 2

print someverylongname # result is '2'

Depending on how the alias was implemented, it might also be possible
to alias certain kinds of expression...

alias x = someobj.someobj.membername

I wouldn't allow arbitrary expressions here, and it raises questions
about when the alias is bound to the referenced object which start to
push things towards normal identifiers so I'd have serious thoughts,
but there are cases that are probably worth considering where an alias
could reasonably be bound by the compiler without needing to insert
anything into any runtime dictionaries.

The trouble is that doing something like that would probably be
difficult as the compiler would need dictionary-like symbol tables
above and beyond what exists in the runtime environment, and the
run-time environment would have to provide for storage beyond what is
held in the normal dictionaries.

Anyway, personally, I'd say the prefix dot should be reserved for
'self' if used at all. It will certainly be by far the most common
case, perhaps to the point that people will assume 'self' as soon as
they see the prefix dot, which means that readability will be affected
by using 'with' for other variables. And if using 'with' for anything
other than 'self' creates readability issues and gets to be considered
bad style, the 'with' line itself is redundant.
--
Steve Horne

steve at ninereeds dot fsnet dot co dot uk
Jul 18 '05 #42

P: n/a
> although there is no reference to this trait being borrowed from Ruby

I will fix that.

Mark Hahn (Prothon Author)

"Peter Hickman" <pe***@semantico.com> wrote in message
news:40***********************@news.easynet.co.uk. ..
Well after all this discussion it would appear that a 'Python like'
language has appeared => Prothon. http://www.prothon.org/index.html

Very alpha, sort of like Python (if you consider the indenting is what
makes Python unique) and sort of Ruby in its use of prefixes to define
scoping etc (although there is no reference to this trait being borrowed
from Ruby). It also quotes Self as being an influence.

Jul 18 '05 #43

P: n/a
Michele Simionato wrote:
David MacQuigg <dm*@gain.com> wrote in message
news:<mn********************************@4ax.com>. ..
This is a small problem with a simple solution (see my earlier post),
and one that will retain the advantages of tabs.
Just to be clear, the previous one was a rethorical question. Use any
editor
with decent Python support and pressing the tab key will insert four
spaces,
indenting your code just fine. Even if you are using Notepad on
Windows, it is
best if you use spaces, otherwise you risk to be beaten by Outlook
Express the Tabs Eater.
Plus, the size of a tab (8 spaces? 4 spaces?) and the output you get
is totally dependent on the system you are using. Seriously, even
doing an effort I cannot imagine a single advantage of tabs. Tabs are
evil.


Normally, I also prefer spaces over tabs; but, when I was doing a bit of
Python editing on my Zaurus (with it's limited screenwidth), I *really*
appreciated the ability to edit with a tabsize of two spaces. When I moved
the code back to my desktop, I was able to view the code using my normal
four-space preference, with no changes to the code.
They are an historical wart, they should just be banned from modern
computing.

Michele Simionato


--Andy
Jul 18 '05 #44

P: n/a
In article <1f********************************@4ax.com>,
Stephen Horne <st***@ninereeds.fsnet.co.uk> wrote:

I missed that. There's good precedent - it's the Pascal 'with' block,
but better (the leading dot tells you that you're dealing with a
'with' item rather than normal scoping rules). But - well - just
recently, people keep telling me that indented blocks are purely about
control flow. I keep disagreeing, but no-one has bothered agreeing
with me so I was feeling rather lonely and miserable in this crusade
:-(


Huh? Where were they telling you that? (I don't read all of c.l.py by
a long shot, 'specially when I've just gotten back from PyCon.) From my
POV, indented blocks are about program structure and namespaces. Saying
that ``class`` refers purely to control flow definitely misses the point.
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"usenet imitates usenet" --Darkhawk
Jul 18 '05 #45

P: n/a
Jon Franz wrote:
What I found interesting was:
- native threads via locks on each object
Presumably this is bearable because of the lack of reference
counting, so that objects don't need to be locked and unlocked
at too frantic a rate.

But I wonder what effect the lack of reference counting has
on cache-friendliness of the memory management system.
- the stackless-ness


I wonder what effect that has on the ability of C code to
make callbacks into the interpreter.

--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg

Jul 18 '05 #46

P: n/a
Stephen Horne wrote:
On a separate issue, the Prothon developers seem to have the mistaken
view that commas influence line continuation in Python. They don't -
but parentheses, square brackets and braces do. Though the Prothon
extra-indentation system (which is similar to Haskells offside rule, I
suppose) is an interesting idea.


I like that, too, but why do they require *two* extra levels of
indenting to trigger it? Surely one would be enough?

Some other impressions:

* I'm not sure I like the leading-dot notation. The code
examples look untidy to my eyes; there's too much punctuation
and not enough stuff being punctuated. Maybe I could get
used to it... or maybe not.

* I definitely don't like the line-noise & and @ prefixes.
At least I would never have to use the @ (who in their
right mind actually *wants* dynamic scoping in this day
and age?-)

* A bit of syntactic sugar for defining prototype objects
wouldn't go amiss. Having to say

Thing = Base()
with Thing:
...

every time I want to define a class (oops, sorry, prototype)
would drive me batty. I'd much rather write something like

object Thing(Base):
...

By the way, did anyone figure out how you give an object
multiple prototypes? I don't remember seeing an example of
that.

* It's not clear whether there is any such thing as a bound
method in Prothon, i.e. whether you can do

f = someobj.somemeth
f()

and have it do what a Pythoneer would expect. And if so,
what happens if you do

f = someobj.somemeth
someotherobj.g = f
someotherobj.g()

What does the "self" object inside the call to somemeth
refer to then -- someobj, or someotherobj?

Answering that question may shed some light on what was
asked earlier: Do we really need classes?

--
Greg Ewing, Computer Science Dept,
University of Canterbury,
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg

Jul 18 '05 #47

P: n/a

I have not not run into problems with tabs. I actually agree that it is better
for indenting because if I want to view it as 2,3,4,5,6,7, or 8 spaces; I just
change my editor setting. Also, the file size is smaller. There would also be
slightly less parsing to do. Any, if 3.0 does go to spaces, I will be much
less likely to use python.

There is probably a reason why I have heard outlook referred to as outhouse.

John Roth wrote:
The hard fact is, lots of utility programs treat
tabs in wild and wonderful ways, many of which
are not under the control of the user. There's
a reason why the Python standard is spaces, and
why tabs will be eliminated as an option in 3.0.

Jul 18 '05 #48

P: n/a
David MacQuigg wrote:
On 26 Mar 2004 20:49:00 -0800, mi***************@poste.it (Michele
Simionato) wrote:

David MacQuigg <dm*@gain.com> wrote in message news:<o5********************************@4ax.com>. ..
What I found most interesting about this language is that it *doesn't
use classes* !! All objects are derived directly from other objects,
some of which are "prototypes", that is, objects which were designed
to be just templates to produce other objects.


Yes, this seemed interesting to me too. But when arrived at the sentence
"Prothon only allows tabs for indentation" I couldn't continue reading ;-)

I almost had the same reaction when I first read this, but I did
continue reading, and I'm glad.


Also if Python can drop tabs in version 3 then Prothon can correct this
mistake very quickly and not affect a lot of existing code. Better still
why don't we head over to Prothon and fix the tab right now.
Jul 18 '05 #49

P: n/a
Mark Hahn wrote:
although there is no reference to this trait being borrowed from Ruby

I will fix that.


Cheers, actually I wasn't sure if it was inspired by Ruby or that you
had come to this conclusion from a different route. Looks interesting.
Jul 18 '05 #50

105 Replies

This discussion thread is closed

Replies have been disabled for this discussion.