J language 
Author Message
 J language

Can somebody explain to me what is the advantage of choosing names with
special characters instead plain mnemonics, like in any other language?

I was a programmer in APL. I still use it professionally but not often.
I'm rather afraid of j language...



Tue, 10 Apr 2001 03:00:00 GMT  
 J language
I'm afraid I don't quite understand your question. When you say
`special characters instead of plain mnemonics' where do you
mean to put APL and J?

I'd say J has the advantage on not requiring either a special keyboard
or a special font, and this gives it some `advantage' over APL.

I'd also say that J (and APL) have the advantage over most other
languages of being very terse. This can be a particular advantage
in interpreted languages.

Quote:

> Can somebody explain to me what is the advantage of choosing names with
> special characters instead plain mnemonics, like in any other language?

> I was a programmer in APL. I still use it professionally but not often.
> I'm rather afraid of j language...



Tue, 10 Apr 2001 03:00:00 GMT  
 J language

Quote:

>Can somebody explain to me what is the advantage of choosing names with
>special characters instead plain mnemonics, like in any other language?

Perhaps you err. The only language I am familiar with that uses mnemonics
is COBOL.  Most other languages make an attempt to use single characters
for certain functions.

Single character functions are more compact.  They are virtually impossible
to mystipe.  3 pus 4, versus 3+4.

Note that a principle of single character functions, that is their "infix"
nature, is also available to mnemonically named functions:

3 plus 4   instead of plus(3,4)

Quote:
>I was a programmer in APL. I still use it professionally but not often.
>I'm rather afraid of j language...

An eerily common reaction from people with APL knowledge... one
virtually identical to the reaction to APL by non-APL programmers.

--
|\/| Randy A MacDonald       |"We ARE the weirdos, mister!"

     BSc(Math) UNBF '83      | APL: If you can say it, it's done.

     I use Real J            | Also http://www.godin.com/godin/
------------------------------------------------<-NTP>----{ gnat }-



Tue, 10 Apr 2001 03:00:00 GMT  
 J language

Quote:
> >I was a programmer in APL. I still use it professionally but not often.
> >I'm rather afraid of j language...

> An eerily common reaction from people with APL knowledge... one
> virtually identical to the reaction to APL by non-APL programmers.

I keep setting out to learn J but always get sidetracked by other matters.
I am not afraid of the language -- it seems basically to be an extension
of APL.  What I find annoying is that the character set chosen for J is so
small that excessive overloading is required, making expressions
confusing.  For example, symbols which include letters of the alphabet
(e.g.  i. or y. in the original posting that started this discussion) do not
mix well with the one-letter variable names which APL users often
employ.  Dots have too many meanings.  Also, the ASCII characters
don't have the mnemonic value of a character set specifically designed
for a particular language.  Consider the branch arrow, which points the
way to the line label, the assignment arrow, which indicates the
direction of data flow, the quad, representing a sheet of paper or a
display screen, and so on.  These will never be confused with the
Roman alphabet used for function and variable names.

Various versions of APL have provided keyword equivalents for APL
characters for many years.  Consider APL*PLUS or the University of
Maryland APL interpreter for the Univac, for example.  So it shouldn't
be too hard to come up with a J interpreter which provides the option of
using APL characters to represent J operations.  This would make J
much friendlier to people experienced in APL.

--- Brian



Tue, 10 Apr 2001 03:00:00 GMT  
 J language
Yes, perhaps. And if my experience is at all typical, you'd use it for
about 5 minutes.

When I started with J a while ago, I too wished that I could use the
much more familiar to me (then) APL keystrokes. Indeed, my fingers
even knew where the keys were. It was frustrating and difficult.

For a couple of days. Then I found that it was much easier to type the
J glyphs. And I didn't have to figure out how to `overstrike'. And
I could learn *very* simple parsing rules. And then J started to
look just as meaningful to me as equivalent `phrases' in APL.
And forks and trains made a lovely addition, as did developing

a function definition in APL.

Between J and K I find I never bother to use APL anymore. Indeed I
retired it to the archive for my new machine.

Quote:

> I keep setting out to learn J but always get sidetracked by other matters.
> I am not afraid of the language -- it seems basically to be an extension
> of APL.  What I find annoying is that the character set chosen for J is so
> small that excessive overloading is required, making expressions
> confusing.  For example, symbols which include letters of the alphabet
> (e.g.  i. or y. in the original posting that started this discussion) do not
> mix well with the one-letter variable names which APL users often
> employ.  Dots have too many meanings.  

Not in J. Dots are pretty simple in J.

Quote:
> Also, the ASCII characters
> don't have the mnemonic value of a character set specifically designed
> for a particular language.  Consider the branch arrow, which points the
> way to the line label, the assignment arrow, which indicates the
> direction of data flow, the quad, representing a sheet of paper or a
> display screen, and so on.  These will never be confused with the
> Roman alphabet used for function and variable names.

While that's true, there is hell to pay to *find* some of these
characters on some keyboards. And even if they are there, I seem
to remember that they move around. And I never could figure out how
to hit an overstrike on some systems anyway. While special characters
seem to help at the beginning, they are a real nuiscance in publication
and often cause trouble when passing code from one system to another.

Quote:

> Various versions of APL have provided keyword equivalents for APL
> characters for many years.  Consider APL*PLUS or the University of
> Maryland APL interpreter for the Univac, for example.  So it shouldn't
> be too hard to come up with a J interpreter which provides the option of
> using APL characters to represent J operations.  This would make J
> much friendlier to people experienced in APL.

True again, but it is interesting to note that there are still arguments
about which keyword equivalent set you should use. IIRC DEC had one
for APL10. I think Sharp had another. At one of my sites we had still
another.

In any event, I suggest that *you* do it. Start with things like:
`take =: {.' and `drop =: }.'  I started to do this, way back when,
but I found that I ended up learning the J symbols before I even got
to the end of the most elementary list of the replacements, so
I didn't waste the time of continuing on.

Quote:

> --- Brian



Tue, 10 Apr 2001 03:00:00 GMT  
 J language
David Ness writes on Friday, October 23:

Quote:
> ...
> And forks and trains made a lovely addition, as did developing

> a function definition in APL.
> ...

Aside: If I remember correctly, the J interpreter recognizes the phrase

algorithm for it.  (If I don't remember correctly and it does not,
then it should be and soon will be :-)


Tue, 10 Apr 2001 03:00:00 GMT  
 J language
: Yes, perhaps. And if my experience is at all typical, you'd use it for
: about 5 minutes.

: In any event, I suggest that *you* do it. Start with things like:
: `take =: {.' and `drop =: }.'  I started to do this, way back when,
: but I found that I ended up learning the J symbols before I even got
: to the end of the most elementary list of the replacements, so
: I didn't waste the time of continuing on.

Or you can load the file main/primitiv.js (assuming it's still there in
4.x; I'm stuck in 3.05C and doing other things currently).  That has the
names of most or all of the glyphs defined in English.  (xenos.js has the
foreigns similarly defined.)

Like you, I found that it didn't take much time before I didn't want the
syntactical sugar.  It makes it too hard to understand.  

  If that sounds backwards, note the later point about programming as
  creating mathematical functions.  I don't write

    x squared plus 2 times x times y plus y squared

  but rather

     2          2
    x  + 2xy + y

What I did learn, too late in the game, is that it would have helped
immensely had I just done what ISI suggested:  work through the Primer and
then the lessons in the Introduction and Dictionary.  Had I done that (as
they suggested), I would have been down the learning curve _much_ faster.
I tried to do the engineering thing: read the manual _only_ when there was
no other way --- not a wise decision with J.

Oh, yes, one other point.  While I haven't seen anyone talk about this
explicitly very much, I find it easier to create J applications by a
semi-literate programming approach in a mathematical style.  That is, I
write functions (in math. notation, not J) to describe what I want to do,
and I focus on creating functions which I can compose with other functions
to do what I want.  As I go, I'll translate some into J tacit forms and
test them.  Eventually, I end up with a nice, short, easy to maintain, and
flexible bit of code.  

Or then again I just sometimes write fortran using explicit verbs.  It's
never as nice or as supportable or ..., but it _is_ sloppy.  (Oops:  I
guess that's not a good thing, huh? :-)

Bill
--
Bill Harris                                 Year 2000 Program Office

phone: (425) 335-2200                       M/S 330
fax: (425) 335-2648                         8600 Soper Hill Road
web: http://hpweb.lsid.hp.com:8080/~billh/  Everett, WA 98205-1298



Tue, 10 Apr 2001 03:00:00 GMT  
 J language
I will ask my question differently:
Why not use easily typeable and memorizable mnemonics as the standard
form, and the special characters (APL or combination of ASCII) as a
shorthand notation?

It would avoid people being stuck when typing is not possible and help
them to find the mnemonics in a dictionary when learning the language.

Some people use more easily special characters, some others don't...



Sat, 14 Apr 2001 03:00:00 GMT  
 J language
Would you carry that argument to using `plus' instead of `+' and
`minus' instead of `-'? If so, I'm *not* with you. If not, then
where you stop is just a matter of taste. I much prefer the
terseness in the long run...

In addition, there is, it seems to me, a semantics implied by the
`special symbol' syntax. I see `+' as something `primary' to the
language, while I see `plus' as something that you might have defined,
and which might mean anything from the conventional `+' up to some
metaphorical `addition' of one graphic to another. While it is indeed
true that (in J at least) you might say `plus =: +' I will generally
read `(2 plus 4)' as meaning something that I better be careful about
interpreting, while I see `(2 + 4)' pretty much as 6 (assuming proper
context, of course)...

Quote:

> I will ask my question differently:
> Why not use easily typeable and memorizable mnemonics as the standard
> form, and the special characters (APL or combination of ASCII) as a
> shorthand notation?

> It would avoid people being stuck when typing is not possible and help
> them to find the mnemonics in a dictionary when learning the language.

> Some people use more easily special characters, some others don't...

This observation really sums up the sitution. Everyone would concede
that there are `some people' on each side. My guess is that there are
more, particularly if you weight them by usage, on the side of
terseness. Otherwise we would have all learned to write
  2 plus 2 is 4
instead of
  2 + 2 = 4
in elementary school, where, after all, we are pretty much dealing
with `normal' people (not just we computer folks).

I read a fair amount of code, and I appreciate terseness. People vote
with their feet (eyes) on this one, and I think they vote for terse.



Sat, 14 Apr 2001 03:00:00 GMT  
 J language

Quote:
>   2 + 2 = 4

  2 + 2 = 4
2

I guess you meant

   4 = 2 + 2
1
===> End of articles for Mon Oct 26 23:59:03 AST 1998



Sat, 14 Apr 2001 03:00:00 GMT  
 J language
No. It may be a sign that American education is `backwards' but
in school we definitely learned `2 + 2 = 4'. Of course, at that
time no one, my teachers, ISI or anyone else included, was fluent in `J'
(or APL, for that matter)...
Quote:


> >   2 + 2 = 4

>   2 + 2 = 4
> 2

> I guess you meant

>    4 = 2 + 2
> 1
> ===> End of articles for Mon Oct 26 23:59:03 AST 1998



Sat, 14 Apr 2001 03:00:00 GMT  
 J language

Quote:

>No. It may be a sign that American education is `backwards' but
>in school we definitely learned `2 + 2 = 4'. Of course, at that
>time no one, my teachers, ISI or anyone else included, was fluent in `J'

No, you learned that (2 + 2) = 4, whether you want to deny the existence of
the parentheses or not.

Perhaps you also learned that the bus ran into the hearse with children in it.

--
|\/| Randy A MacDonald       |"We ARE the weirdos, mister!"

     BSc(Math) UNBF '83      | APL: If you can say it, it's done.

     I use Real J            | Also http://www.godin.com/godin/
------------------------------------------------<-NTP>----{ gnat }-



Sun, 15 Apr 2001 03:00:00 GMT  
 J language
? What =. (all the fuss) about ''
There =. ((i. 0) wrong &.> syntax{J) far & as know I
)


Sun, 15 Apr 2001 03:00:00 GMT  
 J language

Quote:
>? What =. (all the fuss) about ''
>There =. ((i. 0) wrong &.> syntax{J) far & as know I
>)

Deal what assign all the fuss about quote quote
There as assign empty wrong each syntax from J far as know I
end

..empty is not nothing.
..assignment is not identity.
..each is not with

--
|\/| Randy A MacDonald       |"We ARE the weirdos, mister!"

     BSc(Math) UNBF '83      | APL: If you can say it, it's done.

     I use Real J            | Also http://www.godin.com/godin/
------------------------------------------------<-NTP>----{ gnat }-



Tue, 17 Apr 2001 03:00:00 GMT  
 
 [ 14 post ] 

 Relevant Pages 

1. JS-EAI with *JS*-callback

2. js.exception 3279.js

3. NB. gray.js: a J verb that generates a grayscale postscript image from a 2d array

4. lapackTest.js

5. profile.js

6. J script file profile.js

7. JS valueOf() in RB ?

8. JS for functional programming?

9. JS for functional programming?

10. prefs.js question

11. JS / VRML / HTML / camera binding

12. help: js generated vrml

 

 
Powered by phpBB® Forum Software