in reply to Re: Going back in time...
in thread Going back in time...

Indeed. One of my dearest ambitions is to create my own little language, preferably in Perl.

Replies are listed 'Best First'.
Re^3: Going back in time...
by samizdat (Vicar) on Jul 16, 2007 at 14:26 UTC
    If you think about it, almost every data parsing and control interface program has at its heart a parser for a little language, although usually one that's not very general purpose. Where things get fun is when you add an 'eval' command and the ability to extend the language by defining new functions. I learned about those in one of my only college CS classes, a 200-level language survey class where one of the languages we studied was LISP. Putting X to the power of Y, I was off and running. When I started working commercially, my assembly language microcontroller programs ended up with read-eval-print loops and in some cases even a crude function-definition capability (more like shell scripting than true language extension) with an eval+apply function that checked for user-defined command scripts before going into its primitive list. I use this model when I can, in almost every complete system I write. Once you understand the concept, doing it consciously becomes second nature.

    Perl makes it easy, since extensibility and meta-progreamming are built-in resources, but the concepts are valid on any platform and are highly recommended for study and rumination. I've used it effectively in 8051 assembler, C, and even Smalltalk.

    with thanks to Thant Tessman, this quote:

    Greenspun's Tenth Rule of Programming:
    "Any sufficiently complicated C or Fortran program contains
    an ad-hoc, informally-specified bug-ridden slow implementation
    of half of Common Lisp."

    Don Wilde
    "There's more than one level to any answer."
      When I started working commercially, my assembly language microcontroller programs ended up with read-eval-print loops and in some cases even a crude function-definition capability (more like shell scripting than true language extension) with an eval+apply function that checked for user-defined command scripts before going into its primitive list.

      Why do I think FORTH immediately? Ah - we talked about that already :-)

      (Some say that Forth is to assembly what Perl is to C)

      --shmem

      _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                    /\_¯/(q    /
      ----------------------------  \__(m.====·.(_("always off the crowd"))."·
      ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
        I'd agree with that last link's premise. Stack manipulation functions should precede meta-programming functions, definitely... :D

        Don Wilde
        "There's more than one level to any answer."