State of the Onion

http://www.gcn.com/online/vol1_no1/46724-1.html

Just thought you’d like to know. :wink:

M. Edward (Ed) Borasky
ruby-perspectives.blogspot.com

“A mathematician is a machine for turning coffee into theorems.” –
Alfréd Rényi via Paul Erdős

M. Edward (Ed) Borasky wrote:

http://www.gcn.com/online/vol1_no1/46724-1.html

Just thought you’d like to know. :wink:

Larry Wall will cure cancer!!

“For power users of this open source language, such extensibility could
mean
that they will be able to augment the language with instructions,
syntax,
expressions, operators and other features to meet their own needs. An
office of
the National Cancer Institute, for instance, could extend Perl to
include
features that could aid in medical research.”

Like they couldn’t have just gone with “an automobile tire distributor
could
extend Perl to include features that could aid in distributing tires”…

And - just think! - O’Reilly will let anyone into their little clich, if
they
exhibit sufficient delusions of godhood.

Now excuse me while I get back to extending Ruby in application-specific
ways…

On Tue, 2008-08-05 at 11:43 +0900, Phlip wrote:

expressions, operators and other features to meet their own needs. An office of
the National Cancer Institute, for instance, could extend Perl to include
features that could aid in medical research."

Like they couldn’t have just gone with “an automobile tire distributor could
extend Perl to include features that could aid in distributing tires”…

And - just think! - O’Reilly will let anyone into their little clich, if they
exhibit sufficient delusions of godhood.

My sediments exactly. “Version 6 of the Perl will be the first truly
extensible programming language, promised Perl creator Larry Wall”. Uh
huh … it won’t be the first Turing complete language, it won’t be the
first macro-rewriting language, it won’t be the first language with
features to exploit concurrency, or vectorization, etc. And it won’t be
Perl, either. :slight_smile:

Now excuse me while I get back to extending Ruby in application-specific ways…

Well … OK … just don’t expect Larry Wall to care. :wink:


M. Edward (Ed) Borasky
ruby-perspectives.blogspot.com

“A mathematician is a machine for turning coffee into theorems.” –
Alfréd Rényi via Paul Erdős

On Mon, Aug 4, 2008 at 11:03 PM, David M. [email protected]
wrote:

Has anyone actually done the equivalent of Acme::Lingua::Pirate::Perl for
Ruby? If so, how much work was it? How hackish was it?

http://code.stonecode.org/pruby/

Enjoy :slight_smile:

-geg

On Mon, Aug 4, 2008 at 11:09 PM, Gregory B.
[email protected] wrote:

On Mon, Aug 4, 2008 at 11:03 PM, David M. [email protected] wrote:

Has anyone actually done the equivalent of Acme::Lingua::Pirate::Perl for
Ruby? If so, how much work was it? How hackish was it?

http://code.stonecode.org/pruby/

Oh, to be fair, this doesn’t really work the way Lingua does, because
it doesn’t really modify syntax. But… it does bring pirate joy to
Ruby. :wink:

On Monday 04 August 2008 21:43:35 Phlip wrote:

Now excuse me while I get back to extending Ruby in application-specific
ways…

Ruby is, indeed, the best way to do that now. And Perl6 has been coming
for,
what, eight years? I’m not holding my breath…

That said, if I understand this, it would involve actual changes to the
parser. Can’t really do that in Ruby – or at least, not without
recompiling
Ruby.

Has anyone actually done the equivalent of Acme::Lingua::Pirate::Perl
for
Ruby? If so, how much work was it? How hackish was it?

On Tue, 2008-08-05 at 11:05 +0900, M. Edward (Ed) Borasky wrote:

http://www.gcn.com/online/vol1_no1/46724-1.html
Just thought you’d like to know. :wink:

So Larry Wall has reinvented Lisp without Lisp’s minimalist elegance?
Dylan did it first, but at least it had the decency to call itself a
Lisp dialect.

Greenspun was proven right. Again.

David M. wrote:

Ruby.
Can you say “Job Security” boys and girls?

Yes, I thought you could.

Dan

David M. wrote:

Has anyone actually done the equivalent of Acme::Lingua::Pirate::Perl for
Ruby? If so, how much work was it? How hackish was it?

I’m not familiar with Acme::…, but the right answer for Ruby
is to use a composable grammar for its compiler (such as, but
not necessarily, the ones emitted by Treetop), and then to
simply support the “grammar” block ala Treetop where you can
define new syntax rules. Any time a new grammar rule fires,
the syntax may include as much or as little of the general
Ruby syntax as the rules decide to call. When a grammar rule
replaces a built-in one, it’s able to use “super” to call the
original rule, as in Treetop… If you can also associate a
grammar rule as thej top rule of a filetype extension for a
file loaded from require (the way my Polyglot gem does), you
can require files in any language for which you have a grammar.

This is an amazingly powerful concept… someone will do it
sooner or later.

Clifford H…

On Monday 04 August 2008 22:58:36 Clifford H. wrote:

I’m not familiar with Acme::…

For what it’s worth, this isn’t really about Acme, it’s just the best
example
I could think of for Lingua, which can munge syntax (somewhat).

Acme is actually a Perl library for “fun” stuff, most of which is just
silly,
but sometimes, they do sort of serve as an example of whatever they’re
demonstrating. The two that I’ve noticed:

Acme::Lingua::Pirate::Perl – you can write Perl in the Pirate language
Acme::POE::Knee – ponie races written for POE, the Perl Object
Environment
(similar, I’d guess, to eventmachine)

Of course, you’ll find all sorts of stuff. Usually high quality,
well-documented, and mostly useless:

use Acme::Drunk;

my $bac = drunk(
                gender         => MALE, # or FEMALE
                hours          => 2,    # since start of binge
                body_weight    => 160,  # in lbs
                alcohol_weight => 3,    # oz of alcohol
               );

$bac >= 0.08 ? call_cab() : walk_home();

On Mon, Aug 4, 2008 at 8:48 PM, Michael T. Richter
[email protected] wrote:

Greenspun was proven right. Again.
I don’t understand this hostility to perl6, which (discounting its
current lack of completion) looks like a very exciting language. Sure,
lisp lets you have arbitrary reader macros, but it looks like perl6
will make syntactic extension a lot more accessible than any of the
lisp dialects I’ve seen. Also, while lisp can be twisted into
arbitrary syntaxes, it goes against the grain of the language and the
culture. I’d like to see it done right (camlp4 and nemerle are two
interesting experiments in that direction, but perl6 promises to be
better than either of them)

martin

On Monday 04 August 2008 22:25:35 Daniel B. wrote:

Can you say “Job Security” boys and girls?

Ruby is already flexible enough to cause that problem – or have that
benefit,
depending on your point of view.

There just seems to be a general consensus that DSLs can work, if used
judiciously. No one seems to have a problem with, say, Sinatra:

get ‘/’ do
‘Hello, world!’
end

The only change here, I think, is that we can now do things like:

get /
‘Hello, world!’
end

Or, for the more Python-inclined, drop the ‘end’. And that’s a very
basic
example – wouldn’t it be nice if, when configured to use Haml as a
templating language, we could do:

get /
%h1.greeting
Hello, world!

Ok, probably a bad idea to make this the default, as in this example,
but you
get the idea. Markaby is a cool concept, but at the end of the day, Haml
just
feels cleaner. It also makes the point for very tightly-defined DSLs
with
very odd syntax – and this happens anyway, with Haml, whether or not
Ruby
makes it easy.

I do see a point for Ruby’s approach, though, in that I can get reliable
editor coloring, and I can, at a glance, and without reading
documentation,
have an indication of what’s going on – at which things are part of the
app,
which are part of the framework, and which are part of the language.

On Mon, Aug 4, 2008 at 11:43 PM, Michael T. Richter
[email protected] wrote:

Like hierarchical file systems, which some have seriously tried to claim
were introduced by UNIX. Or devices in the file name space.

Admitted, but it’s more a fault of the language proponents than of the
language itself. I don’t really have a dog in this fight; it just
saddens me to see Perl6 being dismissed for social rather than
technical reasons.

“accessible” than I am here?
Yes - I’m talking about a macro system, grammar engine or whatever
that helps you get over the impedance mismatch between the language’s
base syntax and your embedded dsl’s syntax. Writing macros in lisp is
trivial as long as your macros have a superficial syntactic
resemblance to lisp code. It looks like Perl 6 will go beyond that.

martin

On Tue, 2008-08-05 at 15:17 +0900, Martin DeMello wrote:

I don’t understand this hostility to perl6, which (discounting its
current lack of completion) looks like a very exciting language.

Discounting the thing that engenders the most hostility, you’re still
left with claims like "the first language to do " despite the list
of almost antique languages that do for pretty much any value of
that is claimed. It’s kind of like the hostility UNIX addicts
generated when the clueless claimed a series of firsts for it that
were … well, not first. Like hierarchical file systems, which some
have seriously tried to claim were introduced by UNIX. Or devices in
the file name space.

Sure,
lisp lets you have arbitrary reader macros, but it looks like perl6
will make syntactic extension a lot more accessible than any of the
lisp dialects I’ve seen.

How much more accessible than, say, a Scheme hygienic macro do you want?
Seriously, writing macros in the Lisps is trivial. (Writing them in
Dylan was a bit of a pain in the ass because of the impedance mismatch
between the Lisp-like macro architecture and the Algol-like language
syntax, but even there it was still accessible.) Are you using a
different definition for “accessible” than I am here?

David M. wrote:

Ruby.

Has anyone actually done the equivalent of Acme::Lingua::Pirate::Perl for
Ruby? If so, how much work was it? How hackish was it?

The joke: Flaming O’Reilly for letting anyone into the clich…

…then following up with my sig, with a link to my membership in the
O’Reilly
frat…

…describing a module I wrote in Ruby that gets inside the parser and
extends it:

O'Reilly Media - Technology and Business Training

No, I don’t expect O’Reilly to go out and build conferences to revolve
around
me. Maybe if I filled my source up with gratuitously self-serving
Tolkien quotes…

On Tue, 2008-08-05 at 15:52 +0900, Martin DeMello wrote:

Discounting the thing that engenders the most hostility, you’re still left
with claims like "the first language to do " despite the list of almost
antique languages that do for pretty much any value of that is
claimed. It’s kind of like the hostility UNIX addicts generated when the
clueless claimed a series of firsts for it that were … well, not first.
Like hierarchical file systems, which some have seriously tried to claim
were introduced by UNIX. Or devices in the file name space.

Admitted, but it’s more a fault of the language proponents than of the
language itself. I don’t really have a dog in this fight; it just
saddens me to see Perl6 being dismissed for social rather than
technical reasons.

Things are frequently dismissed for social over technical reasons.
Lisp, for example, is something I dismissed not for technical reasons (I
think the language is seriously one of the best ever made) but for
social reasons. I find the community around Lisp to be one of the least
approachable and least friendly I’ve ever encountered. This is also one
of the reasons I switched from the Python world to the Ruby world. The
Python community was getting pretty damned hostile toward the end of my
stay there (and not toward me, but rather toward the absolutely vital
new blood that’s needed for any community to stay alive) while the Ruby
community was, at the time, the friendliest I’d seen in years. (This is
changing slowly, but for now it’s still more than adequately friendly.)

This sounds irrational, but bear with me a moment. No technology is so
good that it can be instantly comprehended and put to its best use.
There’s always a learning curve associated with a piece of technology.
You need a community of users that mutually help and that are willing to
help the newly-arrived for that technology to be useful when you’re the
new arrival. Further, if you’re the old-timer, you need those new
arrivals to keep the blood fresh and the ideas hopping. You need the
naive, stupid questions that tear at the very foundations of what you
believe so that somewhere, sometime, a new cool idea pops forth.
Stagnant, inbred communities (like Lisp’s when I looked at it last) lead
to stagnant, inflexible and increasingly irrelevant languages (like
Lisp, last I looked). Vibrant, welcoming communities (like Ruby’s, for
the most part) lead to vibrant, hopping languages (like Ruby, for the
most part). Purely social forces trump technical superiority (and make
no mistake: I think Lisp is technically far superior to Ruby!).

Now addressing the topic of Perl6, the social problem of its proponents
claiming firsts that aren’t leads me to some… suspicions. Suspicions
that these people implementing this
latest-greatest-language-to-end-all-languages haven’t actually, you
know, kept up on what other languages do. Like the fact that Lisp had
features for making DSLs that most languages even today (and yes, I
include Ruby here!) still can’t match. Despite Lisp having been around
since the '50s. What’s happening here is that the technical chops of
the people advocating the language are now suspect. Have they seen the
other languages (note the plural!) that have permitted extensions? Have
they investigated how those worked? Do they understand the weaknesses
and the strengths of various approaches (note the plural!) to the
puzzle? When they’re claiming that they’re the first, it calls all of
that into doubt.

I’m going to adopt a “wait and see” approach to Perl6, mostly, but so
far… I’m not convinced.

Yes - I’m talking about a macro system, grammar engine or whatever
that helps you get over the impedance mismatch between the language’s
base syntax and your embedded dsl’s syntax. Writing macros in lisp is
trivial as long as your macros have a superficial syntactic
resemblance to lisp code. It looks like Perl 6 will go beyond that.

So it will be like Dylan’s? One of the canonical examples of a DSL in
Dylan was a scheduling macro that allowed you to write what looked very
much like a textual schedule that was actually code. The macro was a
bit hairy, but no moreso than your average Perl program (and, amazingly,
looked an awful lot less like executable line noise than a normal Perl
program does).

David M. wrote:

On Monday 04 August 2008 22:25:35 Daniel B. wrote:

Can you say “Job Security” boys and girls?

Ruby is already flexible enough to cause that problem – or have that benefit,
depending on your point of view.

Except that there’s no parser alteration required. Tell me, how do you
plan to deploy and maintain applications with altered parsers in the
long term?

Dan

Martin DeMello wrote:

I don’t understand this hostility to perl6, which (discounting its
current lack of completion) looks like a very exciting language.

Maybe a parallel here is Steve Job’s ability to indoctrinate huge crowds
of
technocrats into his cult. When I am forced to use a Mac…

  • I never know what the Home or End keys will do next
  • the backspace key is called “Delete”
  • I can’t find the on-off button in the dark
  • I must use a mouse to get out of many bogus situations
  • then I must click twice on a window to use it
  • a program’s menu bar can be on a different screen from the main
    window
  • Alt-Tab can show but can’t raise minimized applications
  • only Graphic-Backtick can rotate between windows within one
    application
  • Graphic-Backtick rotates by pushing the current window to the bottom
  • the desktop wallpaper changes if we reorder the screens
  • we get a horrific lockup if we turn one monitor vertical
  • not all dialogs dismiss with Escape
  • the mouse pretends to not have 3 buttons
  • the middle button wears out easily!

All this won’t stop conference organizers from promoting Jobs as “God’s
Gift to
Usability”…

Admitted, but it’s more a fault of the language proponents than of the
language itself. I don’t really have a dog in this fight; it just
saddens me to see Perl6 being dismissed for social rather than
technical reasons.

I will quote “Peopleware” by Tom DeMarco and Timothy Lister here:

“The major problems of our work are not so much technological as
sociological in nature.”

They claim this is true almost for all the failed projects.

Regards,
Rimantas

On Tue, Aug 5, 2008 at 6:25 AM, Daniel B. [email protected]
wrote:

Except that there’s no parser alteration required. Tell me, how do you plan
to deploy and maintain applications with altered parsers in the long term?

The grammar will be part of the source tree. camlp4
(http://pauillac.inria.fr/camlp4/) solves this problem already.

martin