Oh, cool.  I found a few old threads about J-with-APL-symbols, but not that
one.  Your links in that thread to images showing off your atttempt with
Emacs overlays seem to have bitrotted -- do you still have them around
somewhere?  My approach is to use composition, following the pattern of the
Emacs 24+ `prettify-symbols-mode`, but unfortunately needing a bit more
flexibility than the substitutions that mode supports. It seems to work
pretty well though!

For the substitutions themselves, I've just tried to use the closest
APL-variant character where I'm aware of such, even where it's IMHO
sub-optimal. For example, `"` becomes `⍤` following Dyalog, and `&.`
becomes `⍢` following [1] (even though it may not actually exist anywhere?).

[1] http://archive.vector.org.uk/art10501260

I think this exercise raise some issues with the whole "different monadic
vs dyadic function on the same symbol" thing. All the introductory APL/J
literature seems to invoke the same example of "-" having both monadic and
dyadic meanings, but I think that's a much more narrow example of a dyadic
function having a monadic form which is the same as the dyadic, just with a
default left argument.  For a counter-example consider J `*:`, which is
clearly `∧̃` dyadically, but nothing like it monadically.  The symbols only
align in their ASCII representation, while the actual meanings are entirely
unrelated, which I find confusing.

Obviously what we need is a new array-oriented language which makes use of
every possible Unicode glyph!

-Marshall

On Mon, Jul 13, 2015 at 7:19 AM Marc Simpson <[email protected]> wrote:

> Neat.
>
> See also
> http://www.jsoftware.com/pipermail/programming/2013-April/032150.html
> (long
> thread, spills over into chat).
>
> On Mon, Jul 13, 2015 at 11:01 AM, Jon Hough <[email protected]> wrote:
>
> > Renders fine for me!
> > I have the opposite problem. I keep trying to learn APL but much much
> > prefer the ascii charset way J does things. Whenever I open Dyalog it
> takes
> > me about 20 minutes before I run back to J.
> >
> > --- Original Message ---
> >
> > From: "Marshall Bockrath-Vandegrift" <[email protected]>
> > Sent: July 13, 2015 6:53 PM
> > To: [email protected]
> > Subject: [Jchat] Emacs mode displaying J with APL characters
> >
> > [Apologies if this is a re-post, but I think I sent this to the wrong
> > address the first time around.]
> >
> > Hi,
> >
> > I've been getting into array-oriented/APL-family languages recently, with
> > no prior experience in any of them.  After spending some time with a few
> > (mostly J and Dyalog APL) I decided that I prefer the semantics of J, but
> > really like expressiveness of the APL symbol-set. J's use of ASCII also
> > makes me a little sad, because it feels like a practical compromise which
> > the ubiquity of Unicode makes no longer necessary.
> >
> > Teaching the J interpreter about multi-byte characters in program text
> > looks tricky, so I decided to go the other, easier route -- teach an
> editor
> > how to display J using non-ASCII substitutions.
> >
> > It's very rough, but here's my work-in-progress fork of the Emacs j-mode:
> > https://github.com/llasram/j-mode/tree/pretty
> >
> > I'm not sure how well this will render for most people, but here's some
> > examples of J code rendered with my current selection of substitutions:
> >
> > dijkstra ← (⊢⌊⌊/.+)⍣∞
> > totient ← × ∼∘÷∘∪⍢q̲
> > eca ← (⌷ (8⍴2)∙⊤)⍨ (3⊥\ ¯1⌽ (2+⍴)⍴⊢)
> > life ← (1,̈⊢)∨/⍛∧ 3 4=⍤0 ∞ ⦙+/ ((3∙#⍪9∙⍴)⍸1)∙⌽
> > qs ← ⊢∘̑(((⦙∇<#⊣),(=#⊣),(⦙∇>#⊣)) (⌷⍨?∘#))▫(0<#)
> > shuffle ← ⌷⍨ 0 1 ⍋⍛⍒⍛⍴⍨ #
> > P ← (0∙,+,∙0)⍣(⊢∘̑1̲)∘⍳
> > phi ← (≥∘÷)⍣∞ ⊢1
> > fib1 ← ⦙↑⍤1 (+/,↑)⍣(⊢∘̑1̲)
> > fib2 ← 1∧(≥∘÷)⍣(⊢∘̑1̲)
> >
> > I hope others might find this as fun as I have.
> >
> > -Marshall
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to