Re: what kind on programming is lisp?

From: Bernd Paysan (bernd.paysan_at_gmx.de)
Date: 03/07/05


Date: Mon, 07 Mar 2005 16:56:33 +0100

Förster vom Silberwald wrote:
> Once you start: managing huge data sets, reading and writing to files
> and at the same time steering external legacy C or Fortran programs
> then you will need a better programming language.

Or a better Forth than the one you know (though I doubt there is one you
know).

> The problem in Forth I gather are not so much related to writing a spot
> on program which runs from the very first start on. I believe you when
> you say so. But the hell will open if you try to change and adopt that
> particular program in Forth.

I've written and maintained a number of bigger Forth programs. It's a
non-issue. While (standard) Forth does not *contain* abstractions like
lists, objects, or arrays, it allows you to *build* them in a few lines
(and most systems indeed have things like that as part of their library).
I've written programs where I changed the underlying abstraction how to
store data. Thinking Forth (http://thinking-forth.sourceforge.net/)
contains a small example where you extend a variable to be redirect to
different classes without changing the rest of the code.

There are differnet "reasons" (or rather sound-bites) why you can't write
big programs in Forth. Let's examine them all together:

* you can't write big programs, because Forth's philosophy is "keep it
simple", and you'll just write a small simple program that does all the
functionality of what would be a large program in another language.

- Ok, we accept that "sound-bite"; we like to keep programs simple ;-).

* you can't write big programs, because Forth is 16 bit.

- Get up and leave the cave where you have been hiding. There are 64 bit
Forths available today.

* you can't write big programs, because Forth source has to fit into one 1k
screen.

- Even more funny, as it never was true ;-)

* you can't write big programs, because Forth is write-only, and therefore,
you can't change what you have written.

- Forth is as "unreadable" as Chinese, Arabic, Russian, or whatever language
you don't understand. Now go and try to write a single correct sentence in
Chinese, and come back when you manage to do that without being able to
read or understand Chinese. Once you've learned Forth and got used to a
style with short definitions, useful stack comments, and good names,
there's no problem. People have written and maintained Forth programs with
up to almost a million lines of code. If you stick your head into the
ground, cover your ears with your hands, and sing "lalala" to avoid hearing
tales like that, all we can do is kick your ass ;-).

Forth and Lisp share a number of features, like interactivity and
meta-programming. They are different on other features, like Lisp having
named, and Forth having unnamed parameters, but allowing named locals. Or
data typing (Lisp: dynamic, the data knows its type, Forth: the
user/programmer names the type). You can combine things by having a reverse
polish lisp (RPL, like on the HP calculators, or PostScript), or an object
oriented Forth extension, which gives you typed data, too. I haven't seen a
Lisp-like syntax with a Forth-like semantics, though.

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/


Relevant Pages

  • Re: ILC2005: McCarthy denounces Common Lisp, "Lisp", XML, and Rahul
    ... >> the language should be available to users. ... In the design of Common Lisp, I asked Dave Moon (one of the architects ... Now, there are good kinds of low-level, like the way that floats are ...
    (comp.lang.lisp)
  • Re: CollabRx seeks brilliant engineers for an excellent e-science adventure
    ... belief that lisp programmers are smarter/better. ... Java or PHP programmers. ... a type of language that attracts a personality that meets my perceptions ...
    (comp.lang.lisp)
  • Re: Whats the best language to learn...
    ... on processors designed to run Lisp and Lisp OSes. ... byte-addressed memory, has native support for variable-sized value types, ... popular OO language, rather a language about like that of Delphi would have ... lisp, java, ruby, etc. ...
    (comp.programming)
  • Re: Program compression
    ... TM> supported by your favorite language (LISP) are good concepts. ... then call the Java compiler to compile that source file to a Class ... TM-STC> Since static type checking makes run-time type checks unnecessary, ...
    (comp.programming)
  • Re: Is anybodys favorite computer programming language not included here?
    ... to talk about getting me some paying work writing Java classes. ... and could be copied to a script (as in Java BeanShell or Lisp PROG). ... >> please post a followup saying what language it is, ... Server: "Mother, ...
    (comp.programming)