Functional Programming

From: “M. Edward (Ed) Borasky” [email protected]

I guess it depends on what you want to do with it. I only briefly looked
at Joy and haven’t even heard of Factor until just now. Joy struck me as
an “academicized” Forth, which I think is a “bad” thing. Forth itself
has a current ANS standard and a working committee building a new
standard, at least two commercial vendors and dozens of open-source
implementations. People actually get paid to write Forth.

Yay! I used to get paid to write Forth. :smiley: It was my favorite
language for many years.

This looks like a pretty nice explanation of how Forth works:
http://dec.bournemouth.ac.uk/forth/forth.html

I wrote a for-fun Forth interpreter in Perl a few years back:
http://tastyspleen.net/~billk/pforth/

Just stumbled on this link–kind of interesting, Forth code to
add object oriented defining methods to Forth: (classes with
inheritance… although the numbers used to link message names
to corresponding methods seems kinda clunky…)
http://www-personal.umich.edu/~williams/archive/forth/peters/ooPocketForth.txt

I’ve thought on occasion it might be neat to submit a ruby quiz
sometime, where the goal is to write, in ruby, the core of a Forth
interpreter/compiler, such that the rest of the language
(provided with the quiz) can bootstrap itself.

I think it’s kind of one of those potential “ah ha!” moments
when one realizes how simple a Forth interpreter/compiler loop
can actually be.

I’d probably get back into Forth if I were doing small
embedded systems programming. But Forth doesn’t go out of
its way to do complex things behind the scenes to help the
programmer the way Ruby does. (Fixnum → Bignum automatic
conversion being one example… Dynamic memory allocation
with garbage collection being another…)

Ultimately I ended up feeling that while Forth’s simplicity
is one of its key strengths in a context like embedded
systems, its simplicity ends up being more of a liability
when programing large applications.

But when you need to get an interpreter, compiler,
I/O subsystem, and editor in a few Kbytes of memory–Forth
is truly amazing.

Regards,

Bill

James Edward G. II wrote:

While I can’t say for what versions, GCC runs on pretty dang near
every
thing as far as I know. If I recall correctly GCC was even the default
system
compiler on 4.4BSD, replacing PCC (the Portable C Compiler).

TerryP.

On Aug 25, 2007, at 9:13 PM, Bill K. wrote:

I’ve thought on occasion it might be neat to submit a ruby quiz
sometime, where the goal is to write, in ruby, the core of a Forth
interpreter/compiler, such that the rest of the language
(provided with the quiz) can bootstrap itself.

I hope you do. I’m Forth ignorant, so you could bring me to the
light. :wink:

I’ll sure run it if you put something together.

James Edward G. II

James Edward G. II wrote:

James Edward G. II

Actually, what would be even more interesting would be a Ruby
interpreter written in Forth or Scheme, rather than in C or Java. :slight_smile:

Seriously, though, a simple Forth can be built with indirect threaded
code and all that needs to be “bootstrapped” is the so-called “inner
interpreter”. Traditionally, that’s done in assembler for speed, but I
suppose a Ruby inner interpreter could be built.

Brian A. wrote:

Or you can just skip the books and simply stop assigning to
variables :wink:

Brian A.

((()((())()(()()()(((((((((((((()))())))))((((())))))))))))))))))))))((((((((()()()()()))))

Very few people enjoy Lisp.
All of them have a Parenthesis fetish.

Anybody here remember SISAL? ID (Irvine Dataflow)? At least Matz
remembered CLU. :slight_smile: I personally think Erlang is the last best hope for
functional programming.

Judging by the activity of comp.lang.superlang, I would say it doesn’t
have much, But regardless, Erlang is pretty awesome as well, For its own
merits, Outside of what programming paradigm it fits in.

On 8/25/07, M. Edward (Ed) Borasky [email protected] wrote:

Thanks! I thought they had their own compiler.
Way way OT but :wink: They kind of still do for ppc.

They had their own compiler for 68k & ppc, then OSX started, and they
moved over to gcc. GCC at that point had fair to poor ppc performance
on 32bit, and wretched on 64bit.
…So apple poured a lot of work into the PPC version (which they
properly released IIRC), especially the G5 stuff. Unfortunately some
of it was so radically different (weather or not you can say it was
good or bad different is up to debate), that half or more of their
changes never made it into the main gcc branch.

So apple maintained (maintains?) their own PPC specific branch of gcc.

</information type=“useless”>

–Kyle