

Ah I didn’t know about this. I’ve been fighting chrono (and the concept of time in general) trying to parse an iCal file to show a week of events… which you’d think would be easy, but it’s super complicated. Maybe this will make it a little easier.
Ah I didn’t know about this. I’ve been fighting chrono (and the concept of time in general) trying to parse an iCal file to show a week of events… which you’d think would be easy, but it’s super complicated. Maybe this will make it a little easier.
Yes, but be warned, formal software verification is proper hardcore. Complicated computer science theories, scant documentations - much of which assumes you have a PhD in the field, and in my experience it’s quite a leaky abstraction. You’ll end up needing to know a lot about the actual implementation of Lean to figure out why some things work and others don’t, in a way that you don’t need to in “normal” languages.
It’s quite satisfying when it works though. Like a puzzle.
I highly recommend this fun “game”: https://adam.math.hhu.de/#/g/leanprover-community/nng4
You can transform any recursive algorithm into iterative pretty easily though; just create a manual stack.
The rule definitely makes sense in the context of C code running in space. Unbounded recursion always risks stack overflow, and they probably don’t have any tooling to prove stack depth bounds (you totally can do that, but presumably these standards were written in the 1500s).
I don’t know why you think maintaining uv will require magical superpowers. Writing it in the first place requires a ton of work, sure. But that seems to be mostly done.
It literally doesn’t matter how long it takes.
Found the Python dev…
Well I can think of a couple:
uv clean
uv
which you may not want to impose on users, or CI.But it’s sooooo much better than the official tooling (and the competition like Poetry) that the conclusion is still the same: you should definitely use it.
The biggest praise i have is, it follows the UNIX philosophy, do one thing and do it well.
That isn’t a pro on its own, and it’s also a very wooly rule. Uv does one thing and it does it well - Python project management.
the issue comes down to resources required to maintain a super complex thing
They seem to be managing fine. I guess having a company back it is enough. But that is also probably my biggest worry about it - what if Astral goes away (which given their apparent lack of business model I suspect they eventually will)? Hopefully uv is popular enough by that point it won’t die.
I DONT GIVE TWO SHIATS IF ITS FASTER
It’s literally 10x faster. I’m not sure what kind of person wouldn’t care about that.
It has the best IDE support of any language I’ve tried.
Definitely not the best - Java and Dart are waaay ahead.
But it’s pretty good. Better than C++ and Python.
My main issue with it is the speed. Rust-analyzer is ridiculous resource intensive.
I feel like they could ask way more interesting questions. Probably the only really interesting thing here is people’s top complaints about Rust, which is to be fair a really great list.
I would really love to see something similar for other languages. Imagine if you could see ranked pros and cons for every language!
Yeah the main reason is performance. In some languages if you use a value “linearly” (i.e. there’s only ever one copy) then functional style updates can get transformed to mutable in-place updates under the hood, but usually it’s seen as a performance optimisation, whereas you often want a performance guarantee.
Koka is kind of an exception, but even there they say:
Note. FBIP is still active research. In particular we’d like to add ways to add annotations to ensure reuse is taking place.
From that point of view it’s quite similar to tail recursion. It’s often viewed as an optional optimisation but often you want it to be guaranteed so some languages have a keyword like become
to do that.
Also it’s sometimes easier to write code that uses mutation. It doesn’t always make code icky and hard to debug. I’d say it’s more of a very mild code smell. A code musk, if you like.
Well… the else condition (bar
) needs to be covered. I haven’t used branch coverage tools in Python but in any sane language you cover the actual semantics, not the lines. It shouldn’t make any difference if you write your code on one line, or with ternary expressions, or whatever.
If you branch coverage tool can’t handle branches on the same line I would suggest you use a different one! Does it handle if foo or bar
?
Will not see the value that gets past into self.float_button.setIcon
Uhm, yes you will? Just step into the function.
Easily above average code for Python. I’m going to pick on one method:
def _set_float_icon(self, is_floating: bool):
""" set the float icon depending on the status of the parent dock widget """
if is_floating:
self.float_button.setIcon(self.icon_dock)
else:
self.float_button.setIcon(self.icon_float)
First, Python does have ternary expressions so you can
self.float_button.setIcon(self.icon_dock if is_floating else self.icon_float)
Second, what does this code do?
foo._set_float_icon(true)
Kind of surprising that it sets the icon to icon_dock
right? There are two easy fixes:
*, is_floating: bool
so you have to name the parameter when you call it._update_float_icon()
or something.Also use Black or Ruff to auto-format your code (it’s pretty well formatted already but those will still improve it and for zero effort).
I’ve tried to learn Vim in the past but IMO it is not worth it at all. In a world without multiple cursors… sure, maybe. With multiple cursors? No way. I can can edit just as fast as I’ve seen any Vim user do it, and without having to remember a gazillion mnemonics and deal with the silly modal thing.
Multiple cursor editing even has some significant advantages over Vim style, e.g. it’s interactive, so you can do your edit gradually and go back if you make a mistake. Rather than having to write a complex command and only finding out it if works at the end. (If you’ve used regex find & replace you’ll understand that problem.)
I’ll probably get downvoted for this since Vim is kind of a cult, and Vim users get a sense of superiority from it. Kind of like audiophiles - they don’t appreciate it if you tell them their £10k valve amp doesn’t actually sound any better than your £1k digital amp.
For editing on remote computers I use VSCode remote or Micro for quick tasks.
His comment should be read as “I don’t get the borrow checker”.
That’s not what he wrote.
It’s not because people are sensitive, it’s because Rust gets a lot of dumb criticism and people are tired of it.
I agree. Maybe Rust should make crates automatically re-export dependencies if any of that dependency’s types are publicly exposed.
Small nit:
CHERI is even weirder. CHERI pointers store 128-bit capabilities in addition to the 64-bit address we’re used to
The 128-bit capability (actually 129 since there’s a tag bit) includes the address. It’s 64-bit address + 64-bit metadata + 1-bit tag = 129-bit capability.
Before virtual memory was a thing, almost all memory was accessible.
Virtual memory has nothing to do with whether 0 is a valid address. You can have a CPU where it is valid, or one where it isn’t and you’ll get an access fault if you try to access it. You can also have virtual memory where page 0 is mappable, or not.
I think the author knew that, based on the later points so it’s probably just bad wording. Interesting point about wasm too!
Ha that’s great and accurate!