Newsgroups: comp.lang.apl
Path: watmath!watserv2.uwaterloo.ca!mach1!torn!howland.reston.ans.net!darwin.sura.net!haven.umd.edu!uunet!s5!hui
From: hui@fid.morgan.com (Roger Hui)
Subject: Re: Seek J model of D./Rogers C programs vs J verbs
Message-ID: <1993May9.141758.10600@fid.morgan.com>
Organization: Morgan Stanley & Co., New York, NY
References: <1993May8.185846.11799@csus.edu>
Date: Sun, 9 May 1993 14:17:58 GMT
Lines: 27

Emmett McLean writes on 1993-05-08:

> Is there a model of D. written in J? 

I did not write one.

> Also, the C programs in the source are set up in such a 
> way that one can implement verbs while thinking in J
> but programming in C.  Aside from, say productivity,
> (and I would guess minor improvements in execution
> time) what are the advantages to implementing verbs in C
> using the utilities of the J source as compared to just
> using J?

Computations implemented in J & C can be substantially faster 
than implemented in J alone.  Examples of these are
5!:4 (tree representation) and 5!:5 (linear representation),
where the factor is about 30.  In both cases, the implementation
started with a J model, then hand translated into C, then
refined to exploit C features.  The process is iterative.

For me at least, I doubt that the result would be nearly as 
satisfactory had the implementation just started with C,
even if augmented with the J primitives as C functions,
even if I thought in J.  A J model strongly suggests what 
sub-functions should be defined in C, which directly impact 
on the correctness and readability of the C code.
