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?? |
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: "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."
In Section
Meditations
|
|