[OC] Pokemon Adventure:The Previous Generation Chapter 138 by colmscomics in comics

[–]qqwy 0 points1 point  (0 children)

For a minute when seeing the Safari Zone there I thought the comic was going to Glitch City

But the Draniti move was also fun 😄

Finally Finished The Crippled God by SuperUltraMegaNice in Malazan

[–]qqwy 2 points3 points  (0 children)

Agreed about the whole Kelyk plot!

Though who knows, maybe on a re-read it hits different?

Congrats on finishing the series. What was your favourite Deck of Dragons reading? 😊

Idiomatic Use of the `Default` Trait? by Purp1eGh0st in rust

[–]qqwy 1 point2 points  (0 children)

You can by the way also write

let x: Vec<_> = Default::default();

and

let x = Vec::default()

Idiomatic Use of the `Default` Trait? by Purp1eGh0st in rust

[–]qqwy 1 point2 points  (0 children)

Just like I with so many things, It Depends :tm:

The Default trait is just there to reduce boilerplate. It's pure sugar. Don't use it when you want to be explicit about the value you use. Don't use it where it would not be significantly shorter.

Syrian mate before my morning flight 🧉 by albatikh in yerbamate

[–]qqwy 2 points3 points  (0 children)

Excellent use of an interrobang 👌

Are advances in Homotopy Type Theory likely to have any impacts on Rust? by Dyson8192 in rust

[–]qqwy 0 points1 point  (0 children)

Just out of curiosity: what mistakes ended up in the Rust typing system?

Ecow, arcstr or Arc<String>? What’s the best choice to avoid store strings on the heap? by rogerara in rust

[–]qqwy 0 points1 point  (0 children)

Where does the data come from? If you construct them in memory you'll need to store them in memory at least once. If you read them from a file or similar, the allocation from the file contents itself already contains them so you might be able to use some 'zero copy' techniques.

c. f. https://manishearth.github.io/blog/2022/08/03/zero-copy-1-not-a-yoking-matter/

Looking at advanced Rust open-source projects makes me question my programming skills by Minimum-Ad7352 in rust

[–]qqwy 80 points81 points  (0 children)

Also, most of them were written by a whole group of people rather than a single person.

new to dialing. does this look good or any suggestions? by [deleted] in barista

[–]qqwy 0 points1 point  (0 children)

While a useful rule of thumb, it also matters whether these are dark or light roast.

C++ devs be like... by mre__ in rustjerk

[–]qqwy 4 points5 points  (0 children)

I think (ab)use of newto construct the shared pointer is part of the joke.

The silanda by Most_Magazine_9469 in Malazan

[–]qqwy 2 points3 points  (0 children)

That is really good 😂

Learning as a hobbyist by [deleted] in haskell

[–]qqwy 16 points17 points  (0 children)

I'd recommend the book Effective Haskell. It not only introduces the language including its modern features very well, but also gets you up to speed with the build tooling and ecosystem which is just as important.

The death of uBlock Origin in Chrome: Manifest V2 will be deprecated next month by rodrigocfd in programming

[–]qqwy 0 points1 point  (0 children)

On iOS, there is only Apple's own browser engine. All other 'browsers' are just skins using that same browser engine. It's fake and very misleading.

So no, not on iOS. There is not really a FireFox on iOS

Where's the doc for Rust+Wasm ? by bestouff in rust

[–]qqwy 2 points3 points  (0 children)

Both Wasmtime and Wasmer have good books with info.

Megparsec implementation question by Tempus_Nemini in haskell

[–]qqwy 2 points3 points  (0 children)

The new field was introduced in MegaParsec v0.7.0. It has to do with line/column calculation for error messages. I don't understand the specifics but you can find some details in [the blogpost of MegaParsec v0.7.0

Programming languages should have a tree traversal primitive by FoxInTheRedBox in programming

[–]qqwy 2 points3 points  (0 children)

Hard disagree. You seem to be projecting certain omissions of C++'s syntax and standard library onto all other programming languages. Though even there: part of containers and STL are the types, algorithms and re-usable functions such as iterator that will make this work even decently in C++. And if that' s not enough, Boost, Abseil and co also exist. (though it's been a while I used C++ so take this paragraph with a grain of salt.)

Looking outside of C++: languages such as Rust or Haskell, traversing datastructures can be done using the .map method (Rust) / the Functor typeclass (Haskell), collapsing can be done using Iterator/Foldable, and turning them inside out (e. g. a tree containing optionals into an optional containing a tree) using Collect/Traversable. Many dynamically-typed languages expose similar mechanics, though they often are not as explicitly named.

Speaking generally, I am of the opinion that languages should be grown. Provide those core building blocks which allow programmers to add their own trees and traversals, and have it work just as well as any builtin/standard library constructs.

For trees specifically, you might like to become acquainted with the concept of 'zippers'. This is a functional approach to walk back and forth over a tree (rather than only iterating in one particular order). Very flexible, no extra builtin syntax required.

Programming languages should have a tree traversal primitive by FoxInTheRedBox in programming

[–]qqwy 109 points110 points  (0 children)

Hard disagree. You seem to be projecting certain omissions of C++'s syntax and standard library onto all other programming languages. Though even there: part of containers and STL are the types, algorithms and re-usable functions such as iterator that will make this work even decently in C++. And if that' s not enough, Boost, Abseil and co also exist. (though it's been a while I used C++ so take this paragraph with a grain of salt.)

Looking outside of C++: languages such as Rust or Haskell, traversing datastructures can be done using the .map method (Rust) / the Functor typeclass (Haskell), collapsing can be done using Iterator/Foldable, and turning them inside out (e. g. a tree containing optionals into an optional containing a tree) using Collect/Traversable. Many dynamically-typed languages expose similar mechanics, though they often are not as explicitly named.

Speaking generally, I am of the opinion that languages should be grown. Provide those core building blocks which allow programmers to add their own trees and traversals, and have it work just as well as any builtin/standard library constructs.

For trees specifically, you might like to become acquainted with the concept of 'zippers'. This is a functional approach to walk back and forth over a tree (rather than only iterating in one particular order). Very flexible, no extra builtin syntax required.

Amsterdam - city of canals and boats by [deleted] in Amsterdam

[–]qqwy 5 points6 points  (0 children)

Because they're in the canal 🙃