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

help-circle

  • I feel like you have to review new laptops (and the Steam Machine, for that matter) without considering the price these days. Normally, specs without a price means nothing, but no new releases in the space are going to be worth the cost.

    Where this is more interesting, in my opinion, is compatibility with the older Framework 13. If you can buy the individual components from the pro variant that you want, it might be possible to upgrade without draining your bank account. Avoiding the LPCAMM2 modules seems like the best way to do that, which unfortunately means skipping on the mainboard (and processor).

    Hopefully we see prices drop sometime soon. I think at a lower price, it’d be worth considering. At the current price, very few computers are worth buying.




  • The final example just boils down to writing the whole program in assembly, doesn’t it? The C function just returns a pointer to a static string, which you might as well do in assembly yourself since it’s less code to do it that way (you can omit the whole function signature).

    In any case, the article does a great job introducing the various compilation stages the C program goes through in order to become an executable.


  • A byte can hold one of 256 values (0–255), and luckily there are way more than 256 blocks in Minecraft, so I can hand every single byte its own block.

    This was not always the case. It is now since they moved (many years ago) to their new ID format, but at one point there were less than 256 blocks, and items would start at ID 256 (Iron Shovel). Not super relevant today of course, but just a fun bit of history.

    Anyway, two other things come to mind:

    1. You could encode files directly into NBT data for an item or entity. You might need to split files across multiple tags though. It’d be funny to see armor stands representing files on disk, for example.
    2. You don’t need to map bytes 1:1 to blocks. It’s possible to have a palette of more than 256 blocks, and encode the data in a different base, like say base 300 or so, to make the encoded data more (spatially) compact.

    Cool project. It’s a fun idea.


  • Does your function need to accept &mut self? If you can redesign that function just to take the slice of game objects (fn update(objs: &mut [T])) then you don’t need to worry about the aliasing at all. You can pass an index as well if you want to operate on them one at a time.

    This is actually closer to the strategy you’d see with ECS. You’d operate not on individual objects, but on all relevant objects at once.




  • 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.


  • TehPers@beehaw.orgtoRust@programming.devRewriting Bun in Rust
    link
    fedilink
    English
    arrow-up
    8
    arrow-down
    1
    ·
    19 days ago

    Zig’s features don’t map 1:1 to Rust’s features, so translating line-by-line (or file-by-file) doesn’t even make much sense. What are you supposed to do with a crazy comptime function full of reflection when translating that? What about custom pointer types (which Bun had to create for Rust), lifetimes, differences in ecosystem library APIs, etc?

    The author actually mentions the challenges they ran into due to breaking the code up across multiple crates. They needed to break cyclic dependencies for it all to compile.

    I agree. 1 year is an underestimate.



  • There are a lot of ways to do a terrible job of this. For example, prompting Claude “Rewrite Bun in Rust. Don’t make any mistakes.” and then praying it would work is not [sic] what I did.

    Adversarial workflows seems like an awesome strategy for burning tokens if your workplace uses a token leaderboard. I’m glad to see that someone discovered a way to game the system!

    I’m really hoping that Boa can compete soon. I’d love an embeddable, Rust-based JS engine that isn’t just AI generated unsafe everywhere. I don’t think they plan to really fit into the same space as node/deno/bun, but we already have node for that, and an easier to use JS runtime from within Rust would be awesome.