Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Node-APL: APL interpreter written in JavaScript (github.com/planetapl)
35 points by bryanrasmussen on Feb 17, 2018 | hide | past | favorite | 12 comments



The original has more recent commits:

https://github.com/ngn/apl


Sorry, I was looking for Node APL connections, had scrolled down to the readme and gotten overly excited. Realized it was a fork past the edit window. Anyway to get it changed to the original once edit window is gone?


Why does this HN entry even have the fork, if it doesn't have commits that ngn/apl doesn't have?


I can faintly understand the usefulness of this in a browser context, but why would you ever run APL over node... Very cool learning project though.


Well, having an online APL interpreter means there's no need to download one for basic stuff. Also, most APL interpreters are only for non-commercial use (with a price for commercial use) or not at all free. The only two totally free interpreters I know of are NARS2000 and GNU APL. Last, but not least, ngn/apl has some features other variants don't, for example monadic/dyadic function combination (⍠ operator) and monadic/dyadic D-function combination (one D-function containing ; to separate the monadic and dyadic functions), as well as explicit returns (⍫ function, only usable in D-functions) and infinity (¯ and ∞ literals, as well as their negatives ¯¯ and ¯∞).


There’s also a JavaScript impl of K, one of the ASCII APL-like languages:

https://github.com/JohnEarnest/ok


A blast from the past. Amazing language for math. My friends and I tried to write entire programs as one line of code, something possible in APL.


I would love to see a js interpreter for J.


What I would love to see, for my day to day use, is a language which borrows the good ideas from array languages and applies them in a 21st century context.[0]

Which I guess pretty much boils down to more powerful operators that work on arrays and can be ranked (and a few other niceties like native complex numbers).

For me J is not much more than a very powerful calculator that I end up never using. And it's a shame because it has great ideas.

[0] I have not used APL or K extensively but I tried learning J about 3 or 4 times in my life and I always leave (and forget) it just because of its obtuse syntax (read: forks, hooks, verb trains and other point-free intricacies) and unmaintainable obsession with terseness (so much that I've been told the correct way of using J is to not be terse at all).


I haven't used it much, but I believe the numpy library (I know, not a language) sort of fits the bill of "a language which borrows the good ideas from array languages and applies them in a 21st century context". In any case, I know they've taken a lot of the ideas -- not sure how well they've made use of them.

As for J, I disagree that it's "not much more than a very powerful calculator" -- it's backed by a deep computational paradigm, and is closer to a work of art than any other language I've seen. The power arising from the small selection of interacting primitives, the harmony of combinators built directly into the syntax, the metaphor with natural language, and much more. It's also somehow more fun and satisfying to solve problems in J than other languages.

That said, it is by far the most difficult programming language I've ever learned. I'd say it took a year of part-time tinkering before it started to click, and I'm still not an expert. But the effort was worth it just for the lesson of how different things can be.


>> non-zero index origin (⎕IO)

eeeh, that's kind of an issue. A lot of apl assumes ⎕IO←1


I ran into this recently myself. The default implementation is 1 based, but a lot of APL users override it to 0, so that trips up a lot of beginners.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: