Date: Wed, 4 Nov 1998 13:48:59 +0100 From: Martin Cracauer <cracauer@cons.org> To: Mike Smith <mike@smith.net.au>, "Jordan K. Hubbard" <jkh@time.cdrom.com> Cc: Parag Patel <parag@cgt.com>, current@FreeBSD.ORG Subject: Re: lisp vs. Forth (was Re: New boot loader and alternate kernels ) Message-ID: <19981104134859.A24574@cons.org> In-Reply-To: <199811032319.PAA00900@dingo.cdrom.com>; from Mike Smith on Tue, Nov 03, 1998 at 03:19:27PM -0800 References: <2329.910134454@time.cdrom.com> <199811032319.PAA00900@dingo.cdrom.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In <199811032319.PAA00900@dingo.cdrom.com>, Mike Smith wrote: > What's the feeling on the lisp vs. Forth argument? If you take the pure languages, without any existing implementations or standards mostly implemented, they are very similar. Both languages have very simple syntax that keeps a minimal interpreter down in size. What I like more about Lisp is that it's syntax is: - more readable than RPN - easier to verify that you got the arguments right, especially in math expressions. And most important the Lisp syntax allows you to be more flexible: - It's easy to have functions that take a variable number of arguments without encoding the number of arguments in in your source tree. - It's easy to implement "keyword arguments" (Lisp equivalent to the commandline switches in Unix commands), virtually impossible in RPN - Something like printf is easy to do in Lisp syntax, not in Forth. Every rescent Lisp except elisp implements static scope, a big plus for readability and espcially for source-constructing tools. Macros are also very handy for this task but don't make sense in RPN. You could use the syntax of Lisp to take and evaluate expressions from the user (from the keyboard or out of files). Lisp isn't everyone's taste, but with keywoard arguments it will be a lot better than RPN to enter at a boot prompt. A big plus for the task are also exceptions that take you back through the call tree savely. Don't know about Forth, but it's handy in Lisp. I'd say that a script to bootstrap a system by talking to hardware is a lot more readable in Lisp syntax. Imagine booting from a SCSI scanner using a piece of paper with a heavily ECC'ed barcode printing. You don't want to write that in Forth :-) To keep the size down, you probably can't (and don't have for the task) even implement all of Scheme (tail-recursive call elimination, the full number tree - we don't need complex numbers in bootstrapping :-), but even with a minimal subset you can use much of slib if you just keep the function names of the primitive compatible to Scheme. http://www-swiss.ai.mit.edu/~jaffer/slib_toc.html Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer <cracauer@cons.org> http://www.cons.org/cracauer BSD User Group Hamburg, Germany http://www.bsdhh.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19981104134859.A24574>