HNHacker News
TopNewBestAskShowJobs

rak1507

355 karma · joined May 20, 2021

uni student
submissionscomments
rak1507··on Array-programming the Mandelbrot set
You won't get anything from vapourware salesmen.
rak1507··on Array-programming the Mandelbrot set
It seemingly takes a long time to write good software too, co-dfns is infinity+1 years in progress...
rak1507··on Don't Force Your LLM to Write Terse [Q/Kdb] Code: An Information Theory Argument
There's a difference between one line and short/terse/elegant.

  {m:(x,x)#til x*x; r:til[x]-x div 2; 2(flip r rotate')/m} 
generates magic squares of odd size, and the method is much clearer. This isn't even golfed as the variables have been left.
rak1507··on Discrete Mathematics: An Open Introduction [pdf]
There aren't really any complicated arguments being made, so I don't think a proof would be that involved.
rak1507··on Discrete Mathematics: An Open Introduction [pdf]
You definitely don't need to know any of that background to be able to arrive at the answer. To fully understand everything maybe, but all it takes is:

a = x^1 + x^4 + x^7 + ... = x(1 + x^3 + x^6 + ...) = x/(1-x^3)

a + a^3 + a^5 + ... = a(1 + a^2 + a^4 + ...) = a/(1-a^2)

Substitute + simplify. I don't think this is beyond a (fairly smart) elementary school student.

rak1507··on Discrete Mathematics: An Open Introduction [pdf]
Why not? All that is really required is knowing 1/(1-x) = 1+x+x^2+... and a bit of algebraic manipulation.
rak1507··on APL Interpreter – An implementation of APL, written in Haskell (2024)
Isn't referencing a source exactly the right way to go about pointing out someone is essentially lying about their background/credentials? I'm surprised people do not care about accuracy.
rak1507··on APL Interpreter – An implementation of APL, written in Haskell (2024)
I remembered it, and it seems like a reasonable assumption that your first experience of APL being so bad would put you off doing any more in the future.
rak1507··on APL Interpreter – An implementation of APL, written in Haskell (2024)
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.

rak1507··on APL Interpreter – An implementation of APL, written in Haskell (2024)
Well, you've said you used APL professionally, but judging by https://news.ycombinator.com/item?id=31368299 it was in a university project.
rak1507··on Notation as a Tool of Thought (1979)
The append is the only thing that is O(1), finding the deletion mask is linear (≠ is linear, isn't it?) and the actual deletion is also linear (⌿ is also linear).

       ]runtime -repeat=1s 'v←k1 ⋄ v⌿⍨←v≠2'

 \* Benchmarking "v←k1 ⋄ v⌿⍨←v≠2", repeat=1s
 ┌──────────┬──────────────┐
 │          │(ms)          │
 ├──────────┼──────────────┤
 │CPU (avg):│0.008491847826│
 ├──────────┼──────────────┤
 │Elapsed:  │0.008466372283│
 └──────────┴──────────────┘
       ]runtime -repeat=1s 'v←k2 ⋄ v⌿⍨←v≠2'

 \* Benchmarking "v←k2 ⋄ v⌿⍨←v≠2", repeat=1s
 ┌──────────┬────────────┐
 │          │(ms)        │
 ├──────────┼────────────┤
 │CPU (avg):│0.8333333333│
 ├──────────┼────────────┤
 │Elapsed:  │0.83        │
 └──────────┴────────────┘
rak1507··on Notation as a Tool of Thought (1979)
The problem is that this isn't a "hashmap" in any meaningful sense, because all the operations are O(n).
rak1507··on What about K?
When it comes to subjective opinions, what other choice do you have? Your idea of doing studies is interesting but that's not even been done for most languages, yet claiming "python is unreadable" would clearly be laughable.

Either everyone who uses array languages does actually find them readable, or they're all persistently lying for... what reason? And forcing themselves to use something they don't find readable? Why would anyone do that! Especially considering a lot of array language users are hobbyists, who have chosen to use them, it's not like they're forced to.

rak1507··on What about K?
I had a peek at your github profile, and noticed "sqlutilpy", "Python module to efficiently query SQL databases and return numpy arrays". K is like if a language just did that by default.
rak1507··on What about K?
You have been talking about array languages on HN for at least 6 years, and still refuse to believe that anyone can read them!

What do you have to gain from this stance, and why don't you believe people who tell you otherwise?

rak1507··on What about K?
Personally I think the best comparison would be Python+Pandas/polars+... or R+tidyverse+..., the key thing being there's less need for the "..." in a language with good table manipulation etc built in.
rak1507··on The number pi has an evil twin
Do you mean f(x,n-1)^x or x^f(x,n-1)? With the first definition, c=1, the second, c=sqrt(2). I'm still not seeing the connection to omega.
rak1507··on The number pi has an evil twin
What do you mean by x^x^x^... = 2? Isn't the solution to that sqrt(2)?
rak1507··on Advent of Code 2024
I don't know if there's a specific k4 binary but you can run k4 through the q binary.
rak1507··on Advent of Code 2024
It's k4, the underlying language behind Q. With slight modifications it also runs in ngn/k which is FOSS.

https://ngn.codeberg.page/k/#eJxVjsFugzAMhu95iiyWik1CIGPtIVG...

rak1507··on Advent of Code 2024
What's so hard about Day 12? It's just

    +/'{x:".",x;H:(-1+;1+i-)@'+|\m*i:!#m:x=\:"#."
     R:(x=x)({[h;d;x;y;z](z#0),+\(((-z)_~"#"=x)&z_d>z)*(*y),(-z+1)_y-0^y h}. H)[x]/y
     (*|R)-R@*|0,&1_*+m}.''1({("?"/:5#,x;,/5#,y)}.')\@[;1;.:]'" "\:'0:`:i/12.txt
rak1507··on Arthur Whitney's one liner sudoku solver (2011)
Again, I'm not saying anything is impossible to do, it's just about whether or not it's worth it. 2 or 3 lines for all types for all overloads for all primitives etc adds up quickly.

I don't see how k/q tables are only superior in niche situations, I'd much rather (and do) use them over pandas/polars/external DBs whenever I can. The speed is generally overhyped, but it is significant enough that rewriting something from pandas often ends up being much faster.

The last bits about IPC and typed objects basically boil down to python being a better glue language. That's probably true, but the ethos of array languages tends to be different, and less dependent on libraries.

rak1507··on Arthur Whitney's one liner sudoku solver (2011)
This is (predictably) wrong.
rak1507··on Arthur Whitney's one liner sudoku solver (2011)
None of the primitives are necessarily too complicated, but off the top of my head things like /: \: (encode, decode), all the forms of @ \ / . etc, don't have directly equivalent numpy functions. Of course you could reimplement the entire language, but that's a bit too much work.

Tables aren't niche, they're very useful! I looked at cloudpickle, and it seems to only do serialisation, I assume you'd need something else to do IPC too? The benefit of k's IPC is it's pretty seamless.

I'm not sure what you mean by inefficient hacks, generally you wouldn't try to construct some complicated ADT in k anyway, and if you need to you can still directly pass a dictionary or list or whatever your underlying representation is.

rak1507··on Arthur Whitney's one liner sudoku solver (2011)
There are semantic differences too with a lot of the primitives that are hard to replicate exactly in Julia or numpy. That's without mentioning the stuff like tables and IPC, which things like pandas/polars/etc don't really come close to in ergonomics, to me anyway.
rak1507··on Arthur Whitney's one liner sudoku solver (2011)
Hmm, why not? Using K or a similar array language is a very different experience to using an array library like numpy.
rak1507··on Arthur Whitney's one liner sudoku solver (2011)
It wasn't able to explain the code, it was wrong.
rak1507··on Arthur Whitney's one liner sudoku solver (2011)
I cannot comprehend the mindset of people who decide to spam (because that is what your comment is) any forum with a page of bullshit GPT slop. Do you think it's helpful or interesting?
rak1507··on Arthur Whitney's one liner sudoku solver (2011)
Please kindly delete your account, destroy your devices, and move to the woods far away from technology.
rak1507··on Arthur Whitney's one liner sudoku solver (2011)
The underlying language isn't really very mathematical, at most there's a bit of linear algebra in the primitives but that's it. You certainly don't need any sort of formal maths education to learn APL. There are about 50 or so new symbols, which is not a big ask, with any sort of focus the majority of the syntax etc can be learned very quickly. The "bugs" in your original code stand out very clearly because things like "∘}" don't make sense, ∘ being "dyadic" (infix).
Page 1 of 7Next →