Live data from Hacker News

Viewing profile — sparkie

sparkie

HN member
Joined
Wed, Feb 15, 2012, 3:02 PM UTC
HN karma
2,285
Public activity
1,619 items

About sparkie

No profile information was provided.

Recent public activity

  1. comment
    Comment #49251781

    That's not entirely true, but it's a valid reason to prefer using musttail. `register` is a hint if you don't specify which register you want to use - however, if you specify the r…

  2. comment
    Comment #49250746

    > What practical patterns are enabled by TCO in C? Continuation Passing Style - an important construction for interpreters, but which is also useful for compilers as it's a nice wa…

  3. comment
  4. comment
    Comment #48514768

    That may be true, but it may also mean you utilize more memory than you need to. If you aren't shrinking the array when you no longer need previously allocated capacity then you're…

  5. comment
    Comment #48514727

    I don't think it's that rare. I've been using the technique for years, and I've seen it done in other work. Bagwell's VList[1] for example uses the equivalent of `bit_ceil` to dete…

  6. comment
    Comment #48514430

    If you use a struct with a `void*`, you also need to specify the type on usage, where here it's done with `typeof`.

  7. comment
    Comment #48514376

    In C23 this approach is nice, but in older versions of C we end up with awful macros where we need to define the structure before we use it. #define Array(T) struct array_##T #defi…

  8. comment
    Comment #48514347

    The reason the struct is avoided here is so the array can be typed to its element type (rather than casting to and from `void*`). With a struct we would need one struct for each el…

  9. comment
    Comment #48514302

    The concept of not storing capacity isn't silly. If you need to reserve space then it's not the appropriate structure, but it's otherwise fine. However, using an 2-element array to…

  10. comment
  11. comment
    Comment #48514205

    Really? It's been done plenty and I thought was quite common knowledge. Some of the provided functions are basically for this purpose. stdc_bit_ceil(len) gets the smallest power of…

  12. comment
    Comment #48340307

    Bitcoin has a variable width encoding (`CompactSize`), but it doesn't prevent overlong encodings - however there are various canonicalization rules in the Bitcoin protocol to requi…

  13. comment
    Comment #47982536

    The C charter has a rule of "no invention". Anything needs to be demonstrated and used in practice before being included in the standard. The standard is only meant to codify exist…

  14. comment
    Comment #47967355

    Lisps are expression based languages, but not pure. It's easy to mistake it as "like most other languages", but it's not quite the same - everything is an expression and returns a …

  15. comment
    Comment #47967243

    Operatives are based on FEXPRS from older lisps - they're basically a function-like form, but where the operands are not implicitly reduce at the time of call. (foo (+ 2 3) (* 3 4)…

  16. comment
    Comment #47963608

    There's no "external representation" for environments. In klisp it will just print: [#environment] The environment type is encapsulated, so it doesn't give you very useful debug in…

  17. comment
    Comment #47960520

    I use klisp[1] and bronze-age-lisp[2] mostly for testing, as they're the closest to a feature complete implementation of the Kernel Report. I've written a number of less complete i…

  18. comment
    Comment #47960496

    I understand the use case, but Scheme macros never felt intuitive to me. I think it may be the quotation more than anything that I dislike - though I also dislike that they're seco…

  19. comment
    Comment #47960237

    Operatives do that for me, better than macros. Parent is correct that macros are compile time, which gives them a performance advantage over operatives - but IMO, they're not bette…

  20. comment
    Comment #47957789

    In Kernel I would use something like this: true #t false #f null () [...] (& ...) "k" : v (: k v) {...} (@ ...) Where &, :, @ are defined as: ($define! & ($lambda args (cons list a…

  21. comment
    Comment #47957232

    When I learned Scheme, I liked the language but strongly disliked macros and quotation. I'd only been using it a short while and when I searched for solutions to a few problems the…

  22. comment
    Comment #47781063

    It's potentially useful for computer algebra with complex numbers - we might be able to simplify formulas using non-standard methods, but instead via pattern matching. We might use…

  23. comment
    Comment #47767887

    The difference is that 90s games had novelty at the time - many introduced new gameplay ideas. A lot of today's AAA games have converged into a small number of genres like the open…

  24. comment
    Comment #47763304

    The subway system in Kyoto (Karasuma line) is operated by the local government. I visited during the busiest time of the year (Gion matsuri), and the trains were not overcrowded, w…

  25. comment
    Comment #47763105

    If you intend to do a fair amount of travelling and your stay is Probably not worth it if you're only visiting one city as the pass is quite expensive. There are regional tourist p…