@laund@hachyderm.io avatar

laund

@laund@hachyderm.io

cisn't
❤️Rust + Bevy

This profile is from a federated server and may be incomplete. Browse more on the original instance.

kev, to DuckDuckGo
@kev@fosstodon.org avatar

So it seems that was down for the last few hours because of a outage. That's very annoying; DDG should probably get out from under Microsoft's coat tails...

<https://techcrunch.com/2024/05/23/bing-is-down-bringing-duckduckgo-and-ecosia-down-too/>

laund,
@laund@hachyderm.io avatar

@kubikpixel @kev it took me so long to realise that this post was not in any way i can't comprehend talking about https://bevyengine.org ...

soller, to random
@soller@fosstodon.org avatar

I wrote a PDF reader with libcosmic yesterday. While it is very basic and not likely to be ready for the first COSMIC release, it is pure rust, lightweight, GPU accelerated, and highly portable.

laund,
@laund@hachyderm.io avatar

@lw64 @soller to elaborate, when @ekuber says "It's its raison d'être" about parsers, i think this quote is relevant:

> Do you know Mozilla’s secret solution to writing really complicated permissive parsers in C++?
> We stopped doing it.
> We developed Rust and ported our nastiest parsers to it.

just thought i'd add that context.

CodexArcanum, to GraphicsProgramming
@CodexArcanum@hachyderm.io avatar

Well, it took about 2 weeks longer than I expected (spare time for programming is especially spare at times!) but I finally finished swapping out the graphical backend of my roguelike project with a handrolled one using ! I'm super excited to be fully in control of my destiny!

Wgpu is still pretty difficult, even if it is cleaner than opengl with glow and . (And up-to-date with its own dependencies, always nice!)

laund,
@laund@hachyderm.io avatar

@crmsnbleyd @CodexArcanum aye, it does. might be a great source of inspiration for wgpu usage

nahratzah, to rust
@nahratzah@mstdn.social avatar

Okay, the documentation on generic struct-structs is really difficult. And for some reason I cannot omit the where-clause.
I'm probably not understanding.

But... omg, traits are amazing. They're what I wanted c++' constraints to be. <3

This will make working with templates so much easier.
(Just have to figure out type arithmatic, then I suppose I'm pretty much where I want to be.)

(Despite my complaint about the documentation, the documentation is pretty good. Nice language too.)

laund,
@laund@hachyderm.io avatar

@nahratzah could you link this docs? i'm curious which you're talking about

laund,
@laund@hachyderm.io avatar

@nahratzah what you experienced definitely sounds like something went wrong. This is perfectly fine syntax and should compile. see https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a2b594ae592228236e00b84923fc887c

you only need "where" when specifying complex Trait bounds, often

struct GenVal<T: Debug + Display> { ... }

should be fine

laund,
@laund@hachyderm.io avatar

@kaffiene @asdfasdfasdf i think part of the issue is that one group of devs is saying "rust is great for gamedev" by which they mean its a great language to develop games which are closer to game engines themselves in, or even custom engines. Then another group says "no it sucks" but they are talking about the scripting approach, where you don't care what happens under the hood

Rust fits the first group well, and the second not at all, and the issue is that both dont see the difference between

laund,
@laund@hachyderm.io avatar

@kaffiene @asdfasdfasdf by which i mean:

if you want to develop on the level of a engine, even if you're not makign a entire engine, Rust is IMO the most productive language. But these things also take a lot of time, which is why you don't see big games being finished. There are some like Tiny Glade where the devs built a entire custom renderer on the other hand.

jaycruz, to rust
@jaycruz@fosstodon.org avatar

This is a 48 minute long article that's critical of the Rust hype train vs C/C++. The TLDR is that while security is a problem, the Rust vs C choice as the only choice for low-level systems programming is a “non choice”. The author states that Go is a perfectly fine choice. https://medium.com/

#c

laund,
@laund@hachyderm.io avatar

@jaycruz I'll freely admit i've only read a few sections in this article (its really long), but while it seems to be written by someone with lots of experience it seems to be colored by a very specific perspective. i would never state Zig is easier to learn than Rust (imo it suffers from the exponential complexity problem which Rust avoids at the cost of a steep upfront learning curve)

It also fails to consider that "just doing things people will find easy" is exactly how we got into this mess

laund,
@laund@hachyderm.io avatar

@jaycruz example re: "do you need performance"

yes. IMO the fact that program inefficiency grows directly related with available performance is an issue, and i dont understand how it could be seen as not being one. now granted, Rust wont suddenly fix that (cough Tauri) but at least its a step in the right direction.

The article takes a very "dont make programming harder" POV where i think thats exactly what needs to happen to make meaningful progress

laund, to rust
@laund@hachyderm.io avatar

"Make the safe path the convenient path"

This is a underestimated concept which applies to any language. I only internalised it while learning and its one of those things i now apply in any language i use.

alper, to rust
@alper@rls.social avatar

Trying to get my head around how to organise a project where you have to deal with "crates", "packages", "modules" and "libraries" each of which means something slightly different.

I guess the reason why so many Rust source files are 1000+ LoC is because figuring out how to split them up is too much of a pain.

laund,
@laund@hachyderm.io avatar

@alper @anselmschueler i have not found the documentation to be lacking, assuming you count The Book as part of it.

Ultimately, its a linear hierachy:

the outermost level is a Workspace, which is optional to combine multiple Packages in one project.
A package can be a lib Crate (library) or a bin Crate (binary) or both, but cant contain multiple lib or multiple bin crates. it relies on the presence of lib.rs or main.rs. Each .rs file is usually included as a module using the mod keyword.

laund,
@laund@hachyderm.io avatar

@alper @anselmschueler
In my opinion, these are suffecient levels of hierarchy to support any sized project, from a single main.rs CLI to an entire game engine. Its also simple enough, with the destinction between package and crate being very technical and workspaces being completely optional, that the only thing someone developing their first rust projects is usually confronted with is modules - which are a neccessary amount of complexity.

laund,
@laund@hachyderm.io avatar

@alper @anselmschueler maybe the issue is trying to learn a language with a notoriously steep initial learning curve "quickly".

The Book is generally regarded as some of the best official material for any language. If it doesn't work for you, maybe you're attempting to read it as a tutorial instead of a book?

kubikpixel, (edited ) to windows German
@kubikpixel@chaos.social avatar

deleted_by_author

  • Loading...
  • laund,
    @laund@hachyderm.io avatar

    @kubikpixel Immerhin hat Heise genug verstanden dass sie nicht wie der CVE selbst und natürlich viele andere Zeitschriften behaupten es würde nur Rust betreffen

    kubikpixel, (edited ) to github German
    @kubikpixel@chaos.social avatar

    deleted_by_author

  • Loading...
  • laund,
    @laund@hachyderm.io avatar

    @kubikpixel @Codeberg Meinst du dass crates nur auf GitHub sein dürfen? das ist falsch. crates.io nutz GitHub NUR für die nutzer/gruppenverwaltung. Der crate inhalt (code, readme) wird direkt zu crates.io hochgeladen mit dem publish befehl, das einzige was GitHub macht ist dich zu authentifizieren.

    BTW, das crates.io team ist offen für alternative login-provider falls jemand die lust/zeit hat das zu implementieren.

    janriemer, to rust

    Some people: "Rust's syntax is so confusing to me." 🥴

    The project: "Let's match that confusion with even more confusing syntax!" :awesome:

    🤦

    /sarcasm

    laund,
    @laund@hachyderm.io avatar

    @hopland @janriemer what... what does this mean?

    laund,
    @laund@hachyderm.io avatar

    @andy_f @hopland @janriemer not wrong tho i'd strongly claim those things are unrelated

    laund,
    @laund@hachyderm.io avatar

    @hopland @andy_f @janriemer what? why did you explain that?

    hywan, to rust
    @hywan@fosstodon.org avatar

    2024 Edition Update, https://blog.rust-lang.org/inside-rust/2024/03/22/2024-edition-update.html.

    > This is a reminder to the teams working on the 2024 Edition that implementation work should be finished by the end of May

    The article lists changes of the 2024 edition, like Future and IntoFuture will be part of the prelude, RPIT lifetime capture, the gen new keyword etc. Interesting.

    #RustLang

    laund,
    @laund@hachyderm.io avatar

    @hywan it reads like these are only the not yet finished changes. do you know if there is a list of finished ones?

    laund,
    @laund@hachyderm.io avatar

    @hywan nop to what? is this all the planned changes or do you not know if theres somewhere the finished ones are collected?

    laund,
    @laund@hachyderm.io avatar

    @ekuber @epilys @hywan but surely there are more such breaking changes than the list in the blog post?

    bitprophet, to rust
    @bitprophet@social.coop avatar

    (randomly) I gotta find out if there are any BeautifulSoup-a-likes in the #Rust / #Rustlang ecosystem 🤔

    laund,
    @laund@hachyderm.io avatar

    @bitprophet @ehmatthes i've uswd scraper and its definitely the closest. very neat that it uses the same parsing and css as Servo.

    the Css is actually one of the reasons i almost prefer it: unlike in bs4 where css selectors are partially supported and i avoid them, in scraper the css support feels much more trustworthy, being the same used in servo.

    h_thoreson, to rust
    @h_thoreson@mastodon.world avatar

    Had posted a private reply to @nocoursewalks about the WH directive trying to steer people away from C/C++ and toward and other memory-safe languages.

    I had replied: "I can never tell if Rust is the real deal or if it's another thing like Typescript where it fixes a few things at the expense of being able to get anything done"

    laund,
    @laund@hachyderm.io avatar

    @h_thoreson @nocoursewalks yes, Rust sometimes has to drop to unsafe areas. but this is why the "safe abstractions on unsafe code" mindset is so widespread - write a safe abstraction once, use it in many places. Like how Asahi was able to develop a whole GPU Driver with not that many (iirc <100) lines of unsafe Rust in a few months.

    using unsafe is not "back at square one" either, as the powers it grants are still limited and contained to that area. just look at Rust on embedded, it works.

    laund,
    @laund@hachyderm.io avatar

    @nocoursewalks @h_thoreson "write a safe abstraction" is much less useful of course when that abstraction isnt enforced. Rust allows you to enforce many more things about a abstraction than C, which is why this same saying is used yet again.

    modulux, to rust EN

    Hi there,

    Been seeing that repo with claims that the memory safety guarantees in can be easily circumvented without using unsafe, but I lack the time/energy to look into it in detail. Any rust user has a comment on it?

    laund,
    @laund@hachyderm.io avatar

    @modulux safe to say "easily circumvented" is a misconception because @Speykious and some others made a crate to do it for you (as a meme/joke)

    it required hours of fiddling to make it cause issues even somewhat reliably, and its still easily caught by miri (optional tool to find these kinds of issues, usually used to test unsafe code).

  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • tacticalgear
  • InstantRegret
  • thenastyranch
  • magazineikmin
  • everett
  • rosin
  • Youngstown
  • slotface
  • mdbf
  • cubers
  • kavyap
  • osvaldo12
  • DreamBathrooms
  • anitta
  • khanakhh
  • cisconetworking
  • ngwrru68w68
  • Durango
  • tester
  • provamag3
  • normalnudes
  • GTA5RPClips
  • modclub
  • ethstaker
  • megavids
  • Leos
  • lostlight
  • All magazines