HNHacker News
TopNewBestAskShowJobs

onetoo

129 karma · joined March 5, 2020

submissionscomments
onetoo··on Python 3.13 Gets a JIT
I didn't say python can handle <=1K, I was saying >=1K. I feel confident that I am orders of magnitude off the real limit you'd meet.

The specifics of that aside, any unprepared application is going to buckle at a sudden mega-surge of users. The solution remains largely the same, regardless of technology: Make sure everything that can be cached is cached, scale the hardware vertically until it stops helping, optimize your code, scale horizontally until you run out of money. I imagine the DB will be the actual bottleneck, most of the time.

There are other reasons to not choose python for greenfield application, but performance should rarely be one IMO.

onetoo··on Python 3.13 Gets a JIT
I would still recommend running it properly locally, but whatever. Pseudo-devcontainer it is. I assume the code is properly volume mounted.

In production, you would want to run your app through gunicorn/uvicorn/whatever on an internal-only port, and reverse-proxy to it with a public-facing apache or similar.

Set up apache to reverse proxy like you would on prod, and run gunicorn/uvicorn l/whatever like you would on prod, except you also add the autoreload flag. E.g.

    uvicorn main:app --host 0.0.0.0 --port 12345 --reload
If production uses containers, you should keep the python image slim and simple, including only gunicorn/uvicorn and have the reverse proxy in another container. Etc.
onetoo··on Python 3.13 Gets a JIT
The restart isn't expensive in absolute terms, on a human level it's practically instant. You would only do this during development, hopefully your local machine isn't the production environment.

It's also very easy, often just adding a CLI flag to your local run command.

edit: Regarding performance, Python today can easily handle at least 1k requests per second. The vast vast vast majority of web applications today don't need anywhere near that kind of performance.

onetoo··on Why Aren't We Sieve-Ing?
You can't possibly optimize sorting in a way that makes sense for every user. Let us use insertion sort in our standard library and call it a day. Why are you bothering to discuss general-case sorting algorithms?
onetoo··on Why Aren't We Sieve-Ing?
We should use the right words for things.

Insertion sort is heuristically good in many practical circumstances. You wouldn't call it optimal, nor choose to use it as your general-purpose sorting algorithm.

onetoo··on Why Aren't We Sieve-Ing?
Strictly speaking, that approach would help you find a heuristically good algorithm, but not necessarily the optimal one. Those are very different.
onetoo··on The phrase "no evidence" is a red flag for bad science communication (2021)
I think it's to communicate that even if you think it's not that bad, it's never good: A single beer every month probably won't kill you, but there is a non-zero increase in risk. By definition, any amount is a danger.

I believe that kind of communication intends to combat the more laissez faire "a beer here and there won't kill you," which glosses over the fact that, yeah, it probably won't, but it's also not without statistical risk. Getting rid of that attitude reduces the risk of alcohol-related health complications across the population as a whole.

onetoo··on Why Aren't We Sieve-Ing?
Having a strong default starting point is nothing to scoff at. You wouldn't want a standard library to use insertion sort because "no singular approach works optimally in all cases, so why bother trying for good general case?"
onetoo··on Why Aren't We Sieve-Ing?
I'm sad that this ends on a cliffhanger, I was excited to see the results for the circular array version. Hopefully I don't lose track of this story when (if) someone who knows what they're doing does that test (I am not such a person, or I'd do it myself).
onetoo··on Are we stuck with the Zoo Hypothesis?
Not an expert in this field, but I don't believe we are looking for any directed "Hello, we are over here! Look at us! Hey, humans, hey, over here!" signals, but more "literally anything that would imply the existence intelligent life."

Humanity blasts all sorts of signals indiscriminately into the universe. Our best guess is that other intelligent life would do the same. I mean, sure, obviously we're also looking for the former, but we're expecting the latter.

onetoo··on The Therac-25 Incident
It is always sobering to read this story. I feel an obligation to read it through every time I stumble upon it.

A lot of what we do as software developers really doesn't matter, so it's easy to forget that sometimes it does.

Regulations are written in blood.

onetoo··on Exploding head syndrome
This happens to me about once every few months. As the article states, just learning about it and feeling reassured that nothing is wrong turned the experience from terrifying to just slightly annoying.

In my case, getting my sleep apnea treated with a CPAP machine coincidentally greatly reduced the frequency of these episodes. Your mileage may vary.

It last happened about a week ago: I could swear I was woken up by a cluster of firework explosions going off in the distance, some 100m away. A sudden burst of sounds along with a lot of gentle but noticable shockwaves.

onetoo··on Ask HN: What web stack would you use for startup, and why?
I feel like Microsoft's naming division has a mandate to cause as much name collision as possible, so that "out of date" requirements at very big very slow enterprises suddenly and magically target the latest hotness.

It is my main gripe with the .NET ecosystem. Don't get me started on Azure..

But once you get over the hump and understand the meaning of the subtle differences, it's possible to make sense of it.

onetoo··on Ask HN: What web stack would you use for startup, and why?
Blazor Server isn't inherently latency riddled. Blazor Wasm isn't necessarily slow to initial load with .NET 8. IIRC the compiler is also really good at trimming the Wasm bundle when publishing in Release mode.

The neat thing about the new stuff in .NET 8 is that you can choose the interactivity at the component level, so if some component really sucks when used with Server interactivity, you can take the extra time to convert it to Wasm w/ some backend API.

You should also ask your shoulder demon much would even be interactive in the first place. SSR'd pages with forms can get you very far.

onetoo··on Ask HN: What web stack would you use for startup, and why?
Full .NET stack.

- Self-hosted identity management, "ASP.NET Core Identity", using new scaffolding from .NET 8

- Blazor, using the "Auto" mode from .NET 8: Default to SSR, autopromote to Server mode for live updating components

- EF Core for DB handling

The idea is to focus on keeping things simple and easy for the developer. The most annoying part about the stack is the way Microsoft names things.

Keeping the rendering logic fully server-side lets you use your EF DbContext/entities directly in your components, taking on some (I'd say minor) technical debt to greatly simplify development.

You won't need a fully separate SPA with a dedicated API. Not yet, maybe ever. You can migrate your components to Blazor Wasm piecemeal if/when you reach a stage where using Server mode starts giving you troubles.

onetoo··on datetime.utcnow() is now deprecated
Christmas is on December 24 where I'm from.
onetoo··on Fedora 39 Released
Not all UI elements scale with font size.

Illustrations, nested element containers, navigation controls, etc. It looks very comical when you first see it.

onetoo··on The Ruff Formatter: A fast, Black-compatible Python formatter
FWIW the (seemingly?) complete lack of bikeshedding makes it a lot easier to approach Go over Python wrt. tooling. IME it feels impossible to make an informed decision without already being knee-deep in the ecosystem, and yet new developers are forced to decide as part of their IDE setup. It's just plain cruel.

I say every language should standardize on an extremely opinionated formatting tool, whatever those opinions happen to be. To the point where source code should be considered to have a canonical representation. Get rid of the sheds and bikes.

Unfortunately, there are often 14 competing standards...

onetoo··on Building muscle in the lab
Disregarding moral or sustainability reasons and taking a more cynical view, I can understand taking a long-term bet on the technology improving enough for lab-grown to become a cheaper alternative.

If we ever reach that point, whoever's in the market to capitalize on the opportunity is going to be very well off.

onetoo··on Are Implicit Operators a Path to Clean Code or a Buggy Nightmare?
At the risk of being a pedant, I think your argument is too absolutist for it to really mean anything.

The exact same argument can be used by a sufficiently stubborn greybeard to bemoan the fact that C implicitly decides what registers to use for variables, as well as by a more "modern" developer to complain about == vs === in JS.

Surely you agree these levels of implicitness are not the same?

onetoo··on SQLite-based databases on the Postgres protocol? Yes we can
The mental model of "a single DB file" is a easier to grog than a large and seemingly opaque DB server.

Most (all?) of the well-known RDBMS are designed to host the data needs of multiple separate applications, which makes configuration look a lot more complicated when all you want is n=1.

onetoo··on My pay went from $240k to $0
I am not from the US, but I always have a union lawyer look at my employment contracts before I sign them. It's part of my union's service. If you ask me, "expert legal team on retainer" is one of the primary reasons for being part of a union.
onetoo··on EU Digital ID wallet is coming
I believe most European countries have their own solutions similar to this. e.g. in Denmark we have NemID/MitID as the way to digitally authenticate yourself to the healthcare system, your bank, etc.

If I understand correctly, this EU initiative would unify all these separate country-level identification tools into something that works EU-wide, so I can take my Danish digital ID and e.g. use it in a bank in the Netherlands.

onetoo··on Show HN: 128-bit, roughly-ordered, URL-safe UUIDs
Probability of no collision in a single millisecond: p_1 = 999999999/1000000000

Milliseconds in a year: t = 1000 * 60 * 60 * 24 * 365

Probability of no collision happening for every millisecond of a year: p_2 = p_1^t

Probability of a collision happening for at least one millisecond of a year: p_3 = 1 - p_2

https://www.wolframalpha.com/input/?i=1+-+%28999999999%2F100...

onetoo··on The Turing-Completeness Problem
What you are describing is essentially a nondeterministic Turing machine. "What can you compute"-wise, NTMs are equivalent with TMs, and the halting problem still applies.

NTMs are interesting when it comes to computation time, however. Open question: Can a TM compute in polynomial time what a NTM can compute in polynomial time?

onetoo··on Path of Exile (Poe) Is a Worth Playing MMO – Five Reasons to Explain That
PoE is a great game, but this post just seems like an ad for RMT services, which are very not allowed in PoE and will get you very banned.

Looking at OP's post history, it seems like all they do is advertise these RMT services.

This post should be deleted.

edit: RMT is 'real money trading'; buying currency is RMT

onetoo··on ImTui: Immediate Mode Text-Based User Interface
Good question. I suppose I am basing my argument on text-based GUIs as a whole instead of this library in particular. I have no opinion about this library vs. other text UI libraries, other than the fact that it is visually stunning.

In my experience with TUI apps (RTV, IRC clients, even vim, as much as that pains me to admit after the days I've spent fiddling with my vimrc.), it was always worse UX compared to a native GUI version, for some definition of native GUI that includes browsers/electron. I don't mean literally no one will use TUI apps, but I don't see a killer use case for them.

To refactor my question: What is the use case for TUI that isn't better served as a native GUI or proper CLI?

Sure, GDB with a TUI sounds neat, but I don't see how it wouldn't be better served as a native GUI (Which seems to already exist[1]. Neat).

[1] https://www.gdbgui.com/

onetoo··on ImTui: Immediate Mode Text-Based User Interface
While the interfaces this creates look absolutely gorgeous, I struggle to see actual use cases for this outside of toy examples and browser replacement apps that are going to be used by no one.

If that is all that this is intended to be, then great, good job, looks amazing. If not, can anyone enlighten me about an actual use case for this?

onetoo··on Consistency: How to defeat the purpose of IEEE floating point (2008)
This is also an issue in video game programming, where this lack of consistency causes issues in the implementation of replays or lockstep networking. The core idea of both is to store/share the inputs for each frame, such that the game's state can be derived from them. Even small inconsistencies every frame can explode in size due to the sheer amount of frames.

If you think this article is interesting, you may also be interested in learning about posits.

They are an alternative to floats with better precision near 0, which, the authors claim, makes them superior for things like machine learning. Relevant to this article is the fact that they are defined to be consistent, so if they become popular this will never be an issue again.

Here is an article from the authors of posit which explains its advantages. http://www.johngustafson.net/pdfs/BeatingFloatingPoint.pdf

Here is a more nuanced look at posits, which explains its disadvantages. https://hal.inria.fr/hal-01959581v3/document

← PreviousPage 2 of 2