Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
maleldil
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
47 ms
·
631.
▲
by
maleldil
2y ago
Monadic error handling (such as Rust's) is a good compromise because it allows you to handle errors precisely when you want to _and_ bubble them up with minor boilerplate when you don't. You can even add context without unwrapping
632.
▲
by
maleldil
2y ago
You misunderstood. They meant that Java's checked exceptions are very verbose and that Rust's approach to errors is similar. While Rust's approach is less verbose, it's still more verbose than "regular" (unchec
633.
▲
by
maleldil
2y ago
I don't get it. Why not use a code editor that shows the inferred type on hover?
634.
▲
by
maleldil
2y ago
The exact same way it works in Rust. C++'s RAII works the same as Rust's Drop trait. The object is released when it goes out of scope, and if it's shared (e.g. Arc), it's released when the last reference to it drops.
635.
▲
by
maleldil
2y ago
> Have you read any real world Rust code? Junior developers just add unwrap() until things compile. If you really don't like unwrap[1], you can enable a linter warning that will let you know about its uses to flag it during code rev
636.
▲
by
maleldil
2y ago
> what's the difference between your program and one with exceptions Because errors as values are explicit. You're not forced to use ? everywhere; you can still process errors however you like, or return them directly to the ca
637.
▲
by
maleldil
2y ago
Are you a paying customer? I exclusively use their best model and while I get warnings (stuff about longer chats leading to more limit usage), I've never been kicked out. The only thing is that they've recently started defaulting
638.
▲
by
maleldil
2y ago
backoff is good, too: https://github.com/litl/backoff I moved away from tenacity because of type-checking issues. I might check out stamina next time.
639.
▲
by
maleldil
2y ago
None of those drop-in replacements for Pandas. The main draw is "faster without changing your code".
640.
▲
by
maleldil
2y ago
While I agree, it's worth noting that this project is a drop-in replacement (they claim that, at least), but Polars has a very different API. I much prefer Polars's API, but it's still a non-trivial cost to switch to it, whic
641.
▲
by
maleldil
2y ago
Sure, but the fact that weird stuff is possible means that someone, at some point, will try to use it in your codebase. This might be prevented if you have a strong code review culture, but if the lead dev in the project wants to use someth
642.
▲
by
maleldil
2y ago
If you have a commit that doesn't compile, it should have been squashed into another commit before merging the PR. Every commit should be in a valid state. I'm not talking about a full squash merge, just `git rebase -i` to make su
643.
▲
by
maleldil
2y ago
Python doesn't follow SemVer, that's why. https://peps.python.org/pep-2026/
644.
▲
by
maleldil
2y ago
100 Mb is a lot of data to download. Maybe you should be upfront about it and, hopefully, require some user input before you do it.
645.
▲
by
maleldil
2y ago
I envy that you only stop at lights for 1-2 seconds. Where I live, you'll find not only heavy traffic but also red lights that are several minutes long.
646.
▲
by
maleldil
2y ago
> disable the engine off at red light thing. Why do you do that? I find that it barely impacts my driving experience, and it's an easy way to decrease emissions.
647.
▲
by
maleldil
2y ago
That doesn't sound true. The quickest way would be for the keys to be in the home row.
648.
▲
by
maleldil
2y ago
That's GPT-4, which you wouldn't use for in-line suggestions because it's too slow. I don't know what model Copilot uses these days, but it constantly makes bracket mistakes in Python.
649.
▲
by
maleldil
2y ago
Note that the default mode will automatically change and commit the code, which I found counter-intuitive. I prefer using the architect mode, where it first tells you what it is going to do, so you can iterate on it before making changes.
650.
▲
by
maleldil
2y ago
It depends on the model and the problem. As an example, BERT-based models have a special [CLS] token that was pre-trained to encode information about the whole sequence. A reward model based on BERT would take the output embedding of that t
651.
▲
by
maleldil
2y ago
If they make it possible to add this a search engine on Firefox like it's possible for Perplexity, I might drop Perplexity for good.
652.
▲
by
maleldil
2y ago
There are multiple ways to model reward. You can have it be fine-grained, such that every token gets its own reward, but by far the most common is to feed in the whole sequence and generate a single reward at the end.
653.
▲
by
maleldil
2y ago
> all because other companies can't make a good keyboard or touchpad Or screen, sound, battery life, cooling, weight... Are MBPs the best possible configuration out there? Of course not. But they're just much better _mobile dev
654.
▲
by
maleldil
2y ago
What do Java generics have to do with Python's abstract base classes?
655.
▲
by
maleldil
2y ago
Is the size of OpenAI's models public, or is this guesswork?
656.
▲
by
maleldil
2y ago
Unfortunately, when many people hear of static typing they think of C++ and Java, which understandably leads to these kinds of conclusions. If they ever bothered writing typed Python for a little bit, especially in new packages or projects
657.
▲
by
maleldil
2y ago
That misses the primary reasons many people use Python: the ecosystem and network effects. I would not use Python if it weren't the only language my colleagues know (many of them not computer scientists by training) and if it didn'
658.
▲
by
maleldil
2y ago
You picked a poor example for `mean` because there's a very easy answer: collections.abc.Sequence – typing.Sequence in earlier versions – an object that supports __getitem__ and __len__. You can check the collections.abc documentation[
659.
▲
by
maleldil
2y ago
Interesting how this seems to go completely against another post I saw here: https://steveklabnik.com/writing/against-names/
660.
▲
by
maleldil
2y ago
> don’t ever use the OS’s own Python if you can avoid it. This includes Homebrew's Python installation, which will update by itself and break things.
More ›