tomtomorrow has asked for the wisdom of the Perl Monks concerning the following question:

Hello world, is this a new idea?

I want to learn at least one scripting language, perl, php, python, etc. I lean towards perl. As I mull my jump into _Learning Perl_ after compiling my first program in the nedit editor I have several thoughts.

The arguments for python include its visual beauty. My own eyes tell me enough to understand the joke about the camel as perl's symbol.

Is there any program out their that can provide an extra layer of interpretation between the human and the language.

What about a program or an extended editor with a "prettyperl", "prettierperl", or "perljam" (sweetened to help it go down) interpretor. It simply lets the user define what terms they want to type in all day and then interprets their terms into the perl language. This could be a general tool for any language.

Abbreviated terms could be given an actual English word. One-character symbols/operators could be assigned a word.

And vice-versa. Python could be abbreviated to be as compact and indecipherable to the untrained eye as perl.

If a word in the standard language is nonintuitive to a user, they can define a new word. Who cares if they don't think in standard perl as long as they can also translate from standard perl into their own language?

The source could be distributed and, of course, would run in its standard perl form, so noone is the wiser.

This leads to interesting possibilities, some more practical than others. I'd like to read the discussion on this. If you have a great lead or want to work on this idea, please email me, too.

Replies are listed 'Best First'.
Re: Universal Translator
by thor (Priest) on Dec 08, 2004 at 01:19 UTC
    Well, you've certainly asked for a lot. First things first: making perl pretty. Well, perltidy does a pretty good job in my opinion.
    Abbreviated terms could be given an actual English word. One-character symbols/operators could be assigned a word.
    perldoc English ;)

    Also of help here are editor features. Vim has "abbreviations" which allow you to type one thing and another pops out. It's as easy as ":ab <before> <after>". Of course, this assumes that you fancy vi-like editors. I can't imagine that vi is the only editor to have this feature though. But, as long as we're on the subject of vim (and who doesn't like a good editor flamewar?), I find that it is a pretty good Perl development environment. Between syntax highlighting, automatic indentation, and code folding, I do alright by it.

    thor

    Feel the white light, the light within
    Be your own disciple, fan the sparks of will
    For all of us waiting, your kingdom will come

      Of course emacs has abbreviations, too :-)
        I can't imagine that vi is the only editor to have this feature though.
        --me (from op) :-)

        thor

        Feel the white light, the light within
        Be your own disciple, fan the sparks of will
        For all of us waiting, your kingdom will come

Re: Universal Translator
by dimar (Curate) on Dec 08, 2004 at 03:17 UTC

    One path to consider along these lines is the concept of "functional pseudocode" ... an intermediate language that can be translated into native idioms for whatever programming language you want.

    If you are familiar with "Esperanto" then you have a general idea by what I mean when i say "functional pseudocode." If you are not familiar with Esperanto, it is a human-invented language that is intended to be an easy 'intermediate' language that anyone can learn, and translate into their own 'native' language.

    I have toyed with this kind of thing in the programming language arena, and it sounds similar to what you are talking about. In theory, it sounds like a promising idea, but as you probably have noticed, there are some practical limitations.

    Perhaps the biggest limitation is that if you want to invent 'functional pseudocode' what you are doing, in effect, is inventing your own programming language, and people can be very parochial when it comes to what programming languages they use, and in what circumstances (if they know more than one) ... it's the same with human language.

    Having said that, there are some advantages to this kind of approach. Just as with human languages, your horizons and understanding can expand considerably if you become 'fluent' in more than one. The thing I like about perl is that it is amenable to many many different 'dialects' ... and thus is a good starting point if you want to explore this kind of thing further.

      If you look at it that way aren't all the languages serving that role? They keep us from being Mel and writing 1s and 0s directly. :-P

      --
      I'm not belgian but I play one on TV.

Re: Universal Translator
by sgifford (Prior) on Dec 08, 2004 at 01:18 UTC
    Read the perlfilter(1) manpage; source filters are designed to do exactly this sort of thing.