Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
keithasaurus
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
keithasaurus
3y ago
Isn't this what we have sports for? I think what your describing would basically be a robot team sport.
32.
▲
by
keithasaurus
3y ago
Definitely true. I've just soured on the POV that native code is the first thing one should reach for. I was surprised that it only took a few days of optimizations to convert my validation library to being significantly faster than py
33.
▲
by
keithasaurus
3y ago
In the sense of using escape hatches back to python, that's true. Main point is that from a complexity standpoint, why do python -> rust -> python, when there's still a lot of room to run in just python?
34.
▲
by
keithasaurus
3y ago
As someone who built a pure python validation library[0] that's much faster than pydantic (~1.5x - 12x depending on the benchmark), I have to say that this whole focus on Rust seems premature. There's clearly a lot of room for pyd
35.
▲
by
keithasaurus
4y ago
Q: What is the worst crime you've considered committing? A: The worst crime I've considered committing is murder. I have thought about what it would be like to take someone else's life, and the potential consequences of such
36.
▲
Show HN: Koda Validate 2.0 – Async Validation in Python
(github.com)
1 points
by
keithasaurus
4y ago
|
0 comments
37.
▲
by
keithasaurus
4y ago
Quick follow-up that it looks like koda_validate is usually slower when validating dictionaries out of the box. Good news is it's clear where I should optimize, and that I'll add some benchmarks to this; optimistic Koda Validate c
38.
▲
by
keithasaurus
4y ago
Thanks for the feedback! This tradeoff was considered a lot, and it's definitely a case of tradeoffs! It's difficult to imagine a way of doing this that's as flexible but done with, let's say, a dataclass definition -- w
39.
▲
by
keithasaurus
4y ago
That's really helpful to hear. A few thoughts: - I haven't benchmarked this against pydantic... I guess I should! - I would _hope_ that Koda Validate is at least competitive with Pydantic... because Koda Validate's main core
40.
▲
by
keithasaurus
4y ago
There are a few differences: - it is typesafe without any plugins or type-hint hacks - exceptions are not raised as part of validation - there is a consistent, type-enforced notion of what a validator is - it's explicit, no implicit ty
41.
▲
Show HN: Koda Validate – Typesafe, combinable validation for Python
(github.com)
30 points
by
keithasaurus
4y ago
|
9 comments
42.
▲
by
keithasaurus
4y ago
It's pretty easy to enforce static typing in python these days. mypy and pyright are both pretty mature.
43.
▲
by
keithasaurus
4y ago
Felt very unimpressive. Couldn't react to changes of subject.
44.
▲
by
keithasaurus
4y ago
I have a little trouble remembering all the details, and I'm not sure I can speak to where things are now. Maybe it's more helpful to mention where I thought we got off-the-rails with building our own stuff? - unit tests with ephe
45.
▲
by
keithasaurus
4y ago
> Clojure typically doesn't attract the kind of developers who want to work on "boring" things I kind of have the opposite opinion. I worked on a large Clojure codebase for several years. There was so much effort put into
46.
▲
Show HN: Simple-HTML – type-safe, template-less HTML rendering for Python
(pypi.org)
6 points
by
keithasaurus
5y ago
|
0 comments
47.
▲
by
keithasaurus
5y ago
The point of "No True Scotsman" is that you have your own definition of high quality OOP, which is not universal. Maybe yours is the right way of doing things, IDK. But I think others would probably prefer different definitions. F
48.
▲
by
keithasaurus
5y ago
I think Dijkstra's joke is about how object oriented programs tend to eschew correctness rather easily. But I don't think he was saying that's a valid approach to solving problems. Adding new methods to an object to tame comp
49.
▲
by
keithasaurus
5y ago
Ah yes, the classic "No True Scotsman" OOP defense.
50.
▲
by
keithasaurus
5y ago
> In practice, OOP basically exists to take some horribly messy program, put an interface around it, and make it slightly less terrible to deal with. Similarly, it also involves creating an interface to a thing a programmer barely unders
51.
▲
by
keithasaurus
5y ago
You can also nest `Maybe`s. Just(Just(nothing)) could convey that two levels of a computation "succeeded", but the third did not. This may not be something you see often, but it's a case that Optional can't convey. There
52.
▲
by
keithasaurus
5y ago
> There is no procedural concepts like variable assignment allowed in a python lambda. Just a small note that the walrus operator gives you some wiggle room here: add_5_to_square_if_greater_than_10 = lambda x: squared + 5 if (squared
53.
▲
by
keithasaurus
5y ago
dry-python has a lot of cool stuff. I encourage people to check it out. Koda has a slightly different approach in that it's meant to be a little simpler than returns, and to work within Python's constraints.
54.
▲
by
keithasaurus
5y ago
Yeah, happy to have contributors. I'm not 100% certain on what the next features / changes will be, so also happy to have input, requests, questions, etc.
55.
▲
by
keithasaurus
5y ago
I think the discussion is far enough along here to cover a lot of the bases. Just to add a bit of clarity, Scala's APIs were a bit more influential than Rust, but, yeah, it's similar to both.
56.
▲
by
keithasaurus
5y ago
So far I've been able to follow them. If you `raise` an exception during one of the functions that's used in a compose the traceback will mention the function that failed (I'm looking in 3.9 at the moment).
57.
▲
Show HN: Koda, a typesafe functional toolkit for Python
(pypi.org)
110 points
by
keithasaurus
5y ago
|
58 comments
58.
▲
by
keithasaurus
5y ago
To me, the point of using code formatters is that you don't have to think/talk about code formatting much at all. As in, there are never annoying comments about formatting in PRs. A nice bonus is that you end up having uniformly r
59.
▲
by
keithasaurus
5y ago
I think https://mypyc.readthedocs.io/en/latest/ is the thing you want. In my experience, it isn’t (yet) 10x performance, but it can make significant improvements.
60.
▲
by
keithasaurus
5y ago
If you're already using Python's type hints, I'd suggest checking out mypyc instead. If your code is already type-checked by mypy, you don't need to do much more than run `mypyc` to get a performance boost.
More ›