• puckpuckpuckow@lemmy.world
    link
    fedilink
    arrow-up
    8
    ·
    3 months ago

    Such a strange website. Pretty decent content, but just lying around as HTML/js/css files without a coherent layout to tie them all together? Reminds me of good ol’ internet.

    • matsdis@piefed.social
      link
      fedilink
      English
      arrow-up
      7
      ·
      3 months ago

      Yes, I like it. It makes only one (big) mistake: a horizontal table-of-contents. Nobody does that. You can put it on the left, or above the text, but… not like that.

    • furry toaster@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      4
      ·
      3 months ago

      wdym coherent layout? this thing looks more coherent than any reactwebbloatapp i have seen

      it is also very mobile friendly, no lag while scrolling because react is being the bloated garbage it is

      • puckpuckpuckow@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        3 months ago

        I mean overall website, not the page itself. The page is super, but if you fiddle with the url a bit, the site has more nice content. But each page is different and seemingly don’t connect from other pages.

  • FizzyOrange@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    3 months ago

    Experience has shown that having a map as your only data structure is definitely a mistake. It’s much better to support real arrays too. I doubt it would have made the implementation significantly more complex either (maybe even simpler for luajit).

    • [object Object]@lemmy.world
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      edit-2
      3 months ago

      Idk, PHP chugs on splendidly with arrays that combine both arrays and maps. I regret to say that PHP is considerably faster than some better languages like Python and Ruby, and arrays are the workhorse structure there.

      (Like, PHP’s approach to FastCGI is that the script’s runtime is destroyed after every request and then started anew for the next one, and it still outperforms Python’s always-on approach. Of mainstream languages, only Node can compete.)

  • lime!@feddit.nu
    link
    fedilink
    arrow-up
    19
    ·
    3 months ago

    i think the most interesting design detail of lua tables is just glossed over as “nil-holes” in this article. namely, that nil values do not exist. there is no table.delete(key) method, you just zero out the value and the key stops existing. the same thing is true for any variable, if you set it to nil it ceases to be. i find that implementation fascinating.

    • thingsiplay@lemmy.ml
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      I assume they did that for performance reasons, because removing entries is slow probably? From user perspective, it would have made it more sense to remove the key instead defining it as nil and then expecting the user to handle the nil. The key does not stop existing, right? I don’t program in Lua.

    • [object Object]@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      edit-2
      3 months ago

      Except it’s ass if you want to do non-destructive data processing of arbitrary structures and your input and output might have null as a value. You can’t just know about fields a, b, and c of the table and leave everything else as it is, you need to know the whole structure and make sure you write null in the output for fields that have nil in them.

      Or, more realistically, use libraries that implement null as custom user data.

      Iirc Roberto Ierusalimschy even considered introducing a null value in one of the recent versions, of course confusingly named ‘undefined’ — but changed his mind. Perhaps it’s for the better than to have such a backwards name for it.

      To my knowledge, Lisps like Emacs Lisp implement this better: trying to get a value for a nonexistent key will get you nil, but you can still retrieve the list of all keys, including ones that are set to nil.