Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rak1507
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
rak1507
2y ago
Please kindly delete your account, destroy your devices, and move to the woods far away from technology.
32.
▲
by
rak1507
2y ago
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 5
33.
▲
by
rak1507
2y ago
There are a lot of things in various programming languages which are hard to remember, but k and array languages have such a small surface area, not being able to remember it while working with it daily amounts to learned helplessness. (sou
34.
▲
by
rak1507
2y ago
I don't know what you mean by the q array operations being defined in the standard library. Yes there are things defined in .q, but they're normally thin wrappers over k which has array operations built in.
35.
▲
by
rak1507
2y ago
I'm not sure why it would be any more impressive or surprising than the billions of people who read and write in non English alphabets
36.
▲
by
rak1507
2y ago
The volatility calculation looks like it should be doable in q/k, I'm not sure about the more complicated stuff but at the end of the day it's a general purpose language too so anything is possible. KDB being columnar means t
37.
▲
by
rak1507
2y ago
I don't see how it could, the terseness is the point. I'm not sure how a macro system could really help. Did you have a specific idea in mind?
38.
▲
by
rak1507
2y ago
It's not ad infinitum on finite lists though, that's the point. If you want that property to hold, then maximum [] has to be -inf.
39.
▲
by
rak1507
2y ago
No. I think the maximum of (x:xs) should be equal to max x (maximum xs). (Using haskell notation). Logically this implies maximum [] should be -infinity if it is defined. On finite lists, maximum is also the same as the supremum, and on inf
40.
▲
by
rak1507
2y ago
I agree that the maximum of an empty array should be -infinity. As does K! (numpy does not)
41.
▲
by
rak1507
2y ago
Doesn't work on empty arrays, whereas the K does and gives the reasonable result of 0 (for total water) and -inf for maximum height. Maybe it doesn't matter, but sensible defaults are a good thing! Edit: didn't look at the er
42.
▲
by
rak1507
2y ago
You've sort of answered your own question. None of those three would obviously mean the same thing to me. And that's just one possible combination. If you consider all possible combinations of 4 symbols in K, most of them will hav
43.
▲
by
rak1507
2y ago
If you want a serious answer, as a k programmer ||\|x (which I assume your example is based on) is instantly readable as producing a bitmask of ones up to the last. ie 0 1 0 0 1 0 -> 1 1 1 1 1 0. Or a max scan from the right on integer a
44.
▲
by
rak1507
3y ago
Most "production" APL is pretty verbose. See https://github.com/Dyalog/Jarvis/blob/master/Source/Jarvis.d... for example
45.
▲
by
rak1507
3y ago
In case anyone is curious about if the system is still used 12 years later, the latest thing I could find was from a job advert https://app.verama.com/job-requests/40623 "This application is built in using Dialog[
46.
▲
by
rak1507
3y ago
I'm pretty sure the K solution is O(n)? Both group and unique should be O(n).
47.
▲
by
rak1507
3y ago
It's hard to think of concrete benefits on the spot when the biggest benefit is the somewhat nebulous "feel" of the language. But generally: array languages typically make use of composition of primitives rather than larger,
48.
▲
by
rak1507
3y ago
The original comment said learning "array languages". There's some debate about what that means, but generally it means APL/J/K/etc not numpy/matlab/etc. As far as I can tell (correct me if I'm w
49.
▲
by
rak1507
3y ago
I'm sure people who are into retrocomputing or spicy food or any other topic could tell you why they prefer that to something more mainstream. Whether or not you would agree, you could recognise that they had different opinions. The is
50.
▲
by
rak1507
3y ago
If numpy/matlab/octave/... was 'all the same stuff' with none of the downsides and all of the benefits, why would k or array languages in general have such a passionate community? Either every arraylang-er is masoch
51.
▲
by
rak1507
3y ago
You can do 'regular' stuff in array languages too. And distributed searching/sorting sounds like something array languages would be good at anyway. kdb being the obvious example. The IPC in q for example is very easy to use,
52.
▲
by
rak1507
3y ago
FWIW I think array language communities are generally very friendly and helpful too. Not many programming languages/companies employ people to help people in chatrooms.
53.
▲
by
rak1507
3y ago
As an array language fan I also feel like a lot of the reasons people give for why array languages are powerful are outdated, and sometimes (not all the time) that's because someone tried both APL and C in the 1970s and their opinions
54.
▲
by
rak1507
3y ago
There aren't really that many, not when you compare it to the total number of python/ruby functions that would be roughly equivalent. (Ignoring the fact a lot of k functions operate by default on matrices and other nested structur
55.
▲
by
rak1507
3y ago
Trying to communicate about @[d; i; f; y] works once you know what that does. Like with any mathematical notation, it's given a name just like '+' has a name (plus). I don't know if it's "inherently" sup
56.
▲
by
rak1507
3y ago
It would do if it the bits weren't reversed, which is done with |
57.
▲
by
rak1507
3y ago
If you go to the link and press 'help' you'll see some docs for ngn/k The relevant line is I\ encode 24 60 60\3723 -> 1 2 3 2\13 -> 1 1 0 1 So (8#2)\x encodes x in binary, with 8 positions. And because k is an
58.
▲
by
rak1507
3y ago
The k solution is ,/+|(8#2)\textb k doesn't have a right shift operator, but you don't need that, you can use the base encoding operator instead Personally I think this is clearer than both the array-ish python and the list c
59.
▲
by
rak1507
3y ago
Work with numpy from q or q from python? I'm not sure why you'd use numpy when you have access to k/q, they're much nicer.
60.
▲
by
rak1507
3y ago
AOC is pretty low stakes, so it doesn't really make sense to put too much effort into it. For the average person they can get a lot faster by automating all the input downloading/submitting/etc and writing a huge number of ut
More ›