• 0 Posts
  • 616 Comments
Joined 3 years ago
cake
Cake day: June 21st, 2023

help-circle

  • To be honest I don’t see how a “style guide” is going to help. C++ has had all sorts of guidelines and style guides for decades and it helps a bit but… not really.

    It does help though without requiring a complete rewrite in another language, which is prone to causing entirely new issues and reintroducing old, fixed ones.

    Like I said, Rust does a much better job at avoiding these. “Claude rewrite this in Rust” doesn’t give you those benefits for free.

    Is this style guide not a style guide?

    It’s a start, but doesn’t say much about methods to avoid the memory issues that they supposedly had issues with. If they intended to actually use it, maybe it’d have more than 7 commits from 8 months ago. Maybe they would have updated it with patterns to prevent new bugs in the future based on the bugs they ran into. That didn’t happen, though.


  • You could have searched for some benchmarks yourself, instead of thinking you’re winning an argument in such a stupid manner.

    Why would I do that? I made no claims to its speed. You’re the one making claims, so the burden of proof lies with you.

    Note that Jarred himself (bun creator) wouldn’t push against this either. Instead, he will sell you the aggregate performance talking point (as another user did), which is why I made my deliberately facetious comment about webshittery.

    I don’t really care what Jarred says though. He hasn’t exactly left a good impression with the direction he’s taken Bun.





  • I want to use AI again, but this time as an assistant – I’ll review every change, write tests together, and keep a clear plan.

    Let’s overlook the en-dash here and assume good faith. You should review every change from the start. You cannot assume the AI will work correctly or even has a concept of correct vs incorrect (or, despite the marketing, the ability to actually reason, sans a definition of the word that explicitly includes language models).

    Which AI tool would you recommend for this hybrid approach? How do you structure prompts to force the agent to explain before coding?

    Any tool should work. Just ask it questions, and forbid it from modifying or generating code itself.

    Note that all LLMs are prone to hallucinate. While I haven’t tried Fable yet, even Opus with maximum reasoning can produce utter bullshit if something isn’t in its training data. This means you need to validate everything it says.

    Use the model as a tool to point you in the right direction and help you form good questions or digest things beyond where you currently are. Verify the answers. Read documentation yourself. Go to the source, and learn from there. The LLMs are not omniscient, nor are they going to tell you when they cannot answer a question, so don’t rely too heavily on them.

    Also, do you think a couple of weeks is realistic to rebuild the site that has feature parity with Lemmy and a few extra features that the AI managed to build in a single day?

    Let me ask you this: are you familiar with ActivityPub? ActivityStreams? JSON-LD? Do you know how to compact a JSON-LD document using a Lemmy-compatible context? Do you know how to dereference IRIs pointing to other servers?

    Going even higher level, do you know what backend framework you want to use? Frontend framework, if any? Do you know how to use them? How will you store user-generated content, including text, images, and other kinds of media? How will you handle access controls for those users? How will you perform authentication and user sign-ups?

    If you don’t know, can you even fill the gaps in your knowledge in under two weeks?

    Two weeks is enough time to build a very basic proof of concept backend. It’s enough time to mock out a couple pages on the frontend. You can’t build a service in two weeks if you expect to actually understand how it works. You won’t learn anything asking a LLM to do it for you.

    Learning takes time. If you skip that step, you will plateau at whatever level the LLM is at. Only by taking the time to learn will you ever actually grow as a developer.






  • If you know a faster/better way to sort byte arrays in Java/Clojure let me know!

    I don’t know much Clojure, but this should be doable in Java. I would be interested in seeing the results of sorting the data via both quicksort and heap sort. I’m not sure what sort Clojure defaults to, but if the distribution of IDs is uniform, then I’d imagine the downsides of heap sort are pretty much universal to all sorts you’re likely to use, which makes it more interesting here to me.

    At the very least, Clojure’s docs seem to say that sort is stable, which isn’t needed here (we know all IDs are unique). You can probably gain performance just by switching to a performant unstable sort, just in general.


  • With computer languages, we define colors with red, blue, and green.

    It’s actually more complicated than this. We specify a color space, then define the color through parameters relevant to that color space. For example, it’s not uncommon to define a color in CSS in Oklab, which could look like 40.1% lightness at (0.1143, 0.045). It’s also common to define colors relative to other colors. Color space is also not just “well this value maps to this other value in RGB”. Different color spaces represent different spectrums of visible light, and you can represent colors in one space that you can’t in another space.

    So “when does green become black” is even more complicated to answer.

    Ambiguity is a bitch. Usually when it comes down to “is this color X or Y”, the follow-up question is “does the foreground have a contrast ratio of at least 4.5:1 against the background”. If not, then whether the color is X or Y doesn’t matter. You need a different color.

    Anyway, natural language does not map well to machine code. There’s too much ambiguity, and you lose out on the chance to answer the questions you didn’t specify answers to that come up when actually writing the code yourself. An interactive approach would take just as much effort as just writing the code itself.


  • Imagine this: instead of reading other people’s code and then trying to parse their intentions form [sic] it, you read the documentation to understand their intentions and then you read the code. You no longer have to strain yourself trying to understand what someone wrote for another audience (the machine). They’ve already explained it for you.

    The best implementation of this I’m aware of is the Entangled bi-directional tangler. A tangler extracts code from your documentation and distributes it across the appropriate source code files. It’s [sic] bidirectionality means you can use it to write code embedded in documentation, but then also edit that code normally which it then propagates back into the code blocks in the documentation. This allows programmers to use existing tooling for testing, refactoring, and code formatting without special support for literate programming.

    The best built-in implementation for this that I’ve seen is Rust’s doctests. You write a block of code in your documentation. Then you run cargo test. The code gets compiled and executed as part of your tests, and panics get reported as failures. You can also mark code blocks as should_panic, compile_fail, ignore, etc if needed.

    I’d love to see tools like this in other languages. Write the docs next to the code, but compile the docs as well and make sure they actually work. This is sort of what Entangled seems to do, but ideally more entangled with the build process.



  • The README lists the VRAM requirements for their different models if you plan to run with a GPU. Without a GPU, you can translate those roughly to system RAM.

    Note that ML models pretty much always runs faster on a GPU due to the kinds of operations needed to execute them. If you have the option to run on a GPU, you probably should just do that. Even their largest model only requires ~10GB VRAM based on their table, and if you only need English, you can use a smaller one specialized for English (like medium.en).