Live data from Hacker News

APL Interpreter – An implementation of APL, written in Haskell (2024)

scharenbroch.dev

31–40 of 75 posts

Re: APL Interpreter – An implementation of APL, written in Haskell (2024)

#31
post #9

Is there an implementation of an APL language (or other any other array language) written in * readable* C that is around 1000 LoC? There are for LISP, FORTH, Prolog, TCL and the like.

Unlikely, at least for what I think you mean by "readable" here.

APL isn't really one of these exhibitions of computational simplicity in the way of the languages you mention. It's inventor, Kenneth Iverson, was more focused on the human side of thinking in and using the language.

Forth, Lisp, et al are quite easy to implement, but they require considerable library layers on top to make them useful for expressing application-level logic, even if we just focus on the pure functions. APL, on the other hand, has a larger core set of primitives, but you're then immediately able to concisely express high-level application logic.

Are you looking for a kind of reference implementation for learning purposes? If so, I'd say the best route is just go with the docs. Arguably the Co-dfns compiler is a precise spec, but it's notably alien to non-practitioners.

Re: APL Interpreter – An implementation of APL, written in Haskell (2024)

#32
post #9

Is there an implementation of an APL language (or other any other array language) written in * readable* C that is around 1000 LoC? There are for LISP, FORTH, Prolog, TCL and the like.

Unlikely, at least for what I think you mean by "readable" here. APL isn't really one of these exhibitions of computational simplicity in the way of the languages you mention. It's inventor, Kenneth Iverson, was more focused on the human side of thinking in and using the language. Forth, Lisp, et al are quite easy to implement, but they require considerable library layers on top to make them useful for expressing app…

Any pointers on how to get better at expressing high-level application logic in APL? Any good resources on programming in APL? So far I have only found tutorials and basic stuff for learning APL but not much on applying APL. I am slowly improving and think I sort of get it but probably don't.

Re: APL Interpreter – An implementation of APL, written in Haskell (2024)

#33
post #5

[flagged]

Please don't dig up historical comments in order to diminish someone's present-day comments or work. We can't know what has happened between then and now.

We detached this subthread from https://news.ycombinator.com/item?id=44196205 and marked it off topic.

Re: APL Interpreter – An implementation of APL, written in Haskell (2024)

#34

Earlier quoted context omitted.

Unlikely, at least for what I think you mean by "readable" here. APL isn't really one of these exhibitions of computational simplicity in the way of the languages you mention. It's inventor, Kenneth Iverson, was more focused on the human side of thinking in and using the language. Forth, Lisp, et al are quite easy to implement, but they require considerable library layers on top to make them useful for expressing app…

Any pointers on how to get better at expressing high-level application logic in APL? Any good resources on programming in APL? So far I have only found tutorials and basic stuff for learning APL but not much on applying APL. I am slowly improving and think I sort of get it but probably don't.

Not that I know of, unfortunately. This is, IMHO, the biggest pain point of APL pedagogy at the moment. I'm actually working on some resources, but they're still gestating.

For non-event driven systems, the short story is to organize application state as a global database of inverted tables and progressively normalize them such that short APL expressions carry the domain semantics you want.

For event driven systems, we have token enumeration over state machines, which can be expressed as literal Branches to state blocks.

Granted, the above likely doesn't communicate well unless you're already primed with all the necessary ideas. If you're interested, I'm willing to chat. Email is in my profile description.

source: Current day-to-day is greenfield APL dev.

Re: APL Interpreter – An implementation of APL, written in Haskell (2024)

#35

Interesting read! On a semi-related topic: I tried learning Haskell this past weekend out of curiosity that I last tried it some 10+ years ago while still in college. I found resources for it scant. Coming from more modern languages/tooling like Go/Rust, I also struggled quite a bit with installation and the build/package system. I tried the stack template generator for yesod/sqlite and after some 15 minutes of it in…

I learned using the Haskell Programming from First Principles book (haskellbook.com). I don't think it goes into web development, but it certainly goes through the basic project setup.

Do you think you would have benefitted from a resource like the Rust book? I've been toying with the idea of writing something similar and donating it to the Haskell Foundation

Re: APL Interpreter – An implementation of APL, written in Haskell (2024)

#37
post #9

Is there an implementation of an APL language (or other any other array language) written in * readable* C that is around 1000 LoC? There are for LISP, FORTH, Prolog, TCL and the like.

ngn's k is publicly available, around 1000 lines and readable, in that I can read it.

Re: APL Interpreter – An implementation of APL, written in Haskell (2024)

#38

Interesting read! On a semi-related topic: I tried learning Haskell this past weekend out of curiosity that I last tried it some 10+ years ago while still in college. I found resources for it scant. Coming from more modern languages/tooling like Go/Rust, I also struggled quite a bit with installation and the build/package system. I tried the stack template generator for yesod/sqlite and after some 15 minutes of it in…

https://typeclasses.com/phrasebook is a good resource

Re: APL Interpreter – An implementation of APL, written in Haskell (2024)

#39

Earlier quoted context omitted.

Unlikely, at least for what I think you mean by "readable" here. APL isn't really one of these exhibitions of computational simplicity in the way of the languages you mention. It's inventor, Kenneth Iverson, was more focused on the human side of thinking in and using the language. Forth, Lisp, et al are quite easy to implement, but they require considerable library layers on top to make them useful for expressing app…

Any pointers on how to get better at expressing high-level application logic in APL? Any good resources on programming in APL? So far I have only found tutorials and basic stuff for learning APL but not much on applying APL. I am slowly improving and think I sort of get it but probably don't.

What would you consider "high-level application logic"?

Re: APL Interpreter – An implementation of APL, written in Haskell (2024)

#40

Earlier quoted context omitted.

Any pointers on how to get better at expressing high-level application logic in APL? Any good resources on programming in APL? So far I have only found tutorials and basic stuff for learning APL but not much on applying APL. I am slowly improving and think I sort of get it but probably don't.

Not that I know of, unfortunately. This is, IMHO, the biggest pain point of APL pedagogy at the moment. I'm actually working on some resources, but they're still gestating. For non-event driven systems, the short story is to organize application state as a global database of inverted tables and progressively normalize them such that short APL expressions carry the domain semantics you want. For event driven systems,…

>IMHO, the biggest pain point of APL pedagogy at the moment

It is the one that always trips me up. I just started in on my third attempt at learning APL/array languages, both previous times I got to the same point where I was mostly at a loss of how to apply it all. So I move on and forget all that I learned until the next time and have to start over. Thankfully the last attempt seems to have mostly stuck as far as keyboard layout goes, makes progress much quicker.

I may take you up on that email offer once I get a bit further along in this current attempt, can't quite form reasonable questions yet and only know what tripped me up in the previous attempts. I believe you are a regular on APL Orchard? I will be joining it soon so perhaps will see you there.

Post reply on HN