In honor of the opening of the first Lord of the Rings Movie, let me introduce to y'all:

The BURL programming language.

BURL is based on perl -- in fact, it is a subset of perl, written with the Orc-programmer in mind. As such, control structures use Orkish or Black Speech instead of English; also, the rules of the scripting language are more constrained than perl. In fact, they are constrained to a format which is quite amenable to line-substitution translation into perl, strangely enough.

The most striking feature of BURL (aside from its use of Black Speech, of course) is the lopsided block delimiters nar! and sha!, which only terminate a block. BURL assumes that control structures begin all blocks (horrors!); however, there might be some kind of do{} block in Orkish. Maybe someone who knows BURL better could shed some light on that and other features. For instance, I suspect that split() in BURL makes more assumptions than perl, and it is possible that there is a vast set of 'default variables' that functions operate on.

So, without further ado, here are some examples of BURL's control structures and a simple example script.

for and foreach: ûr LIST-or-C-FOR-EXPR ...statements... nar! # (or sha!) if: gâkh EXPR ... statements ... ghâsh ELSIF-EXPR ... statements ... ghâsh ELSIF-EXPR ... statements ... ash ... else statements ... nar! # (or sha!) while: fulg EXPR ... statements ... nar! # or sha! until: kû EXPR ... statements .. nar! # or sha! perl BURL Black Speech use = ushd 'use' my = dab 'my' die = mat 'die' open = baduzg 'open' close = fauth 'lie hidden' print = mog 'voice' print; = mog! split = râkh 'cleave' split; = râkh! join = thrak 'bring/tribute' map = uzg 'land' this = za 'this' redo = urzkû 'again' last = throquf 'devoured' etc etc... a very simple example script: test.bl: u BURL uses the letter 'u' in column 1 to denote u comments. u In Orkish, 'u' means 'to, towards', and thus u probably implies something like 'ad hoc' for u BURL programmers, further strengthening the u belief that Orcs make poor code documenters. dab @sample = ( 'a', 'b', 'c', 'd', 'e' ); ûr @sample mog! nar!

Replies are listed 'Best First'.
Re: BURL: The Orcish scripting language
by Cybercosis (Monk) on Dec 20, 2001 at 07:19 UTC
    Oh dear... you see, this now calls for Quenyan programming language. The parser could use the Unicode Tengwar (has that been put in yet?) for the actual code...

    nemo accipere quod non merere

      I wonder if one could use a stroke-order method for writing the tengwar, such as stem + bow and bow + stem. u,w,n,m can be used for the bows, with a prefixed bar for closure? Then there's the puctuation thingies, etc etc...

      I did used to have a perl script that created ASCII tengwar from text input. It worked sort of similar to the old 'banner' command (which I also had a perl script for).

      \/^|-m or whatever.

Re: BURL: The Orcish scripting language
by rje (Deacon) on Dec 20, 2001 at 21:52 UTC
    Ok, one filter coming up. But first, I translated my SETI Runner script to BURL, to see how it looks.

    I wonder what the smallest filter would be?

Re: BURL: The Orcish scripting language
by Beatnik (Parson) on Dec 20, 2001 at 21:27 UTC
    So when can we expect a source filter for this BURL? :)

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
      Well, the easier filter is to convert BURL back to perl. Converting perl to BURL appears to be more difficult.

      # # bûrl to perl filter # # bûrl is the Orcish variety of perl. # not as expressive, and more restrictive. # # usage: # # perl -p orc2perl.pl source_file.bl > outfile.pl # s/û/uu/; s/â/aa/; s/ u / \# /; s/^u /\# /; s/^u$/\#/; s/ u$/ \#/; s/(uur|kuu) (.*)( \# .*)?$/for ($2) { $3/; s/gaakh (.*)( \# .*)?$/if ($1) { $2/; s/ash/} else {/; s/ghaash (.*)( \# .*)?$/} elsif ($1) { $2/; s/fulg (.*)( \# .*)?$/while ($1) { $2/; s/uluuk/for(;;) {/; s/buurz!(.*)( \# .*)?$/sleep($1); $2/; s/kuu (.*)( \# .*)?$/until ($1) { $2/; s/(nar|sha)!/};/; s/ai!/print STDERR/; s/snaga (.*)( \# .*)?$/sub $1 { $2/; s/ash/scalar/; s/bhaduur/chdir/; s/pushdug/push/; s/prakhug/pop/; s/maturz/kill/; s/dab/my/; s/mat/die/; s/baduzg/open/; s/fauth/close/; s/mog!/print;/; s/mog/print/; s/thrak/join/; s/raakh!/split;/; s/raakh/split/;
        Well, Filter::Simple is staring at you :)

        Greetz
        Beatnik
        ... Quidquid perl dictum sit, altum viditur.