• 3 Posts
  • 254 Comments
Joined 3 years ago
cake
Cake day: January 13th, 2022

help-circle



  • I don’t think, there’s currently any plans to introduce a non-JS API for accessing the DOM. It would just take an insane amount of implementation work + documentation.

    But frameworks can generate access code for you, so you don’t actually need to write any JS yourself. Rust is quite far ahead in this regard, thanks to the wasm-bindgen library.


  • I mean, so far, all of them require tons of humanly produced data.

    Discriminative AI (deep learning et al) requires humans to label data for hours on end, per use-case.
    And generative AI (LLMs et al) require just insane amounts of human works to copy from, albeit not necessarily limited to individual use-cases.

    I guess, what I’m saying is that the ratio of how much labor humans (involuntarily) invested into AIs, compared to the labor these AIs actually perform, is likely a lot higher than 70%.


  • It’s a thing here in Europe. I’m guessing, because our walls are generally concrete, we usually either throw on decorative plaster or a wallpaper, to make it feel a bit warmer and have a uniform surface which accepts paint more readily.

    It’s even quite common that if you rent an appartment, that the walls have wallpaper on them, which is painted with a fresh coat of white paint every time someone moves out and the next folks move in.
    And then some people, after they move in, will just paint (some of) the walls in a different color, if they feel like not living in pure white…



  • I have my repos on Codeberg and one of the ‘disadvantages’ is that, well, it’s a non-profit, so I genuinely don’t want to waste their resources.
    They ask you to only host open-source repos there, meaning that using it for backups of shitty personal projects, even if I would throw in an open-source license, is just out of the question for me.

    And that has weirdly been a blessing in disguise. Like, if it’s not useful for humanity to see, do I really care to keep it around forever?

    And I’ve had three projects now where I felt an obligation to push them over the finish line of actually making them a useful open-source project. Which had me iron out some of the usability shortcuts I took, made me learn a good amount of code quality stuff and of course, just feels good to complete.


  • It looks similar in structure to JSON:

    {
        "attr": {
            "size": "62091",
            "filename": "qBuUP9-OTfuzibt6PQX4-g.jpg",
            ...
        };
        "key": "Wa4AJWFldqRZjBozponbSLRZ",
         ...
    }
    

    So, it might be some JSON meta language. I just find it weird that it seems to contain all data, so you wouldn’t use this for validating or templating JSON.

    But ultimately, it also means with a handful of regex replacements, you could turn this particular file into JSON. Might make building your own parser almost trivial…


  • Ah, true. Thanks.

    Theoretically, it was supposed to be pseudo-code, secretly inspired by Rust, but I did get that one mixed up.

    And I am actually even a fan of the word unwrap there, because it follows a schema and you can have your IDE auto-complete all the things you can do with an Option.
    In many of these other languages, you just get weird collections of symbols which you basically have to memorize and which only cover rather specific uses.




  • Yeah, it’s especially bad, when a library doesn’t provide type hints itself. It can be comically difficult to find out what the return type of a function is, because every if-else-branch might have a different return value, so you may need to read the function body in full to figure out what the type might be.

    Add to that, that lots of the tooling around type hints isn’t as fleshed out / useful as it is in fully typed languages and I can definitely understand why someone might not immediately feel like it’s a valuable use of their time.





  • No, not at all. It’s a joke post, abusing the in-memory representation of the Option type to construct numbers. When nesting the Option type, it turns into a densely packed bit vector…

    And if I understand the purpose of Fin correctly, you’re picking on the one ‘peasant language’ that actually has something like that built-in.
    In Rust, you can specify the type of an array as e.g [u8; 3]. Which is an array containing values of type u8 (unsigned 8-bit integer) with a fixed, compile-time-guaranteed length of 3. So, [u8; 3] could be used to represent an RGB color, for example.
    It is an array, not a set, but well, close enough.


  • Yeah, at $DAYJOB, we switched (regrettably) from Scala to Kotlin and wanted to continue using the errors-as-value style, which I was the biggest proponent of. However, there not being a way to make the Kotlin compiler shout at you, if you implicitly ignore a return value, really made me question that choice.

    It means that if you refactor a function to now be able to fail, then you have to go to all usages and make sure you continue the bubbling.

    With exceptions, you should also do that, to potentially introduce try-catches, but if you don’t, then it will at least crash very visibly.

    If the compiler does shout at you, like in Scala and Rust, then I think, that’s a better pattern.