473,732 Members | 2,227 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Python vs. Io

Io (www.iolanguage.com) is a new programming language that's purely
object-oriented (but with prototypes), has a powerful concurrency
mechanism via actors, and uses an extremely flexible syntax because
all code is a modifiable message tree. Like Python, it is dynamically
typed, has a very clean syntax, produces short code, and is
excruciatingly slow (on the same level as eachother). Io has a unique
syntax combining Lisp's idea of functions for flow control with
traditional function syntax and smalltalk-like syntax to get slots of
objects. Io has no keywords and everything, even multiple lines of
code, can be used as an expression. Even as a beginner to Io, I was
able to write something in just 43 lines to let you do something like
this (and more) in Io:

each((key, value) in map(x=1, y=2, z=3),
write(key, ": ", value, "\n")
)

Neither the each function nor the map function were built in (Io has
other mechanisms for that kind of thing, but they are less efficient).
Can anyone show me how to so much as alias "for" to "each" in Python
or allow block syntax at all without hacking the C source code?

Io doesn't use __methods_with_ this_annoying_s yntax__ because nothing
is supposed to be for internal use only and there are only about three
functions that would cause a problem if overridden.

For embedding, Io doesn't have to use Py_ALL_CAPS, instead it just
uses IoCamelCase, which looks much better. Interfaces to C are much
more object oriented.

Many users of Io (myself included) have switched over from Python for
these reasons.

I guess there are still the obvious advantages of Python over Io,
including
*large community
*more bindings to stuff
*strict coding conventions
*inflexible so everything is the same
*no need to close blocks
But unless there are other problems, the first two go away soon
(considering that Io was first created just two years ago). The last
three are somewhat trivial and may even be to Io's advantage.

Daniel Ehrenberg
Jul 18 '05
20 2453
Li************@ yahoo.com (Daniel Ehrenberg) wrote in message news:<71******* *************** ***@posting.goo gle.com>...
Can anyone show me how to so much as alias "for" to "each" in Python
or allow block syntax at all without hacking the C source code?


I think the point is, why on earth would you want to do something like
that? If you want a language you can use to make programs that make
no sense to anyone but the author, Perl should be more than sufficient
for your needs.
Jul 18 '05 #11
On 29 Jan 2004 13:01:06 -0800, Li************@ yahoo.com (Daniel
Ehrenberg) wrote:

....
Can anyone show me how to so much as alias "for" to "each" in Python
or allow block syntax at all without hacking the C source code? ....Many users of Io (myself included) have switched over from Python for
these reasons.

If you've switch from Python to Io, what will you do with the answers
to these questions? Use them for good or evil? Will you switch back
from Io to Python?
--dang
Jul 18 '05 #12
On Sun, 01 Feb 2004 13:47:20 -0800, Paul Prescod <pa**@prescod.n et> wrote:
First, if I had invented Python I would not have bothered to buck the
trend of using curly braces. Hardly anyone chooses Python because of
that feature and some are turned off by it.


I have to admit that the indentation feature turned me off at first, but
having used Python for a while now, I find that method superior to the
curly braces approach. Much more DWIM.
Jul 18 '05 #13
"Paul Prescod" <pa**@prescod.n et> wrote in message
news:ma******** *************** *************** *@python.org...
First, if I had invented Python I would not have bothered to buck the
trend of using curly braces.
I suppose I am hardly anyone else, since that it exactly what
attracted me to Python. In fact, I will take partial responsibility
for the indentaion syntax in IBM's ISPF mini-language - it's a
preferance of long standing with me.

Now that I actually have a significant language using them, I
can see that there are a couple of things they make more
difficult, statement syntax embedded within expressions being
one. The other is a rather esoteric issue with clauses like
elif, else and except.

John Roth

Paul Prescod

Jul 18 '05 #14
al************@ comcast.net (A. Lloyd Flanagan) wrote in message news:<e8******* *************** ****@posting.go ogle.com>...
Li************@ yahoo.com (Daniel Ehrenberg) wrote in message news:<71******* *************** ***@posting.goo gle.com>...
Can anyone show me how to so much as alias "for" to "each" in Python
or allow block syntax at all without hacking the C source code?
I think the point is, why on earth would you want to do something like
that? If you want a language you can use to make programs that make
no sense to anyone but the author, Perl should be more than sufficient
for your needs.


The point is that implementing your own "for" is something you can't
do in Python very nicely, so it's a proof that Io can achieve
genuinely higher abstraction levels on this part. Implementing
"for" again with a new name probably wouldn't make anyone
happy, but such power opens a set of tricks and idioms to
be used in real code to solve real problems, that wouldn't
be possible in Python without kludgy syntax.

Here's a normal loop:

bar = 0
for x in range(10):
bar += x

Here's the same using a custom loop:

bar = [0]
def temp(x):
bar[0] += x
for_each(range( 10), temp)

That is just so damn ugly. I want to be able to define (e.g.)

bar = 0
for_each(x, range(10)):
bar += x

Now tell me which of these two lowermost forms looks
better and makes more sense? For examples that don't
just make aliases of existing syntax, see the
Lisp vs Python thread that was here a few months ago
(sorry, can't remember it's topic name).

BTW, Python can be used to make programs that make
no sense as well. (due to Ulf Bartelt:)

print (lambda Ru,Ro,Iu,Io,IM, Sx,Sy:reduce(la mbda x,y:x+y,map(lam bda y,
Iu=Iu,Io=Io,Ru= Ru,Ro=Ro,Sy=Sy, L=lambda yc,Iu=Iu,Io=Io, Ru=Ru,Ro=Ro,i=I M,
Sx=Sx,Sy=Sy:red uce(lambda x,y:x+y,map(lam bda x,xc=Ru,yc=yc,R u=Ru,Ro=Ro,
i=i,Sx=Sx,F=lam bda xc,yc,x,y,k,f=l ambda xc,yc,x,y,k,f:( k<=0)or (x*x+y*y=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+ yc,k-1,f):f(xc,yc,x, y,k,f):chr(

64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),r ange(Sx))):L(Iu +y*(Io-Iu)/Sy),range(Sy
))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24)

The real question is if the language *allows* a sensible
programmer to write clear, understandable code even in hard
problem domains.

But this is nothing but my humble opinion without actually
knowing anything about Io.. Maybe it isn't that good. I wasn't
really arguing for Io but for better abstractions.
Jul 18 '05 #15
John Roth wrote:
"Paul Prescod" <pa**@prescod.n et> wrote in message
news:ma******** *************** *************** *@python.org...
First, if I had invented Python I would not have bothered to buck the
trend of using curly braces.

I suppose I am hardly anyone else, since that it exactly what
attracted me to Python. In fact, I will take partial responsibility
for the indentaion syntax in IBM's ISPF mini-language - it's a
preferance of long standing with me.


There are certainly costs and benefits to the Python way. And we've been
over them many times. ;)

I'm just saying that from a language popularity point of view,
"different" is usually perceived as "worse" unless it is really vastly
better.

Paul Prescod

Jul 18 '05 #16
> If you've switch from Python to Io, what will you do with the answers
to these questions? Use them for good or evil? Will you switch back
from Io to Python?
--dang


If there are good enough responses, I'll use Python. I just wanted to
know a reason why Python is better. Also, these responses might be
used to make Io better (since it's a young language).

Daniel Ehrenberg
Jul 18 '05 #17
> I think the point is, why on earth would you want to do something like
that? If you want a language you can use to make programs that make
no sense to anyone but the author, Perl should be more than sufficient
for your needs.


Nobody uses Perl because they like its illegibility, they think (for
some reason) that it's more powerful.
As for the flexibility of Io, there's a big difference between
flexibility and illegibility. Whenever a new, more powerful
programming language comes out, everybody says it's too flexible.
Fortran people were saying that about C, C people were saying it about
C++ and Java, and C++ and Java people are still saying it about
Python. Dynamic typing? That's so error-prone, they say. Flexible
block syntax? Code is "illegible" , you say.

Daniel Ehrenberg
Jul 18 '05 #18
> If there are good enough responses, I'll use Python. I just wanted to
know a reason why Python is better. Also, these responses might be
used to make Io better (since it's a young language).

Daniel Ehrenberg


From your responses, you seem to prefer a /flexibility/ in IO syntax
and semantics that will never be attainable in Python.

Python isn't about allowing different syntax or semantics, it is about
having a reasonable set of syntax and semantics along with a reasonable
object, class, module and package structure, resulting in a language
that allows the vast majority of algorithms, data structures, and
/ideas/ to be implemented in a way that is both easy to write and to
understand.

I would say something similar about IO, but I don't know what it is
about (and I am too turned off by its syntax to find out).

Using metaphors; when you have a hammer, everything looks like a nail.
Me? I've got 3 hammers: Python, C/C++, Lisp. I have not yet met a nail
that wasn't properly pounded with my Python hammer. Nails:
data processing
databases
sockets (both async with asyncore and sync with threads)
gui development
data structure implementation
prototyping
etc.

Now, a few of those could easily be hammered with either C/C++ or Lisp,
but I wouldn't have been able to built the apartment complexes with
C/C++ or Lisp that I was able to with Python.
What you are asking us, conceptually, is what hammer you should use.
The hell if we care what hammer you use, we hang out here because /we/
enjoy using the Python hammer. Of course it would be nice for you to
use the Python hammer and give to the community, but I'm sure the IO
community feels the same way - so whatever you want, I'm sure it will be
fine.

- Josiah
Jul 18 '05 #19
Daniel Ehrenberg wrote:
Whenever a new, more powerful
programming language comes out, everybody says it's too flexible.
Fortran people were saying that about C, C people were saying it about
C++ and Java, ...


C people were saying that about Java?

Look, you like Io better than Python. Fine. You're not going to be
convincing others that you're right by simply repeating it over and over
again. Io and Python cater to different styles; if your personal style
is more in sync with Io, then so be it. But someone whose personal
style is more in sync with Python than Io is simply not going to be
swayed by your largely stylistic arguments.

--
__ Erik Max Francis && ma*@alcyone.com && http://www.alcyone.com/max/
/ \ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
\__/ I just want to create my own life. I can just be me.
-- Ekene Nwokoye
Jul 18 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8774
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9235
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.