Lambda the Ultimate

inactiveTopic Python Scripting Everywhere
started 12/4/2003; 1:31:17 PM - last post 12/7/2003; 9:15:14 AM
Ehud Lamm - Python Scripting Everywhere  blueArrow
12/4/2003; 1:31:17 PM (reads: 8813, responses: 27)
Python Scripting Everywhere
(via Daily Python-URL ==> Jeremy Hylton)

Here are some software projects for which I'm prepared to pay a bounty... My budget for these bounties in 2004 is USD 100,000...

I'm open to requests for funding work that needs to be done to make Python the most widespread common scripting language on the net.

And they say LtU links are of no practical use?! $100,000 - now that's real money!

Among the systems mentioned are OpenOffice, Blender, AbiWord, Gnumeric and The GIMP.

Now, personally, I prefer DSLs, but no one seems to be funding those...

I have a feeling that any work towards a Python object-model for scripting a given appilcation could be directly translated into a Javascript object-model. What do you guys think?


Posted to Python by Ehud Lamm on 12/4/03; 1:34:52 PM

DocOlczyk - Re: Python Scripting Everywhere  blueArrow
12/4/2003; 2:29:08 PM (reads: 1117, responses: 2)
Before I start my main thrust, I should point out that this person's judgement is very suspect. Me believes that "Mozilla and its children are a phenomenal platform".

Now onto the main point...

If he really wants to make Python the "most widespread common scripting language ", then he should pay Guido to take out "whitespace as defining blocks" feature, and replace it with begin/end,(),[],{.} or whatever other delimters.

Disclaimer: This is not an argument for or against "whitespace defining blocks". ( Though I do personally hate it. ) It is an observation that if all the people who do not use Python solely for that reason, were to start using Python, then it would become the most popular language ( not just scripting language ).

Adam Vandenberg - Re: Python Scripting Everywhere  blueArrow
12/4/2003; 4:01:06 PM (reads: 1080, responses: 0)
Python with braces would be like, uh, Javascript with a useful class library.

Patrick Logan - Re: Python Scripting Everywhere  blueArrow
12/4/2003; 5:35:35 PM (reads: 1053, responses: 0)
Python with braces would be like, uh, Javascript with a useful class library.

ROTFLOL

Chris - Re: Python Scripting Everywhere  blueArrow
12/4/2003; 9:02:45 PM (reads: 1018, responses: 0)
I've felt that why for a long time. The only major difference between Python and JavaScript is the whitespace! JavaScript is a bit of a Frankenstein language, but it is pretty decent. Python is not nearly as elegant as its proponents like to boast. Python is 10+ years old and has plenty of baggage.

Patrick Logan - Re: Python Scripting Everywhere  blueArrow
12/4/2003; 9:31:04 PM (reads: 1016, responses: 0)
Python is not nearly as elegant as its proponents like to boast.

Elegance is one attribute I would not associate with Python. And yet, Python remains simple.

That is how we proclaim the mystery of our faith.

Dominic Fox - Re: Python Scripting Everywhere  blueArrow
12/5/2003; 3:07:38 AM (reads: 957, responses: 0)

Python's reached the stage, in terms of cruft and baggage (for the sake of backwards compatibility), where if you want "elegance" you have to choose a subset of the language and use it consistently - it's a bit like Perl in that respect, although the pathology is not quite so advanced.

andrew cooke - Re: Python Scripting Everywhere  blueArrow
12/5/2003; 6:42:16 AM (reads: 911, responses: 1)
It's funny that no-one complains about white space in Haskell. Is it that the parsing in Haskell is more sophisticated, or is it something to do with the people using it, or is it that Haskell provides an alternative (I believe - although I've never seen it used)?

Ralph Richard Cook - Re: Python Scripting Everywhere  blueArrow
12/5/2003; 7:16:13 AM (reads: 898, responses: 1)
It's funny that no-one complains about white space in Haskell.
That's probably because the complaints are drowned out by people saying "Haskell? Huh? What's that?"
But seriously, folks, anyone needing a pure, lazy functional language isn't going to be put off by whitespace. If I dare use a PaulGrahamism, Haskell is a "Language for Smart People", while Python is a "Language for The Masses". "The Masses" would be the ones complaining about whitespace.

Dominic Fox - Re: Python Scripting Everywhere  blueArrow
12/5/2003; 7:50:02 AM (reads: 894, responses: 0)

Some smart people might complain about whitespace on the grounds that it's dumb (Eric Raymond said it initially made him think of COBOL, although he warmed to the language later on).

I don't have a problem with Python's use of white space myself. Would a novice programmer (syntax-virgin / tabula rasa) looking to do some "scripting" to make an OpenOffice "macro" necessarily be happier with curly braces? I have a feeling they're something you get a taste for by programming in a curly-braced language.

Frank Atanassow - Re: Python Scripting Everywhere  blueArrow
12/5/2003; 8:04:17 AM (reads: 885, responses: 0)
That's probably because the complaints are drowned out by people saying "Haskell? Huh? What's that?"

It might also be because, unlike Python, Haskell provides a mechanism to nullify the offside rule:

do x <- fetch ref
   put ref (x+1)
return 666

is the same as:

do { x <- fetch ref; put ref (x+1); return 666 }

Erik Meijer writes all his Haskell code in the latter style... well, he used to. I don't think he uses Haskell anymore. :(

Matt Hellige - Re: Python Scripting Everywhere  blueArrow
12/5/2003; 8:11:17 AM (reads: 892, responses: 0)
It's funny that no-one complains about white space in Haskell. Is it that the parsing in Haskell is more sophisticated, or is it something to do with the people using it, or is it that Haskell provides an alternative (I believe - although I've never seen it used)?

Actually, people complain about the layout rules pretty regularly on the haskell lists (sorry, I don't have time to find references). Haskell does provide an alternative, and there are a fair number of people who use that style exclusively. This doesn't satisfy everyone, of course, but it seems to do pretty well.

Personally, I think the Haskell layout rules are a bit complicated and rather unnecessary...

Ehud Lamm - Re: Python Scripting Everywhere  blueArrow
12/6/2003; 1:58:04 AM (reads: 745, responses: 3)
It seems there's a wide agreement that as languages go, there's no great difference between Javascript and Python.

Let's turn out attention to the more general question of scripting. The approach at the heart of `Python Scripting Everywhere` seems to be similar to the approach Microsoft is taking with their scripting efforts: expose domain-specific objects (DSOs) and use a general purpose scripting language, instead of designing separate domain specific languages (DSLs) for each application.

DSOs have some obvoius advantages: Maximize ROI from language implementations, multiple language support for each application (e.g, VBScript and JScript), shorter learning curve, multiple application scripting from inside onw script becomes possible.

Yet, one has to wonder whether the fact that you don't supply a DSL, with application specific language constructs hurts expressiveness badly enough to have impact on usability (esp. for end-users), expressive power (e.g., when and where can you plug in your scripts), abstraction level etc.

It's easy to understand why DSOs are becoming so widespread as opposed to DSLs. What are your thoughts on this trend?

Sjoerd Visscher - Re: Python Scripting Everywhere  blueArrow
12/6/2003; 5:55:56 AM (reads: 736, responses: 0)
I think Microsoft is on the right track by prividing DSOs instead of DSLs. That's because most functionality within one domain is already built by Microsoft, with a special graphical interface. (You could call that DSLs too, btw).

When you need scripting it is almost always because you need to combine functionality from several domains. It's hard to create DSLs that can be combined. OTOH it's easy to combine DSOs, because they use the modularity functionality from the scripting language.

Patrick Logan - Re: Python Scripting Everywhere  blueArrow
12/6/2003; 7:48:13 AM (reads: 727, responses: 1)
impact on usability (esp. for end-users)

Has MSFT ever given much thought to end user scripting? Excel, yes, but that was a copy of 1-2-3. VB? Kind of, at least pre-VB.6.

Maybe there are other examples, but nothing with the impact of Hypercard.

Come to think of it, who *has* ever given much thought to end user scripting?

Patrick Logan - Re: Python Scripting Everywhere  blueArrow
12/6/2003; 7:51:34 AM (reads: 703, responses: 1)
I think DSO has to come before DSL for a platform. There should be opportunities for the right DSL to emerge. The DSO by default is going to be expressed in the platform way, e.g. COM or dotnet for MSFT.

Ehud Lamm - Re: Python Scripting Everywhere  blueArrow
12/6/2003; 7:57:21 AM (reads: 717, responses: 0)
Come to think of it, who *has* ever given much thought to end user scripting?

Hardly anyone. In fact, it is hard to get even the LtU readership interested in this. Perhaps decades of disappointment made people weary.

Ehud Lamm - Re: Python Scripting Everywhere  blueArrow
12/6/2003; 8:07:47 AM (reads: 705, responses: 0)
In a sense DSOs are about vocabulary, where as DSLs can add grammer and appropriate semantics.

It's not that I disagree with Patrick and Sjoerd, but I am disheartend that the implication from what we are saying is that there's not much to language design beyond specifying a relevant vocabulary.

Sjoerd Visscher - Re: Python Scripting Everywhere  blueArrow
12/6/2003; 10:54:31 AM (reads: 682, responses: 2)
It's well known any program can be rewritten in almost any other programming language. So providing DSOs is sufficient for the task.

I use Javascript for most of my projects. Javascript even requires DSOs to do anything useful at all. Javascript is more than sufficient, but far from ideal. That's why I'm designing Loell.

But I don't like the idea of DSLs. Creating a language only for one domain seems like a waste. I'd prefer domain inspired language features. (That's probably how languages evolve most of the time) I don't think there are domain specific language features that aren't useful in other domains.

Dan Shappir - Re: Python Scripting Everywhere  blueArrow
12/7/2003; 7:21:10 AM (reads: 611, responses: 1)
I can think of at least one instance where the DSL approach has defeated DSOs hands down: DOS BATCH files. For several years now Microsoft has been promoting the use of the Windows Scripting Host (WSH), using VBScript or JavaScript, as the preferred method for scripting Windows. WSH implements a very large set of DSOs for interacting with the OS. Moreover it's relatively easy to script COM automation compliant applications from such scripts.

Despite this I believe most administrators continue to use DOS BATCH files to script Windows. In can think of several reasons for this:

  1. In most cases directory/file access and the ability to specify command line arguments and environment variables is quit enough.
  2. Likewise, the DOS BATCH flow control structures although very simplistic are usually enough. In fact, I'd imagine some admins may find the VBScript/JavaScript flow control structures intimidating.
  3. Activating an external applications using WSH DSOs is a lot more complicated than simply typing them out in the DOS BATCH DSL.
  4. Even with .bat files you can achieve quit a lot using piping. To implement piping with WSH you may need to resort to embedding that DSL in strings.

Add to all this the fact that Microsoft never provided a development environment for sys admins for constructing WSH scripts.

Steven Shaw - Re: Python Scripting Everywhere  blueArrow
12/7/2003; 7:37:38 AM (reads: 591, responses: 2)
> It seems there's a wide agreement that as languages go, there's no > great difference between Javascript and Python.

Aren't there some important differences? What about Python is class-based whereas Javascript is prototype-based (unless were talking JavaScript 2.0).

Other language features that I don't think Javascript has:

* yield * list comprehensions * keyword arguments?

Ehud Lamm - Re: Python Scripting Everywhere  blueArrow
12/7/2003; 7:54:03 AM (reads: 586, responses: 0)
Oh, the languages are different that's for sure. I just meant differences that are relevant to our discussion of scripting and application-specific scripting.

Ehud Lamm - Re: Python Scripting Everywhere  blueArrow
12/7/2003; 7:59:38 AM (reads: 591, responses: 0)
most administrators continue to use DOS BATCH files to script Windows.

We'll have to see how Monad succeeds in working around the issues you mentioned.

Dan Shappir - Re: Python Scripting Everywhere  blueArrow
12/7/2003; 8:10:11 AM (reads: 581, responses: 0)
> Other language features that I don't think Javascript has:

Perhaps JavaScript doesn't have but JavaScript with BeyondJS (A library written in JavaScript by Sjoerd Visscher and myself) adds all of the stuff you mention, and much much more:

> yield

BeyondJS implements lazy lists that are modeled after Haskell. A superior alternative to yield IMO.

> list comprehensions

Is this good enough:

var sum = (1).to(10).fold("+");

> keyword arguments

BeyondJS provides numerous currying methods that exceed the number of those provided by any other PL I'm familiar with.

Dan Shappir - Re: Python Scripting Everywhere  blueArrow
12/7/2003; 8:22:47 AM (reads: 562, responses: 3)
Funny thing is we already have Javascripting everywhere and nobody seems to care.

Ehud Lamm - Re: Python Scripting Everywhere  blueArrow
12/7/2003; 8:34:20 AM (reads: 566, responses: 2)
Funny thing is we already have Javascripting everywhere and nobody seems to care.

Right. Because this amounts to the Turing Tar-Pit (in which everything is possible but nothing of interest is easy). You see, this is the difference between DSOs and DSLs. The issue is whether exposing DSOs makes programming interesting things easy enough, or whether higher-level programming constructs are needed.

Worse, even if you have DSOs, they are often not at the level you really need. For example suppose I want to write a script that processes a web page (say a bookmarklet). Javascript gives me the DOM, but this is not the level I want to think at. I want DSOs that convey application-level abstractions (e.g., I want an object implementing a discussion group message, not a cell of a table nested inside another table, in the second DIV on the page). Now I want to be able to write code that applies to all messages without struggling to get at them out etc. And all that, before I even begin to invent declarative constructs relevant to the kinds of scripts I am mostly interested in.

Dan Shappir - Re: Python Scripting Everywhere  blueArrow
12/7/2003; 9:07:05 AM (reads: 571, responses: 1)
In other words, you want XML with a schema instead of the browser DOM. And indeed, JavaScript does not intrinsically provide either. Complaining about the lack of a specific DSO is not equivalent to stating that DSLs are better.

Speaking of XML and JavaScript, remember E4X, BEA's DSL for XML on top of JavaScript. Apparently they agree that a DSO is not enough.

Ehud Lamm - Re: Python Scripting Everywhere  blueArrow
12/7/2003; 9:15:14 AM (reads: 587, responses: 0)
Complaining about the lack of a specific DSO is not equivalent to stating that DSLs are better.

Of course. Whatever made you think that I have only one complaint up my sleeve?