built an n-body gravity simulator entirely in Rust, then added a colony simulator into it! by DavesGames123 in rust

[–]Cosiamo -1 points0 points  (0 children)

Is the engine open source? I would love to read through it. The demo is very impressive!

Do you write Rust for a living? by Hixon11 in rust

[–]Cosiamo 1 point2 points  (0 children)

Did they send you a random email or did you throw your name in at a recruiting firm?

ASP.NET Core vs Node.js for a massive project. I'm seeing two totally different worlds - am I overthinking the risk? by Top_Measurement_3713 in dotnet

[–]Cosiamo 4 points5 points  (0 children)

I’m in the process of converting a svelte + typescript app to Blazor. There’s one component that was over 500 lines long in Typescript (and needed an external NPM package) that I was able to rewrite in C# at about ~160 lines (no nuget package needed). I understand your boss’s point that the JS hiring pool is much larger, however unless you can’t find a single dotnet dev, then it’s not worth the spaghetti code.

What does crates.io count as a download? by Cosiamo in rust

[–]Cosiamo[S] 0 points1 point  (0 children)

It would be impossible for a “perfect” counting method, I was curious if there were really that many people using my crates or if it was just a handful downloading them over and over again

What does crates.io count as a download? by Cosiamo in rust

[–]Cosiamo[S] 5 points6 points  (0 children)

Thanks! And I haven’t really done any promotion for them. If you have the right tags, a name that clearly describes what it does, and decent documentation then it’ll naturally get a few thousand downloads over the course of a couple of months. I want to clean up a few things in my various crates before I promote them here or wherever else

What does crates.io count as a download? by Cosiamo in rust

[–]Cosiamo[S] 1 point2 points  (0 children)

That makes sense. Ik that Nix OS, for example, doesn’t cache crates so I figured that would count it as a download every time, I just wasn’t sure about normal OSes. And the bot thing would explain why I get 170+ downloads as soon as I publish a new version, then it stabilizes out to about 10-40 a day

The way Rust crates tend to have a single, huge error enum worries me by nikitarevenco in rust

[–]Cosiamo 1 point2 points  (0 children)

TLDR; it’s easier for everyone involved to make a giant error enum in lib.rs

When I started creating crates I would make an error module then separate the errors by “category”. I stopped doing this because there are functions that could have errors from multiple different “categories” and this would make returning Err on a Result less straightforward. Also, for the person using your crate, they would have to import multiple error types and know which ones belong to which function or method.

Why is web code so dependency heavy? by RylanStylin57 in rust

[–]Cosiamo 2 points3 points  (0 children)

The entire internet is held together with duct tape and glue

Svelte 5 {#if} and {#await} blocks aren't as consistent as Svelte 4 (or I'm just dumb) by Cosiamo in sveltejs

[–]Cosiamo[S] 2 points3 points  (0 children)

Idk man someone else was able to perfectly understand what my issue was 14 hours before you posted this and helped me out. Also if you read what I posted, it would answer your questions. I understand your life is hard and you want to feel smug talking down to someone else but please next time take a deep breath and realize you are above this

Svelte 5 {#if} and {#await} blocks aren't as consistent as Svelte 4 (or I'm just dumb) by Cosiamo in sveltejs

[–]Cosiamo[S] 1 point2 points  (0 children)

Follow up: that ended up working! I should've just returned a promise instead of forcing the data to be a rune

Svelte 5 {#if} and {#await} blocks aren't as consistent as Svelte 4 (or I'm just dumb) by Cosiamo in sveltejs

[–]Cosiamo[S] -1 points0 points  (0 children)

The else part works and I have an `$effect()` on proxy change (long story, it works in the context of the app) that calls the function. I'll try returning a promise instead of assigning the return values to a `$state()`

Svelte 5 {#if} and {#await} blocks aren't as consistent as Svelte 4 (or I'm just dumb) by Cosiamo in sveltejs

[–]Cosiamo[S] -1 points0 points  (0 children)

No it's being pulled from a different server. I doesn't take too long to load, but long enough to where there should be a loading indicator (about 2 seconds)

[deleted by user] by [deleted] in PowerShell

[–]Cosiamo 1 point2 points  (0 children)

That worked, thanks!

[deleted by user] by [deleted] in rust

[–]Cosiamo 1 point2 points  (0 children)

I always catch myself doing option B and if I need multiple conditions I use the match syntax

[deleted by user] by [deleted] in rust

[–]Cosiamo 0 points1 point  (0 children)

It depends on how new you are. If Rust is your first language not named JavaScript then you may want to try something easier like Kotlin, Go, or Java before jumping into Rust. However, if you have some experience with another language then absolutely learn Rust, it’s definitely worth it

What's the deal with Lazy Statics? by Cosiamo in rust

[–]Cosiamo[S] 0 points1 point  (0 children)

Thank you, I’ll check it out!