[-] Walnut356@programming.dev 1 points 11 months ago* (last edited 11 months ago)

Qownnotes

It's a desktop app, but can sync with self-hosted cloud servers. It's also literally just text/markdown files.

[-] Walnut356@programming.dev 2 points 1 year ago* (last edited 1 year ago)

To be fair, "an entire x" does have markedly different connotation than "x". The emphasis is that it's, well, the entirety of x. It's the difference between "i ate the cereal" and "i ate all the cereal".

[-] Walnut356@programming.dev 2 points 1 year ago* (last edited 1 year ago)

I’m not sure I understand your point about fall through having to be explicit

As far as i understand it, every switch statement requires a break otherwise it's a compiler error - which makes sense from the "fallthrough is a footgun" C perspective. But fallthrough isnt the implicit behavior in C# like it is in C - the absence of a break wouldnt fall through, even if it wasnt a compiler error. Fallthrough only happens when you explicitly use goto.

But break is what you want 99% of the time, and fallthrough is explicit. So why does break also need to be explicit? Why isnt it just the default behavior when there's nothing at the end of the case?

It's like saying "my hammer that's on fire isnt safe, so you're required to wear oven mitts when hammering" instead of just... producing a hammer that's not on fire.

From what i saw on the internet, the justification (from MS) was literally "c programmers will be confused if they dont have to put breaks at the end".

[-] Walnut356@programming.dev 2 points 1 year ago

Generators probably. It's the one thing i genuinely miss about python when i work in rust.

[-] Walnut356@programming.dev 3 points 1 year ago

Is pycharm's semantic highlighting still kinda ass? That's the biggest thing that stopped me from using it over vsc. As of like may this year i remember there still being active issue tracking for it.

[-] Walnut356@programming.dev 2 points 1 year ago

Seems you missed the last line

compiles to fast code

[-] Walnut356@programming.dev 4 points 1 year ago* (last edited 1 year ago)

15532 on-type format (, by adding closing ) automatically

Thank fucking god lmao. The PR specifically mentions the Some( case too, which is exactly where i encounter this the most.

Overall very nice changes

[-] Walnut356@programming.dev 3 points 1 year ago

Here's the script. It's nothing fancy, and iirc it only works for top level functions/classes. That means you still have to take care of attributes and methods which is a little annoying, but for simple stuff it should save a bit of time.

[-] Walnut356@programming.dev 3 points 1 year ago* (last edited 1 year ago)

Pyo3 doesnt generate type hints at all iirc. There's some more info here

The gist, as i recall, is that you're supposed to maintain a .pyi file in the rust project folder that gets automatically added in by maturin when building. I'm no regex wizard, but i was able to whip together a small script that generates simple function and class stubs that also have the rust docstring. Iirc they're planning on adding some official support for generating type hints, but i have no idea how far along it is or where it is on the priority list

[-] Walnut356@programming.dev 2 points 1 year ago

It's most useful when you're using some data you already have as the dictionary key. A usecase i had for this was a binary file parser with 10 types of event markers. It was originally coded with if/elif, but performance was a pretty big consideration. Using the event markers as keys to a dictionary dispatch improved performance by about 15% and made the code significantly more readable.

[-] Walnut356@programming.dev 2 points 1 year ago

I read the book. It's not too difficult to replicate their test's functionality with rust tests, but i still ended up using their software suite a few times to verify some behavior and get a better understanding of the step-by-step logic for the alu and cpu

[-] Walnut356@programming.dev 3 points 1 year ago

People in different socioeconomic situations/locations experience new technology at different points in time. Just because the internet existed doesnt mean they (or anyone in their immediate vicinity) had internet, state of the art computers, etc.

view more: ‹ prev next ›

Walnut356

joined 1 year ago