News for hackers. Stuff that matters.
Re:APL: An Array Oriented Programming Language (2018) by chrispsn on Thursday March 30, 2023 @07:08PM (#35380104)
I don't think user-level definitions of custom symbols are that useful, but for what it's worth, you can do it in ngn/k...

    (Π):!/:  / make table
    
    Π[`a   `b
     ( 1    2
       3    4)]
Re:APL: An Array Oriented Programming Language (2018) by mlajtos on Friday March 31, 2023 @05:16AM (#35384485)
TIL that ngn/apl and ngn/k supports user-defined symbols. Thank you!

Creating custom notation (aka DSL) can be very liberating. As Iverson noted, having a good notation enables you to think previously unthinkable thoughts. Einstein’s theory of relativity was enabled by use of his sum notation. [0]

Of course, it should be paired with the right user interface. Inputting non-ASCII chars on keyboards is still pretty cumbersome. But APL with its weird symbols is perfect for paper and pencil, where it has its origins. [1]

Some might see pencil-and-paper interface for an array-oriented REPL as going backwards, but I consider pencil to be mightier than the keyboard. Finally you could sketch visually your algorithm beside the runnable code.

[0]: https://en.m.wikipedia.org/wiki/Einstein_notation [1]: https://mlajtos.mu/posts/new-kind-of-paper