Better HN
topnewbestaskshowjobs
Log inSign up

rtpg

21,276 karma · joined Nov 23, 2012 (14y ago) · 6,746 submissions

real name: Raphael

blog: https://rtpg.co

email: raphael at above domain

Submissions

comment 1y ago · link · parent

Shrug, I find them more helpful than Pydantic models for lots of canonical cases.

I have had good success with DRF model serializers in like Django projects with 100+ apps (was the sprawling nature of the apps itself a problem? Sure, maybe). Got the job done

As with anything you gotta built your own wrappers around these things to get value in larger projects though

comment 1y ago · link · parent

To be fair I do think that Pydantic leaning into the type annotation story is nice. If you’re really going lean or performant the restrictions work well in your favor. Just like… for the bog standard B2B SaaS the expressivity tradeoff just doesn’t feel worth it.

In a more just world pythons typing story was closer to typescript’s and we could have a fully realized idea like it that supports the asymmetric nature of serializing/deserializing and offers nice abstractions through the stack

Right now Pydantic for me is like “you can validate a straightforward data structure! Now it’s up to you to actually build up a useful data structure from the straightforward one”. Other tools give me both in one go. At the cost of safety (that you can contain, but you gotta do it right)

comment 1y ago · link · parent

In the Django world I have gotten very frustrated at people rushing to go from DRFs serializers to Django Ninja + Pydantic.

You have way less in terms of tools to actually provide nice straightforward APIs. I appreciate that Pydantic gives you type safety but at one point the actual ease of writing correct code goes beyond type safety

Just real straightforward stuff around dealing with loading in user input becomes a whole song and dance because Pydantic is an extremely basic validation thing… the hacks in DRF like request contexts are useful!

I’ve seen many projects do this and it feels like such a step back in offering simple-to-maintain APIs. Maybe I’m just biased cuz I “get” DRF (and did lose half a day recently to weird DRF behavior…)

comment 1y ago · link · parent

Was there ever? And is the situation improving or worsening?

I am alright with things that allow for improvement, at least in theory

comment 1y ago · link · parent

So Python 3.14 introduces this functionality. The process you want to debug needs to be on at least Python 3.14.

If you want to "just" use sys.remote_exec, you will need to use that from a matching Python version. If you dive into the implementation (check out the PEP), you could most definitely write a C or Rust program that implements remote_exec and "does the thing".

The protocol is basically "tell the program to read a python script from this file". That python script will be executed in the running program's environment, but you don't need for the software on the other side to be a python program!

sys.remote_exec itself only targets same Python versions though.

comment 1y ago · link · parent

Yeah I think pyrasite would be able to vastly simplify its implementation if it chose to (it might not though! the "same python version" requirements can feel strict)

comment 1y ago · link · parent

> What I'm hoping though is improved tooling around debugging Python. Currently, in my experience, VSCode (more specifically, debugpy) provides pretty much unmatched remote debugging capabilities, and I'm really hoping we can have a standardized way to connect any IDE to remote Python processes with the same UX as VSCode.

This is what 3.14's remote debugging protocol gives us. And even more than that, because I believe that debugpy needs to be invoked beforehand!

The value of this tooling is you don't need to predict that you need debugging before running the program. All of your Python programs[0] can be debugged. No need to restart. No need to modify the launch parameters either: you don't need the "debug configuration" from vscode, you just need a PID.

[0]: so long as you're using the same version of Python and it has the remote debugging protocol enabled, and also you have the right OS permissions

comment 1y ago · link · parent

Fair enough.

I think that the attitude of the government has shifted but not by _that_ much, and I don't think we can discount the past 50 years of urbanism as having no effects (plenty of the stores I'm thinking about aren't 100 years old after all). But I won't pretend to believe that we can't have nice things taken away from us.

I don't know how we get new Nakano Broadways in the current environment.

comment 1y ago · link · parent

> What's the end game with this? Identikit cities with little to no character, all created to prioritise convenience.

People say this but Tokyo preserves _way more_ weird subculture stuff and small stores than other major cities IMO, despite constant rebuilding. My theory is basically that because it's nice and dense, and the real estate is extremely liquid by my understanding, stores and restaurants can get their 100 superfans that support the business.

Like I moved to Australia a couple years ago and I have no idea how anyone could afford to open a small independent shop, and you see loads of chains.

Tokyo it's harder than before, but places like these shopping arcades offer some respite (along with other shopping centers).

I am worried that the Tokyo government isn't particularly interested in preserving these places though. They have openly said they want more places to be redeveloped like Ginza of all places.

comment 1y ago · link · parent

Kyoto Sanjo got "killed" by COVID. Lived in the area for a bit, and when I visited in 2024 there were so many things just gone

comment 1y ago · link · parent

I usually work, then do `jj split` to review changes I want to make commits to. This generally makes the workflow look like `git add -p`.

A decent mental model is that the top-most commit isn't generally going to get pushed up anywhere. It's like your working copy but also you get stashing "for free" (change back to main to make a new commit? All the WIP stuff stays on that branch instead of being carried over to main!)

comment 1y ago · link · parent

I like how asyncio could just be built off of generators, and how it all ... well it mostly works, and it works well enough for people who care enough to make a whole async stack.

I am very unhappy with asyncio leading to the gold rush of a lot of people writing "async-capable" libraries that all make (IMO) really gnarly design decisions in the process. I have seen loads of newer Python projects that take async-capable libraries that make life harder for people who like shipping stable software.

Meanwhile a lot of existing libraries/frameworks that just have more "serious" overall designs have to churn quite a bit to support sync and async workflows.

I care a lot about Django getting async ORM support in theory, but at this point I don't know how that's happening. My current mentality is crossing my fingers that something akin to virtual threads[0] happens

[0]: https://discuss.python.org/t/add-virtual-threads-to-python/9...

comment 1y ago · link · parent

Sure they would have! The elite of the United States that lead the revolution were all extremely mercantile and many were coming to the colonies to run their own little fiefdoms away from the crown.

One should acknowledge how many of the freedoms locked into the founding ideology of the US is pretty close to what libertarians reach out for. I don't know many libertarians arguing against Citizens United.

That isn't to say that the US can't aim for something different, and that the core of the nation today likely believes many different things.

We can choose our own destiny without trying to ascribe every good idea to what a group of people thought at the founding of the country.

comment 1y ago · link · parent

Pressure campaigns could lead to laws regulating the card industry, self regulation prevents some of that (see movies and games ratings agencies, which avoid government ratings coming in and potentially connecting an 18+ rating with outright bans like we’ve seen in the UK and Australia in the past)

comment 1y ago · link · parent

but I can have a smaller phone and also use the battery pack to charge my spouse's phone, not just my own

comment 1y ago · link · parent

> finance a couple of "fun" local entertainment businesses (idk craft breweries or barcades or minigolf or climbing gyms or escape rooms or whatever would be enough of a draw), fund a local arts/music program, and start a small tech/finance/consulting business in town

People who do this kind of stuff without much personal involvement get surrounded by consultants who do lowest common denominator nonsense with everyone taking their 30% extra on top of costs (because the person paying isn't paying attention!), and you end up with a bunch of stupid gastropubs that aren't profitable, and your IT company doesn't have any local talent.

Almost every restaurant and business that people actually like survives by having some owner put a bunch of energy into it. I don't think there are that many people who would be willing do that... and if you pay people to do it for you the economics really stop working extremely quickly.

At one point the billionaire will be tired of dropping $5 million a year for their pubs that nobody actually cares about

comment 1y ago · link · parent

I've come around on swapping batteries, and have decided that external battery packs are the way to go. Works on more devices, and you're not buying batteries that work on exactly one device.

Still want my phone battery to be replaceable, but I'm pretty fine with not being able to do it myself.

comment 1y ago · link · parent

the foldables seem to have found their niche at least in this space though. But they get away with it by... also being a big phone

comment 1y ago · link · parent

I think photos are a big deal, but IMO it's more about the photo quality. And if you put a nice fancy camera on the phone, suddenly the device gets pretty expensive.

And so while there are people who want "small screen + nice camera". There are people who want "small screen + small price". There are many people who _don't want the small screen_. So you have this phone that can cost a lot of money (in a pretty messy market where most phone models seem to not make money anyways), and you're going to cut off chunks of the market?

So we end up with small screen + shitty camera and specs etc. And people here who want a small phone (but really want a small phone that isn't miserable to use) still are unsatisfied.

comment 1y ago · link · parent

Tbh I disagree, the official vertical tab support is so nice and less janky than any of the extensions I used that had this functionality

After opening FF while previously using Arc for a while I was super happy with the usability improvements (that don’t seem to have impacted older workflows fortunately… big fan of how FF makes it easy to customize the toolbar etc)

comment 1y ago · link · parent

Fair enough, I can agree with the idea that you draw the line at "knowledge, gotten in the 'correct' way" as the categorization strategy.

In the abstract I'm open to some specific traditional medicine thing working for "some" reason, but I understand that that makes me (as they say in the industry) a mark.

comment 1y ago · link · parent

> Outside of top tier programs (think Peking tier programs in China or AIIMS tier programs in India), that's nonexistent in most Asian countries, so your department's funding is at the whim of government bureaucrats

That's a bit surprising, after seeing so many people I know in academia who are basically being used as private sector R&D on the cheap (see all the formal methods work being funded by cryptocurrency outfits...), I would have assumed that most large corporations even outside of "innovation" sectors would take advantage of this.

But maybe this effect in places like the US are just downstream of the wild wage arbitrage you get by doing this.

comment 1y ago · link · parent

I'm not particularly bought into the traditional chinese medicine stuff but isn't the line more drawn at how "normal" medicine is about synthesizing specific doses of chemicals to give those?

Meanwhile if someone told me "yeah eating a bunch of ginger when you have a cold is good to you because ginger has a bunch of stuff that's good for your body then" I don't have a particularly hard time believing it. Sure! Why not!

The article's critique about symptom management rather than disease management is legit though. And the precision for actual research is good. But at the end of the day if my body needs some stuff for symptom management and some TCM strategy involves me giving myself like 20x the dose of it... well it's something, isn't it? Though you could argue about it "deserving" credit or not.

Nobody whines about the unscientificness of giving yourself a bunch of salt through chicken noodle soup after a hangover.

comment 1y ago · link · parent

Yeah I think the one I played also had triangular maps.

comment 1y ago · link · parent

As an emacs user I'm often writing small snippets of elisp for my own needs, and for snippets it's fine. But I dislike what most lisp's scoping strategies do to "normal" indentation of code. Any function with even a single intermediate value, indented due to a `let`! It's noticably more symbols compared to my Python stuff.

On top of that, being unable to just slap in big docstrings in my code makes me sad. Docstrings are useful.

This isn't the end of the world, but it's something that bugs me.

comment 1y ago · link · parent

what I'm thinking of is, I believe, much older. I remember playing it before 2010 at least based on the machine I was playing it on. And it was distinctly "windows" styled: it looked like windows minesweeper!

comment 1y ago · link · parent

Many many years ago I remember playing a free minesweeper that had, among other things, hexagonal maps as an option, but the big thing was that it guaranteed that you would never need to guess. You could always figure out the answer, and I believe there was a mode where if you clicked in a way where you couldn't have deduced the answer it would put a mine in there to punish you.

Anyone know what minesweeper software I'm thinking of?

1
222324
225