LWN.net Logo

Evidence that Python is advancing into the enterprise (NewsForge)

Evidence that Python is advancing into the enterprise (NewsForge)

Posted Mar 30, 2005 1:36 UTC (Wed) by phgrenet (guest, #5979)
Parent article: Evidence that Python is advancing into the enterprise (NewsForge)

It is good that organizations look for programming languages one step higher than Java and C# in the programming language hierarchy. But why not look at the highest level? Lisp and Prolog are incomparable in terms of level of abstraction and productivity. They are also getting quite old, but the fundamendal ideas behind them are still valid. The object layer on top of Lisp, CLOS, is one of the most advanced OO language I have ever seen (beats even Eiffel).


(Log in to post comments)

OO is yesterday's news.

Posted Mar 30, 2005 6:12 UTC (Wed) by ncm (subscriber, #165) [Link]

"Object-oriented" is far less interesting than the hypesters of the '90s would have liked for you to believe, and than the Smalltalk/Java/CLOS crowd evidently did. C++ graduated from OO well before the hype peaked, and forged ahead in a different direction. Presumably the other languages will get around to chasing it again; Java "generics" are a faint-hearted effort that way, more like Ada than anything powerful.

Of course the MLs started out way ahead, but all the ML variants I know of are saddled with all manner of built-in gook like GC and lists, and can't support doing those same things from scratch in a library instead. Give me an ML with destructors and restricted pointers, and I will move the world!

OO is yesterday's news.

Posted Mar 30, 2005 9:51 UTC (Wed) by khim (subscriber, #9252) [Link]

Give me an ML with destructors and restricted pointers, and I will move the world!

Hmm. Is it good idea to ask for impossible before you'll do something ? Any language with destructors is inherently unsafe - and this is not a case of "noone did it yet" but a case of "it's mathematically proven to be impossible". Sorry, but you are out of luck.

It's possible to introduce some forms of "limited destructors" which will be called in some cases but in other cases stuff will be discarded silently, but in the end it only makes programming more cumbersome and error-prone. Python, Java and C# all have GC and no destructors - and this is good thing(tm): this means they have at least a chance.

C#/Java have destructors...

Posted Mar 30, 2005 10:57 UTC (Wed) by pkolloch (subscriber, #21709) [Link]

...but there are only guarantees to when they are not called. (Well, I have to admit that I have not dug deeply into this explicit GC control, but that's probably out of scope. In some circumstances even (managed) C# might even make some guarantees.)

In C#:

~TypeName() { ... }
In Java:
protected void finalize() throws Throwable() {...}

While I agree that you should not use that in pure managed code, it might make a lot of sense in wrappers to native code which allocates resources (which you want to deallocate automatically). In C# 2.0 you can even specify some kind of implicit cost for classes to provide meaningful heuristics for this case.

C#/Java have destructors...

Posted Mar 30, 2005 11:48 UTC (Wed) by phgrenet (guest, #5979) [Link]

I think one problem with Java and C# is that they only allow allocation of objects on the heap. If you can allocate your object on the stack then there is no need to control what the GC is doing because you know exactly when the object will be deallocated. C++ and Lisp give you that choice.

C#/Java have destructors...

Posted Mar 30, 2005 13:44 UTC (Wed) by TImaniac (guest, #28862) [Link]

In C# you can allocate a struct on the stack instead of the heap : this struct are value-types but inherit from Object.
if you need temporary stack memory, there is also a stackalloc keyword.

C#/Java have destructors...

Posted Mar 30, 2005 14:58 UTC (Wed) by cajal (guest, #4167) [Link]

Some JVMs can allocate objects on the stack. There is much research into this area (google for "escape analysis"). But there's no word as to when Sun's JDK will support it.

destructors considered harmful?

Posted Mar 31, 2005 1:21 UTC (Thu) by xoddam (subscriber, #2322) [Link]

> Hmm. Is it good idea to ask for impossible before you'll do something ?
> Any language with destructors is inherently unsafe - and this is not a
> case of "noone did it yet" but a case of "it's mathematically proven to
> be impossible". Sorry, but you are out of luck.

Can you substantiate this? A Google search for "destructors considered
harmful" turns up no hits (this morning) :-)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds