hello

69 views
Skip to first unread message

Hugh Aguilar

unread,
Dec 12, 2012, 3:48:10 PM12/12/12
to Cat Language
Hello. I just picked up a copy of Cat and begun playing with it.

I'm actually writing my own language. But I was browsing on the
internet and found Cat, which is somewhat similar to what I'm writing
(it has closures, but does not have dynamic OOP), so it seemed like
something to look at.

My language is for micro-controllers (I'm targeting the PIC24 first).
It is a simplified version of Forth (I got rid of DO loops and >R
etc., and all of that other 1970s-vintage cruft). The major addition
is closures. I don't have GC though, which is inappropriate for a
micro-controller --- this means that the closures can't be used after
the creator function has gone out of scope (trying to do this will
result in a program abort with an error message). Also, each creator
function can only have one level of closures, and can not nest them
--- this means that the closures can't be used as control structures
as is done in Factor with DIP and all that (and is also done in Cat,
from what I've seen).

Here are a couple of questions:

1.) What is the definition of a "concatenative" language? Is it true
that, if I don't support nested closures used as control structures,
then my language won't be a concatenative language? Is it true that
Forth is not considered to be a concatenative language, primarily
because it lacks closures entirely?

2.) What are the definitions of "quotation" and "closure?" Given the
limitations that I will be imposing, can I use either term for what
I've got? Java supposedly has closures, but they have more limitations
that than mine will, which seems to indicate that the word can mean
pretty much anything.

Anyway, I hope to learn lots of useful stuff from Cat, that I can
carry over to my own language. :-) Is it true that Cat is mostly a
learning language, but that it hasn't been used much for application
programs?

P.S. for Christopher Diggins: I noticed that you study at the
University of Montreal with Marc Feeley. As it happens, I'm learning
Scheme right now, using Gambit Scheme which he wrote. Is Cat written
in Gambit Scheme? That would make it very interesting to me, as I
could study it as part of my effort to learn Scheme. I'm learning
Gambit Scheme primarily for compiler-writing, as it has a 64-bit x86
assembler available.

P.P.S: If anybody is interested in some ANS-Forth code for novices,
you can download mine:
http://www.forth.org/novice.html
Look at EACH and all that, in list.4th, for an example of a closure-
like construct in Forth --- it is very limited, as I had to work
around the extreme limitations of ANS-Forth, but it does contain the
essential idea.
Reply all
Reply to author
Forward
0 new messages