Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Going back in time...

by samizdat (Vicar)
on Jul 16, 2007 at 14:26 UTC ( [id://626849]=note: print w/replies, xml ) Need Help??


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

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."

Replies are listed 'Best First'.
Re^4: Going back in time...
by shmem (Chancellor) on Jul 16, 2007 at 15:25 UTC
    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."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://626849]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-20 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found