# Questions about Joy

## Mark Phillips — 2003-11-19 04:17:25

    Hi,

    I've just heard about Joy and it sounds like a

    very interesting language.  I have a few questions

    which I'm hoping people can shed some light on.

    1. Is Joy an exploratory language only?  Could it

    be used in a real-world application?  If not, how

    far away from this is it?  Could it be used in

    combination with another language to make it

    useable?

    2. Is there potential eventually for a sophisticated

    type system as part of Joy?  Would any real typing

    system have to be modelled within the Joy language

    itself?  Is this a reasonable thing to do?

    3. How are sophisticated data structures best

    modelled in Joy?

    4. Do people see concatenative languages as

    THE way forward, or do they see them as a good

    tool to use for some types of programming?

    5. Do notions of parallel programing fit within

    Joy's model?

    6. What, if any, are the downsides of Joy's

    approach?

    Thanks,

    Mark.

    __________________________________

    Do you Yahoo!?

    Protect your identity with Yahoo! Mail AddressGuard

    http://antispam.yahoo.com/whatsnewfree

## Slava Pestov — 2003-11-19 04:54:40

    On Tue, 2003-11-18 at 23:17, Mark Phillips wrote:

     > 1. Is Joy an exploratory language only?  Could it

    > be used in a real-world application?  If not, how

    > far away from this is it?  Could it be used in

    > combination with another language to make it

    > useable?

     Well, right now, I'm writing an action game in Java; for scripting, it

    uses a language I'm developing that's closely modelled after Joy. Its

    not exactly the same as Joy, though:

    - more Forth-like stack operators: over, nip, tuck, rot, -rot, 2drop,

    2dup, and so on; although there is a 'dip' like in Joy as well.

    - variables (hence side effects) -- $foo pushes value of foo, @foo sets

    value of foo to the top of the stack (actually the parser expands $foo

    to "foo" $, and @foo to "foo" @; $ and @ are special words).

    - words are defined at eval time using a 'define' word, for example:

    "squared" [ dup * ] define

    - continuations (!)

    I will release the interpreter very soon, as open source; the release of

    the game itself is still some ways off.

     > 3. How are sophisticated data structures best

    > modelled in Joy?

     I'm not sure its possible in Joy itself. However it is not hard to add

    this concept to an RPN language; my language supports 'namespaces',

    which are dictionaries used to look up word and variable definitions.

    Namespaces can be nested, and used to model data structures -- for

    example, each object in the game has an associated namespace with

    variables x, y, z, dx, dy, dz, and so on. An object system is built on

    top of this -- a new instance is created by cloning an existing

    namespace, inheritance is done simply by cloning a new instance and

    adding words and variables. The ; operator is used to evaluate a

    quotation inside a namespace:

    $player [ $x $y ] ;

     > 4. Do people see concatenative languages as

    > THE way forward, or do they see them as a good

    > tool to use for some types of programming?

     While some people hate RPN, I love it how most definitions fit on a few

    lines, and those that don't are easy to break up into multiple

    definitions.

    --

    Slava Pestov

## phimvt@lurac.latrobe.edu.au — 2003-11-19 06:20:11

    On Tue, 18 Nov 2003, Mark Phillips wrote:

    [..]

    > 1. Is Joy an exploratory language only?  Could it

    > be used in a real-world application?  If not, how

    > far away from this is it?  Could it be used in

    > combination with another language to make it

    > useable?

    Well, it started off as an exploration. By now it could be used for

    real world problems by Joy programmers. But I cannot at this stage

    see application programs written in it.

    > 2. Is there potential eventually for a sophisticated

    > type system as part of Joy?  Would any real typing

    > system have to be modelled within the Joy language

    > itself?  Is this a reasonable thing to do?

    In this respect Joy is like Lisp and Scheme, it is weakly and

    dynamically typed. I don't know what you mean by "real typing"

    (statically ?) or by "modelled within ..". There is no reason

    why somebody could not design and implement a statically typed

    language similar to Joy, but it would be as different as ML and

    Haskell are from Lisp and Scheme.

    > 3. How are sophisticated data structures best

    > modelled in Joy?

    As in Lisp and Scheme: nested lists.

    > 4. Do people see concatenative languages as

    > THE way forward, or do they see them as a good

    > tool to use for some types of programming?

    Well, for functional programming the concatenative model

    is one alternative. "THE way .." - who knows ?

    > 5. Do notions of parallel programing fit within

    > Joy's model?

    Yes, all functional programming languages lend themselves to

    parallel implementations. Very few have kept that promise,

    and most, Joy included, have not even tried.

    > 6. What, if any, are the downsides of Joy's

    > approach?

    It's new, it's very different, even when compared with other

    functional languages. So the prime downside is conceptual inertia,

    mostly. Also, many people would argue that functional programming

    is too narrow.

    Hope this helps.

      - Manfred

## John Cowan — 2003-11-19 14:01:25

    Mark Phillips scripsit:

     > 1. Is Joy an exploratory language only?  Could it

    > be used in a real-world application?  If not, how

    > far away from this is it?  Could it be used in

    > combination with another language to make it

    > useable?

     Joy 1 has access to almost the whole standard library of ISO C.

    At present, the biggest limitation is that there's no way to

    load foreign routines into the Joy interpreter.

     > 2. Is there potential eventually for a sophisticated

    > type system as part of Joy?  Would any real typing

    > system have to be modelled within the Joy language

    > itself?  Is this a reasonable thing to do?

     Well, Joy doesn't have variables, so it isn't going to have

    static typing.  Dynamic typing already exists, although the

    list of types (int, float, string, stream, list, set of integers, symbol)

    is currently fixed.  It wouldn't be that hard to add an extensible

    type system.

     > 3. How are sophisticated data structures best

    > modelled in Joy?

     As lists.

     > 4. Do people see concatenative languages as

    > THE way forward, or do they see them as a good

    > tool to use for some types of programming?

     Hopefully the latter.

     > 5. Do notions of parallel programing fit within

    > Joy's model?

     There's no reason why they shouldn't, and in fact it

    would be fairly easy to add multiprocessing.

     > 6. What, if any, are the downsides of Joy's

    > approach?

     It's hard to keep track / Of what's on the stack.

    --

    John Cowan       http://www.ccil.org/~cowan        <jcowan@...>

            You tollerday donsk?  N.  You tolkatiff scowegian?  Nn.

            You spigotty anglease?  Nnn.  You phonio saxo?  Nnnn.

                    Clear all so!  `Tis a Jute.... (Finnegans Wake 16.5)

## Chris Double — 2003-11-19 18:43:18

    On Wed, 19 Nov 2003 17:20:11 +1100, phimvt@... said:

     >

    > In this respect Joy is like Lisp and Scheme, it is weakly and

    > dynamically typed.

     Just a nitpick, Scheme and Common Lisp are strongly typed, not weakly

    typed. They are dynamically typed though. So they are classified as

    having strong/dynamic typing. This is compared to C and C++'s weak/static

    typing model.

    Chris.

    --

    http://radio.weblogs.com/0102385

    --

      Chris Double

      chris.double@...

## Tanksley, William D. Jr. — 2003-11-19 19:02:22

    From: John Cowan [mailto:cowan@...]

     >Mark Phillips scripsit:

    >Well, Joy doesn't have variables, so it isn't going to have

    >static typing.

     Variables aren't needed for static typing -- strongForth has strong static

    typing without variables. Joy itself won't have static typing, but a dialect

    of it could. I've been designing one such for some time, although work on it

    has been nonexistant.

     >John Cowan       http://www.ccil.org/~cowan

     -Billy

## Tanksley, William D. Jr. — 2003-11-19 19:11:24

    From: Mark Phillips [mailto:pierryth@...]

     >2. Is there potential eventually for a sophisticated

    >type system as part of Joy?

     Yes. See strongForth (Google) for an example and explanation of how to do

    this.

     >  Would any real typing

    >system have to be modelled within the Joy language

    >itself?

     No. It would be best modelled as part of the compiler.

     >Is this a reasonable thing to do?

     I say yes. Others say no.

     >3. How are sophisticated data structures best

    >modelled in Joy?

     As lists.

     >4. Do people see concatenative languages as

    >THE way forward, or do they see them as a good

    >tool to use for some types of programming?

     Good tool, I would say -- and also a great avenue for research, since

    they've been so sparsely studied.

     >5. Do notions of parallel programing fit within

    >Joy's model?

     Yes and no. Yes, because it's a functional language; no, because the

    operations Joy provides have an innate sequencing. cK is a derivative of Joy

    which could be made parallel much easier, since it includes and heavily uses

    array operations, which often have no explicit ordering.

    http://www.nsl.com/papers/ck.htm

    My ideal language is a mixture of cK and strongForth.

     >6. What, if any, are the downsides of Joy's

    >approach?

     Probably the worst downside is that we don't know the downsides or upsides.

    This type of language is old and well-used (Forth and Postscript), but very

    poorly researched. It's also a downside that few professional programmers

    have experience with anything like it.

     >Mark.

     -Billy

## Paul-V Khuong — 2003-11-19 23:37:46

    > Message: 3

    >    Date: Wed, 19 Nov 2003 17:20:11 +1100

    >    From: phimvt@...

    > Subject: Re: Questions about Joy

    >

    >

    > On Tue, 18 Nov 2003, Mark Phillips wrote:

     [...]

     > > 2. Is there potential eventually for a

    > sophisticated

    > > type system as part of Joy?  Would any real typing

    > > system have to be modelled within the Joy language

    > > itself?  Is this a reasonable thing to do?

    >

    > In this respect Joy is like Lisp and Scheme, it is

    > weakly and

    > dynamically typed.

     I've absolutely no experience in Joy (school is eating

    my time up), but i'd like to exit lurk mode and say

    that Lisp (and Scheme, afaik) are STRONGLY but

    dynamically typed.

    __________________________________

    Do you Yahoo!?

    Protect your identity with Yahoo! Mail AddressGuard

    http://antispam.yahoo.com/whatsnewfree

## stevan apter — 2003-11-20 01:55:18

    i think the best way to learn about joy is just to

    jump in and start coding.

    some years ago i heard ken iverson (the inventor of

    APL) urge people to pick a textbook which uses C or

    Java and rewrite the examples in APL.  i seem to

    recall that he had plans to J-ify knuth's _concrete

    mathematics_:

    http://www.amazon.com/exec/obidos/tg/detail/-/0201558025/qid=1069292917/sr=8-1/ref=sr_8_1/103-7469654-4278259?v=glance&n=507846

    this would make a terrific joy project.

     ----- Original Message -----

    From: "Mark Phillips" <pierryth@...>

    To: <concatenative@yahoogroups.com>

    Sent: Tuesday, November 18, 2003 11:17 PM

    Subject: [stack] Questions about Joy

    > Hi,

    >

    > I've just heard about Joy and it sounds like a

    > very interesting language.  I have a few questions

    > which I'm hoping people can shed some light on.

    >

    > 1. Is Joy an exploratory language only?  Could it

    > be used in a real-world application?  If not, how

    > far away from this is it?  Could it be used in

    > combination with another language to make it

    > useable?

    >

    > 2. Is there potential eventually for a sophisticated

    > type system as part of Joy?  Would any real typing

    > system have to be modelled within the Joy language

    > itself?  Is this a reasonable thing to do?

    >

    > 3. How are sophisticated data structures best

    > modelled in Joy?

    >

    > 4. Do people see concatenative languages as

    > THE way forward, or do they see them as a good

    > tool to use for some types of programming?

    >

    > 5. Do notions of parallel programing fit within

    > Joy's model?

    >

    > 6. What, if any, are the downsides of Joy's

    > approach?

    >

    > Thanks,

    >

    > Mark.

    >

    >

    > __________________________________

    > Do you Yahoo!?

    > Protect your identity with Yahoo! Mail AddressGuard

    > http://antispam.yahoo.com/whatsnewfree

    >

    >

    > To unsubscribe from this group, send an email to:

    > concatenative-unsubscribe@egroups.com

    >

    >

    >

    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

    >

    >

## Michael Manti — 2003-11-20 02:08:10

    Concrete Math Companion is at

    http://www.jsoftware.com/publications_books.htm

     On Wednesday, November 19, 2003, at 08:55 PM, stevan apter wrote:

    > i think the best way to learn about joy is just to

    > jump in and start coding.

    >

    > some years ago i heard ken iverson (the inventor of

    > APL) urge people to pick a textbook which uses C or

    > Java and rewrite the examples in APL.  i seem to

    > recall that he had plans to J-ify knuth's _concrete

    > mathematics_:

    >

    > http://www.amazon.com/exec/obidos/tg/detail/-/0201558025/

    > qid=1069292917/sr=8-1/ref=sr_8_1/103-7469654-4278259?v=glance&n=507846

    >

    > this would make a terrific joy project.

    >

    >

    > ----- Original Message -----

    > From: "Mark Phillips" <pierryth@...>

    > To: <concatenative@yahoogroups.com>

    > Sent: Tuesday, November 18, 2003 11:17 PM

    > Subject: [stack] Questions about Joy

    >

    >

    > > Hi,

    > >

    > > I've just heard about Joy and it sounds like a

    > > very interesting language.  I have a few questions

    > > which I'm hoping people can shed some light on.

    > >

    > > 1. Is Joy an exploratory language only?  Could it

    > > be used in a real-world application?  If not, how

    > > far away from this is it?  Could it be used in

    > > combination with another language to make it

    > > useable?

    > >

    > > 2. Is there potential eventually for a sophisticated

    > > type system as part of Joy?  Would any real typing

    > > system have to be modelled within the Joy language

    > > itself?  Is this a reasonable thing to do?

    > >

    > > 3. How are sophisticated data structures best

    > > modelled in Joy?

    > >

    > > 4. Do people see concatenative languages as

    > > THE way forward, or do they see them as a good

    > > tool to use for some types of programming?

    > >

    > > 5. Do notions of parallel programing fit within

    > > Joy's model?

    > >

    > > 6. What, if any, are the downsides of Joy's

    > > approach?

    > >

    > > Thanks,

    > >

    > > Mark.

    > >

    > >

    > > __________________________________

    > > Do you Yahoo!?

    > > Protect your identity with Yahoo! Mail AddressGuard

    > > http://antispam.yahoo.com/whatsnewfree

    > >

    > >

    > > To unsubscribe from this group, send an email to:

    > > concatenative-unsubscribe@egroups.com

    > >

    > >

    > >

    > > Your use of Yahoo! Groups is subject to

    > http://docs.yahoo.com/info/terms/

    > >

    > >

    >

    >

    <image.tiff>

    >

    >

    > To unsubscribe from this group, send an email to:

    > concatenative-unsubscribe@egroups.com

    >

    >

    >

    > Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

    Michael Manti

    mmanti@...

    [Non-text portions of this message have been removed]

## stevan apter — 2003-11-22 16:50:54

    ----- Original Message -----

    From: "Mark Phillips" <pierryth@...>

    To: <concatenative@yahoogroups.com>

    Sent: Tuesday, November 18, 2003 11:17 PM

    Subject: [stack] Questions about Joy

    > Hi,

    >

    > I've just heard about Joy and it sounds like a

    > very interesting language.  I have a few questions

    > which I'm hoping people can shed some light on.

    >

    > 1. Is Joy an exploratory language only?  Could it

    > be used in a real-world application?

    you might want to cut your joy teeth on this problem:

    http://www.ipd.uka.de/~prechelt/phonecode/

    over the last few days there's been some discussion of

    this problem on comp.lang.forth, but - alas - no code.

    i've got one in k (http://www.nsl.com/papers/phone.htm),

    and that algorithm is easily translated into cK, but a

    pure joy solution would succeed in getting the attention

    of the forth community.  i'm particularly struck by the

    naturalness of the recursive solution, so on that score

    it would seem that joy has something uniquely interesting

    to contribute.

    any takers?

## S. Alexander Jacobson — 2003-12-03 03:12:00

    On Wed, 19 Nov 2003 phimvt@... wrote:

     > > 1. Is Joy an exploratory language only?  Could it

    > > be used in a real-world application?  If not, how

    > > far away from this is it?  Could it be used in

    > > combination with another language to make it

    > > useable?

    >

    > Well, it started off as an exploration. By now it could be used for

    > real world problems by Joy programmers. But I cannot at this stage

    > see application programs written in it.

     Ok, I'll bite.

    How would you write an httpd service in Joy?

    Does it have a concurrency model?

    How does one deal w/ a slow connection?

     > > 5. Do notions of parallel programing fit within

    > > Joy's model?

    >

    > Yes, all functional programming languages lend themselves to

    > parallel implementations. Very few have kept that promise,

    > and most, Joy included, have not even tried.

     Ok.  Can you sketch this?

    -Alex-

    ___________________________________________________________________

    S. Alexander Jacobson                      Check out my new blog!!!

    1-212-787-1914 voice                       http://alexjacobson.com

## Nick Forde — 2003-12-03 10:36:11

    Hi Alex,

    S. Alexander Jacobson writes:

      > On Wed, 19 Nov 2003 phimvt@... wrote:

     > > > 1. Is Joy an exploratory language only?  Could it

     > > > be used in a real-world application?  If not, how

     > > > far away from this is it?  Could it be used in

     > > > combination with another language to make it

     > > > useable?

     > >

     > > Well, it started off as an exploration. By now it could be used for

     > > real world problems by Joy programmers. But I cannot at this stage

     > > see application programs written in it.

     >

     > Ok, I'll bite.

     > How would you write an httpd service in Joy?

     > Does it have a concurrency model?

     > How does one deal w/ a slow connection?

     Currently to do the above it would be necessary to extend the

    interpreter, ideally through a general mechanism to support foreign

    language integration.

    Personally, I wouldn't recommend using Joy for any sizeable real-world

    application until there is an industrial strength interpreter

    available and associated libraries. However, having said this I have

    used it for scripting various admin. jobs and this has let me use it

    in a professional environment.

    You will find Joy rough around the edges compared to languages such as

    Ruby, Python and Perl, but hey, its fun writing Joy code and worth

    giving a go!

    Nick.

## phimvt@lurac.latrobe.edu.au — 2003-12-08 03:00:25

    On Tue, 2 Dec 2003, S. Alexander Jacobson wrote:

     > On Wed, 19 Nov 2003 phimvt@... wrote:

    > > > 5. Do notions of parallel programing fit within

    > > > Joy's model?

    > >

    > > Yes, all functional programming languages lend themselves to

    > > parallel implementations. Very few have kept that promise,

    > > and most, Joy included, have not even tried.

    >

    > Ok.  Can you sketch this?

     All functional languages are based on the evaluation of

    expressions. Often expressions contain subexpressions which

    can be evaluated in any order, and even in parallel, without

    any effect on the final result. An example, written in

    infix  and in Joy notation:

      a)        (1 + 2) * (7 - 3)         1 2 + 7 3 -  *

      b)           3    *    4                3     4  *

      c)               12                             12

    Here a) is the original expression, in step b) the addition

    and the subtraction are performed "in parallel", and in step

    c) the final multiplication is performed. This is similar to

    the way we wrote expression evaluation at school, except that

    we really did the addition first and then the subtraction.

    But in a truly parallel implementation the two operations

    in b) would be done at the same time, by separate brains or

    separate processors. I do not know of any implementations

    that actually do use separate processors, but I believe some

    of the optimisations that are done on the fly by some of

    the latest hardware come pretty close. Not my field, though.

    Hope this helps.

      - Manfred