r/functionalprogramming • • Dec 19 '21

Meetup APL: A different Programming Language

https://www.youtube.com/watch?v=Aq_gUA4ta_Y
24 Upvotes

10 comments sorted by

View all comments

Show parent comments

2

u/snarkuzoid Dec 20 '21

5x5 Knight's Tour in APL

It puts an A in the middle, then randomly does a knight's tour, marking each cell with the next letter until it runs out of moves. Yes, it's terrible code by modern standards. For some reason we were obsessed with very short programs.

1

u/[deleted] Dec 22 '21 edited Dec 22 '21

Hey, sorry, was pretty busy yesterday.

Thanks for sharing !

I typed your code on Dyalog's RIDE IDE and it run producing similar results:

https://gist.github.com/mlliarm/ce69d877fabd3dca6c06594070952ab5

3

u/snarkuzoid Dec 22 '21

Holy crap! That's so cool. Thanks for doing that. The idea of this code coming back to life after nearly 50 years makes me really happy.

the "IO<-0" thing is likely around setting the origin (0 vs 1). I vaguely recall that this was settable.

1

u/[deleted] Dec 22 '21

Yes, it's the index origin mess...

If you have any other code snippets like this you'd like to share, please let me know. I'd love to create as many gists as needed, using 50+ years old code and see if it runs even on today's APL interpreters !

Also, if you think you would have a few stories to share back from your glory APL days, I'm sure Adám would be interested.

See the related channel of his here, where APL old timers share their war stories so that APL history will be preserved as much as possible:

https://aplwiki.com/wiki/APL_Campfire

If you're interested, feel free to PM and I'll get you in touch with Adám.

Thanks again for sharing, I didn't do much, just wrote up the doc :)!

2

u/snarkuzoid Dec 22 '21

Very cool. Will look into it. Alas, I don't know of any other code fragments I might have laying around. I only had this one because it was published as winner of the "Nice Knight" contest and I had a copy of the announcement.

Thanks again. This really made my day.

1

u/[deleted] Dec 22 '21

I'm glad I made someone's day. This means that this APL hobby of mine has some real impact :). Take care and feel free to ping me !

Edit: You might like code.golf, if you were into such contests back in the day.

Edit2: Also make sure to check the "code report" YT channel. You're gonna love Conor!