HackerTrans
TopNewTrendsCommentsPastAskShowJobs

pillmillipedes

38 karmajoined há 2 meses
hackernews user pillmillipedes

Submissions

Introduction to Making Makefiles (2003)

jfranken.de
42 points·by pillmillipedes·há 18 dias·6 comments

GNU C/C++ Vector Extensions

gcc.gnu.org
4 points·by pillmillipedes·há 18 dias·1 comments

comments

pillmillipedes
·há 10 horas·discuss
I think putting the buckets in eytzinger layout might help with cache locality here? though on the other hand they might all fit into cache anyways..

I'd also want to try interpolation search for this (not necessarily linear interpolation since we're doing floats) - you can take much better guesses than "it's in the middle somewhere" by not having to look at the data through a 1-bit-wide pinhole as comparison algorithms do.
pillmillipedes
·ontem·discuss
you might be confused as to what terrific means
pillmillipedes
·anteontem·discuss
[dead]
pillmillipedes
·há 4 dias·discuss
have you seen the website for the latest version of k? "barely a website" doesn't even begin to describe it

https://k.nyc
pillmillipedes
·há 4 dias·discuss
talking about the linked parser which is clearly claude's not arthur's
pillmillipedes
·há 5 dias·discuss
[1] seems to have the actual details on compressed vectors. looks like for each page you're storing min&max, and the values come as offsets from the min (smaller->less bits per value), did I get that right?

  primitive speedup  
  sum price 7.7x  
  avg price 33x
how does this even happen though?

[1]https://lv1.sh/blog/compression-memory-wall/
pillmillipedes
·há 12 dias·discuss
I don't mind discussing syntax when appropriate, but this feels like arguing over which trivial brainfuck substitution[1] is the best.

> monoid

nullables with `??` and `?.` are also give-or-take monoids. is it common though to `or` two MaybePhoneNumbers together or to apply a PhoneNumber->MaybePhoneNumber function to it? if not then why mention it?

let's see something meaningfully different like a database schema.

[1] https://esolangs.org/wiki/Trivial_brainfuck_substitution
pillmillipedes
·há 12 dias·discuss
if a user with/without phone number are equally valid states to be then types won't help you much. I think it's more about writing

  class User{phone: ?PhoneNumber}
over

  class User{phone: ?string}.
pillmillipedes
·há 12 dias·discuss
right, but it appears they prioritize sending a strong signal to the people this *is* for over attracting some normies. keep it smol. if I were them and I wanted to address the outgroup I might start the article with "the old computer challenge is" or "this year's old computer challenge is", for example, instead of "the old computer challenge community is".
pillmillipedes
·há 16 dias·discuss
interesting algorithm. if you can limit nesting depth to 255, the radix (now counting) sort version would become decently performant too. I think that's quite reasonable unless there's some unholy preprocessor-based metaprogramming going on
pillmillipedes
·há 16 dias·discuss
sorry, I keep misreading that word as slopreneurs - though I suppose that's not entirely wrong either
pillmillipedes
·há 17 dias·discuss
relevant xkcd: https://xkcd.com/2501/
pillmillipedes
·há 18 dias·discuss
more intuitive than this article or just make in general?
pillmillipedes
·há 18 dias·discuss
this is my preferred way of writing SIMD code, but it seems relatively unknown compared to the immintrin library or other, more modern SIMD libs.

bonus fact: if you explore e.g. clang's immintrin headers, you will quickly discover that every single SIMD function and type is just a one-line wrapper around this API, making them mutually compatible.

also, unlike some template-based solutions, clang can easily perform optimizations on these types: https://godbolt.org/z/EvMcxoGeG
pillmillipedes
·há 19 dias·discuss
in math it's often the case that you notice the solution first and only afterwards prove to yourself that it works. pattern matching and intuition play a large role in math!

this is why I'm not a big fan of "show your work": the "work" is however many years it took to build up my intuition, and often any explanation I could type out for my solution would be a retroactive rationalization. it's still useful, sure -especially for catching your errors, but I place it on the opposite end of the open-fake scale than most people.

of course here the proof is simple: 20 right moves, 20 down moves, any order => of 40 total moves choose any 20 indices to be your down moves => 40 choose 20 is your answer. would that teach you how to solve the next problem though? I'm not so sure.
pillmillipedes
·há 21 dias·discuss
various SQLs and APLs come to mind :) the industry still has a lot to learn from them both
pillmillipedes
·há 21 dias·discuss
one wonders what notations are we encumbered by even now, without noticing it
pillmillipedes
·há 22 dias·discuss
they did count in tens, as most civilizations did, though not exactly in "decimal". so 2345 would be either written out as MMCCCXXXXIIIII (but replace the letters with hieroglyphs), or sometimes spelled out phonetically. they had words for twenty, thirty and so on.

so obviously they can factor numbers and they know eighteen is 2*9 and twenty is 2*10 and that they can simplify when dividing 18 by 20, it's just that they don't consider 9/10 a finished result.
pillmillipedes
·há 26 dias·discuss
a script ten lines long perhaps?
pillmillipedes
·há 27 dias·discuss
an array language. now I'm working on the tokens->three address code->bytecode translation. I'm hoping to get that done this week, then start implementing the more important builtins&library functions. you'd be surprised how many functions you can bootstrap just by implementing grade/argsort.

for example:

  // C++ (naive version, sorry)  
  vector<int> bin(vector<int>& x, vector<int>& y) {  
    vector<int> r;  
    for (int a:x) r.push_back(lower_bound(y.begin(),y.end(),a) - y.begin())  
    return r;  
  }



  # Jet  
  ord<<{x asc asc} # double grade idiom  
  bin<<{y,x ord drop len[y]-ord[x]-1}  

or course this is not at all apples to apples, though it works to show the difference in possible approaches. in C++ I'm just turning an already implemented binsearch into something useable for arrays, and in jet I'm doing some weird array tricks to implement it from scratch using grade up (asc).

moreover, the C++ solution is O(m*log(n)) and jet is O(m+n) (though with a large constant factor) - but of course we can do much better once I implement it as a real builtin