Live data from Hacker News

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

scharenbroch.dev

11–20 of 75 posts

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

#11
post #8

Earlier quoted context omitted.

Care to elaborate?

Well, you've said you used APL professionally, but judging by https://news.ycombinator.com/item?id=31368299 it was in a university project.

What a wild thing to comment.

a) “professional” writ large often encompasses academic research, even though it’s also often specifically used in contrast. Language is weird like that. Former and current academics like to have a term for all the stuff we’ve been paid to do, and we usually default to “professional experience” (though current academics do usually say “research experience” because you’re right that professional has the default connotation of corporate employment).

b) the project seems to have been over 2000 lines of APL. That’s not the “small” student project you’re implying, in any language, and in APL that’s quite substantial.

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

#12

> Apparently Haskell’s performance isn’t that bad, but I don’t plan on using Haskell for anything that is remotely performance-sensitive. Trying to optimize Haskell code does sound like an interesting problem, but it might be a lost cause. When the dude uses `foldl` over lists and `foldr` with `(*)` (numeric product) it is not the language that's the lost cause.

In case anyone who doesn't know Haskell: both of these are beginner level mistakes. Using `foldl` causes space leaks and turns your O(1) space algorithm to O(N) space for no good reason. And using `foldr` over lists is good when you are dealing with unevaluated lists and want list fusion, but not when they already exist in memory and will continue to do so. And that doesn't even include the obviously wrong choice of data structure, built-in Haskell lists are singly-linked lists not arrays. There are Array types and Vector types (both come with GHC so no extra dependency needed) that are more appropriate for implementing APL in the first place.

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

#13
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.

Not that I have found, closest is an incomplete one done in python.

https://mathspp.com/blog/tag:lsbasi-apl#body-wrapper

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

#14
post #8

Earlier quoted context omitted.

Care to elaborate?

Well, you've said you used APL professionally, but judging by https://news.ycombinator.com/item?id=31368299 it was in a university project.

They described it as "a non-trivial APL application" that they worked on for two years.

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

#15
post #8

Earlier quoted context omitted.

Well, you've said you used APL professionally, but judging by https://news.ycombinator.com/item?id=31368299 it was in a university project.

What a wild thing to comment. a) “professional” writ large often encompasses academic research, even though it’s also often specifically used in contrast. Language is weird like that. Former and current academics like to have a term for all the stuff we’ve been paid to do, and we usually default to “professional experience” (though current academics do usually say “research experience” because you’re right that profe…

Most of it is boilerplate or written like it is Java, so it is pretty small compared to any real world projects.

To me professional implies production/real world/paid work, not just an unfinished academic project.

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

#16
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 installing yet another GHC version and building, I eventually ctrl+C'd and closed out of the window.

Maybe this was a unique experience, but I'd love some guidance on how to be successful with Haskell. I've primarily spent most of my professional years building web services, so that was the first place I went to. However, I was taken aback by how seemingly awful the setup and devex was for me. I've always been interested in functional programming, and was looking to sink my teeth in to a language where there is no other option.

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

#17

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…

My understanding is that Cabal has more or less supplanted Stack. Use GHCup to install everything, then use `cabal init`, `cabal run`, or `cabal repl` like you would in Go/Rust.

Stack builds on top of Cabal, and used to solve a bunch of problems, but the reasons for it's existence are no longer super relevant. It still works totally fine if that's your thing though.

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

#18

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…

The easiest and fastest way to get everything installed is ghcup https://www.haskell.org/ghcup/

As for being successful, there are several nice books, and several active forums. I've gotten good answers on the Libera IRC network #haskell channel, and on the Haskell matrix channel #haskell:matrix.org

If you want to get started without installing anything, there's the exercism track: https://exercism.org/tracks/haskell

I've heard good things about Brent Yorgey's Haskell course ( https://www.cis.upenn.edu/~cis1940/spring13/lectures.html ) but haven't tried it myself.

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

#19
post #8

Earlier quoted context omitted.

Well, you've said you used APL professionally, but judging by https://news.ycombinator.com/item?id=31368299 it was in a university project.

What a wild thing to comment. a) “professional” writ large often encompasses academic research, even though it’s also often specifically used in contrast. Language is weird like that. Former and current academics like to have a term for all the stuff we’ve been paid to do, and we usually default to “professional experience” (though current academics do usually say “research experience” because you’re right that profe…

[deleted]

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

#20

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…

[deleted]
Post reply on HN