Dan's stated requirement is productivity.  So, doing J 
in J, you could say:

   slashdot=: 1 : '=...@[ u...@# ]'

   2 7 1 8 2 8 < slashdot 'abcdef'
+--+-+-+--+
|ae|b|c|df|
+--+-+-+--+

Hard to beat that for productivity.  Subsequently,
if you can make the above competitive in efficiency
with a J implemented in C, you would have
achieved something significant.

p.s. How do you do the monad = used in "slashdot",
you asked?

   equal=: (~. =/ ])@i.~
   equal 2 7 1 8 2 8
1 0 0 0 1 0
0 1 0 0 0 0
0 0 1 0 0 0
0 0 0 1 0 1
   equal 'mississippi'
1 0 0 0 0 0 0 0 0 0 0
0 1 0 0 1 0 0 1 0 0 1
0 0 1 1 0 1 1 0 0 0 0
0 0 0 0 0 0 0 0 1 1 0

What about the dyad i. used in "equal" ?

   idot=: 4 : '(#x) - +/"1 +./\"1 x =/&:(<"(0>.<:#$x)) y'
   idot~ 'mississippi'
0 1 2 2 1 2 2 1 8 8 1



----- Original Message -----
From: Roger Hui <[email protected]>
Date: Wednesday, July 22, 2009 13:43
Subject: Re: [Jprogramming] Reimplementing J
To: Programming forum <[email protected]>

> > Do I take it from Roger's remarks that he has already got J
> > implemented in J? Or that he would use J to implement J if he 
> > had to do it afresh?
> 
> I don't have an implementation of J in J.  I proposed it
> in response to Dan's question.
> 
> 
> 
> ----- Original Message -----
> From: Ian Clark <[email protected]>
> Date: Wednesday, July 22, 2009 13:34
> Subject: Re: [Jprogramming] Reimplementing J
> To: Programming forum <[email protected]>
> 
> > Years ago I recall Burroughs staff telling me that the Algol 
> compiler> was itself implemented definitively in Algol  -- not 
> just 
> > as a
> > research tool but operationally, to implement all future releases.
> > 
> > On my protesting what a crazy thing to do, they assured me it wasn't
> > as chicken-and-egg as it sounds. You only had to get one working
> > compiler right at the outset and it can be used to generate a more
> > advanced compiler, and so on. I recall my history teacher 
> > telling me
> > that the industrial revolution was founded on the fact that a lathe
> > could be used to turn the screw to make a closer-tolerance 
> lathe ...
> > and so on.
> > 
> > In practice it was one of the most useful "development tools" the
> > Burroughs people had, because they could bootstrap up new features,
> > port to new architectures or better implementations of 
> > primitives, and
> > gave several examples where this had paid off handsomely. Also 
> > from a
> > staffing point-of-view you don't have to employ specialists in the
> > "implementation language" because it's the same as the target
> > language.
> > 
> > FORTH, if anyone remembers it, was booted-up by "user 
> extension" from
> > a tiny collection of machine-coded primitives (a sort of one-eyed
> > p-code), which was partly why it was one of the first 
> languages 
> > to be
> > ported to new platforms, and indeed was used to implement commercial
> > operating systems. Not very high-quality ones, I recall. But I don't
> > think the Burroughs Algol people did it that way: there was no
> > emulation going on. Nor could they have done it entirely like this:
> > 
> > PLUS =: +
> > 
> > The truth lay somewhere between. I would guess though it was 
> basically> PLUS =: + but with the option to replace any 
> definition with a
> > finer-grained one. Since the generation of a compiler is: 
> source in,
> > machine-code out, there is no circularity in this.
> > 
> > Do I take it from Roger's remarks that he has already got J
> > implemented in J? Or that he would use J to implement J if he 
> > had to
> > do it afresh?
> > 
> > Ian
> > 
> > 
> > On Wed, Jul 22, 2009 at 4:27 PM, Dan Bron<[email protected]> wrote:
> > > If you were considering reimplementing J, which language 
> would 
> > you use?
> > > What other tools would you use (e.g. yacc, antlr, parrot VM, etc)?
> > >
> > > Assume you're more concerned with productivity than 
> > performance in the
> > > first instance, but would like the option to tune 
> performance 
> > in the
> > > future.
> > >
> > > What's a good language for implementing other languages?
> > >
> > > -Dan
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to