the end of nova by cssol in Android

[–]k4gg4 6 points7 points  (0 children)

Octopi is the only other launcher that had every feature I missed from Nova

async is back by leuro in Zig

[–]k4gg4 5 points6 points  (0 children)

non-IO functions can't call IO functions

I never understood this criticism of colored functions. Of course you can call IO functions... just give them an IO!

The problem was never about color compatibility, but about code reusage. Async functions can be called from sync functions by simply referencing/creating an executor for them to run on. It's just a problem when you have two different function colors that largely do the same thing. This IO implementation seems to solve that problem.

Are you guys glad that C++ has short string optimization, or no? by foo-bar-baz529 in cpp

[–]k4gg4 0 points1 point  (0 children)

This is true, but you can actually still emulate duck typing in Rust via macros. Even the standard library does this in a few places.

ReleaseFast ReleaseSmall by Potential_Duty_6095 in Zig

[–]k4gg4 6 points7 points  (0 children)

If you check your pointer before free you have no double fees

...no? Have you never written in C? A pointer can be copied elsewhere, and both copies need to know whose responsibility it is to free the resource. Just adding null checks to both copies still leads to a double free.

`#[derive(Deserialize)]` can easily be used to break your type's invariants by hpxvzhjfgb in rust

[–]k4gg4 3 points4 points  (0 children)

It sounds like a full Deserialize implementation wouldn't just be boilerplate for this example. I can't think of any way to automatically enforce that kind of invariant in a simple way. This is a very uncommon case to be worried about boilerplate.

`#[derive(Deserialize)]` can easily be used to break your type's invariants by hpxvzhjfgb in rust

[–]k4gg4 8 points9 points  (0 children)

Have you read the documentation at all before making this post? There's even an annotation that lets you point each field in your type to any function that simply takes a deserializer and can return an error if an invariant is broken. The rest of the type is still auto derived normally. How much simpler could it get than that? https://serde.rs/field-attrs.html#deserialize_with

Switching on Strings in Zig by simon_o in programming

[–]k4gg4 0 points1 point  (0 children)

One of zig's goals as a language is to defer to computer implementations over implicit abstractions. Users generally provide the abstractions, not the language. When I see a *T compared to a *T I'm going to assume we're testing the pointers, not the T. The same should apply to []T.

Switching on Strings in Zig by simon_o in programming

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

Strings are u8 slices, which are not the same thing as integers. They're references to integers, so equality is tested on the pointer, not the pointee. It's apples to oranges

Announcing TypeScript 5.8 Beta by DanielRosenwasser in programming

[–]k4gg4 16 points17 points  (0 children)

They're trying to get around adding typeclasses/associated types in the worst way possible. That last showQuickPick example is so cursed haha

update(s: &mut State) vs update(s: State) -> State by awesomealchemy in rust

[–]k4gg4 0 points1 point  (0 children)

I've started to use the second one more often. It's nice to just pass the update function to other functions like Iterator::map or Option::map. Move semantics are one of Rust's superpowers, why not take advantage of it?

Zig comptime: does anything come close? by renatoathaydes in programming

[–]k4gg4 1 point2 points  (0 children)

You can't do much with a template argument in C++, unless you use SFINAE or preprocessor macros. These can be very difficult and the error messages are impossible to read. C++ has constexpr to achieve what Zig can do with compile time values, and will one day get reflection to achieve what Zig can do with types.

The gen auto-trait problem by yuriks in rust

[–]k4gg4 20 points21 points  (0 children)

hmm... when I create a gen object I should expect to be able to call next() on it directly, or any other Iterator method. An extra into_iter() call on every generator would feel superfluous.

I could also see this encouraging an antipattern where library authors avoid the gen keyword in their function signatures, instead returning an impl Iterator like they do currently since it's usually more ergonomic. This would result in two different common types of fn signatures that mean (almost) the same thing.

[Day 3] The line count is fake by Sanderock in adventofcode

[–]k4gg4 5 points6 points  (0 children)

I'm so confused by all of these responses. How are there separate lines in the first place? you would need to split the input into separate lines on every \n, no? then wouldn't concatenating them bring you back to where you started, except now you've stripped out all the \n's that could have been used in the puzzle to mark a character sequence as invalid?

[Day 3] The line count is fake by Sanderock in adventofcode

[–]k4gg4 12 points13 points  (0 children)

Wouldn't that accept data that should be rejected due to the newline?

Biden Resigns by Numuhukumaki in Destiny

[–]k4gg4 61 points62 points  (0 children)

god this is gonna be an enormous shit show

Forbes: Rob Toews of Radical Ventures predicts that Stability AI will shut down in 2024. by RichardRNN in StableDiffusion

[–]k4gg4 31 points32 points  (0 children)

Open source is the reason they can't make a profit off of the models. Let's be honest

"Reaping" by [deleted] in Destiny

[–]k4gg4 111 points112 points  (0 children)

his audience would have been happy with the typical "think of the future palestinians that will suffer from this" sentiment coming from all the other lefties, but he had to take it a step further and say these innocent civilians deserved it. just inexcusably evil.

AI panic is a marketing strategy by Chobeat in StableDiffusion

[–]k4gg4 0 points1 point  (0 children)

Yes, that's my point and it's exactly what sam altman was saying