Better HN
topnewbestaskshowjobs
Log inSign up

qbasic_forever

10,505 karma · joined Feb 3, 2021 (5y ago) · 2,505 submissions

Submissions

comment 3y ago · link · parent

Ehh slots have issues too, particularly that if you use them they punch through and totally ignore your shadow DOM to inherit the main body styles. Sometimes you want this behavior and sometimes you don't, but either way you only get it and have no control over the elements passed in the slots. They defeat the whole point or just greatly complicate the idea of encapsulating your element's visuals in one component.

I'm truly skeptical there is much to be gleaned accessibility-wise from templates if JS is disabled. There's no way to know how and where the template was meant to be instantiated in the DOM and accessibility tree without JS.

comment 3y ago · link · parent

ChromeOS is still using the plain old monolithic mainline Linux kernel.

comment 3y ago · link · parent

Web components are really only useful for stuff that's dynamic, like a sortable table that fetches data from an AJAX request. They require javascript and have no fallback or graceful degradation in functionality at all, which means using web components for all your bog standard buttons, text content, headers, etc. could be a very bad idea (not to mention it would trash the SEO and potentially accessibility of your site).

IMHO you probably want to look at design tokens or other ways to centralize your visual styles--it's really more of a workflow problem and not just something to throw more javascript at with web components.

comment 3y ago · link · parent

Queens or the Bronx in NYC. They're big city but full of real, working class people and immigrants. Parts of Brooklyn are good too (but also parts of Brooklyn are just as bad and worse than DC). Definitely not Manhattan, lol--it's DC attitude and costs but everyone works for banks and finance instead of the government.

comment 3y ago · link · parent

As I understand it the drug use screening in a security clearance isn't so much because the government are squares but it's that illegal drug use is something that could be used to blackmail you. The worry is if the KGB learns about your cocaine habit they could confront you and demand you work for them as a double agent or they'll expose your illegal activities and ruin your life.

comment 3y ago · link · parent

LK-99 is already patented so even if Elon were making a ton of it, he couldn't do much in his products without licensing it from the creators.

comment 3y ago · link · parent

On modern systemd-based Linux systems that use its systemd-resolved DNS resolver it automatically forwards all *.localhost traffic to your local host. It works great with caddy for local development and testing of services.

comment 3y ago · link · parent

The terrible performance you remember is from slow hard drives and just a couple megabytes of RAM. Retro computing enthusiasts today have win 95 running on solid state flash disks and 32 megabytes of memory and it flies.

comment 3y ago · link · parent

No it will be the same level of skill and difficulty to do correct shared memory multithreaded programming. You'll have to manually manage locks and reason about potential for deadlock or other race conditions.

If anything it will be harder as the implicit serialization of the GIL being removed means libraries might suddenly develop race conditions that you've never experienced or seen before, likely causing spectacular crashes and undefined behavior or bugs.

comment 3y ago · link · parent

Correct, it will help with CPU-limited, embarrassingly parallelizable problems... which are much less common than you think.

comment 3y ago · link · parent

Are you just reading from this data structure? If so I wouldn't do any locking or threading, I'd just use asyncio to serve up read requests to the data and it should scale quite well. Multithreading/processing is best for CPU limited workloads but this sounds like you're really just IO-bound (limited by the very high IO of reading from that data structure in memory).

If you're allowing writes to the shared data structure... I'd ask myself am I using the right tool for the job. A proper database server like postgres will handle concurrent writers much, much better than you could code up hastily. And it will handle failures, backups, storage, security, configuration, etc. far better than an ad hoc solution.

comment 3y ago · link · parent

Cybergoth culture: https://en.m.wikipedia.org/wiki/Cybergoth

comment 3y ago · link · parent

Even pure python code could have race conditions with the GIL disabled. Stuff like accessing and modifying a dictionary item in python code is assumed and currently guaranteed to be atomic because of the GIL. Remove the GIL and decades of assumptions break.

comment 3y ago · link · parent

It does, so much so things like virtualenv were introduced so every program can have its own set of dependencies such that they won't clash with other libs on your system. Something like flask or fastapi pull in a lot of secondary dependencies alone.

comment 3y ago · link · parent

Yep I fully agree. It's going to ultimately mean 99% of people end up running in old GIL mode with deterministic behavior. Companies will get burned and have to have policies that absolutely under no circumstances will the GIL be disabled in their codebase. A very small handful of highly skilled and funded teams, probably at big companies only, will have the time and tenacity to make their code AND all their dependencies work in a multithreaded environment without the GIL.

comment 3y ago · link · parent

It's good if there's a benefit for everyone, like python 3 fixing the terrible Unicode story. It's not clear non-GIL will even be a net performance improvement for most people--you are effectively moving syncronization from the core runtime to each and every library and program at the edge. Writing safe code at that level doesn't come for free, your basic program will be slower (and likely buggier) if every call into a library is now doing its own little bespoke GIL instead of relying on python's global one like now.

comment 3y ago · link · parent

Where will you get no-GIL libraries, especially in the early days? Just yell at the maintainers of core libs like flask and requests until they use their volunteer and spare time to implement incredibly complex and tricky locking semantics all over their codebases, AND test it all with both GIL and non-GIL interpretors at scale to suss out race conditions? That just happens for free and overnight because a lot of people are plus one mashing on GitHub issues I guess?

comment 3y ago · link · parent

Yep, and you'll have pip3-gil and pip3-nogil binaries because each permutation of python has separate and incompatible site-packages folders and libraries. It could get really ugly.

comment 3y ago · link · parent

You're saying, "just rewrite and re-release all your dependencies, it's easy!" which was exactly what happened disastrously with python 2 to 3.

comment 3y ago · link · parent

Presumably C extensions will have a different API name/ABI to prevent accidentally calling into GIL code when in non-GIL mode and vice/versa so that's going to complicate the compatibility story.

comment 3y ago · link · parent

Agreed--there needs to be discussion and thought about how this impacts library maintainers. How do they tell users their library supports or doesn't support non-GIL mode? Will pypi have new metadata to specify and enforce projectsdependencies support non-GIL mode, or is it just a chaotic free for all where users have to figure that out themselves? How will a library author have one codebase that supports both GIL and non-GIL mode--will they effectively fork the code and maintain two codebases (yuck!) or will there be support for detecting GIL mode? How does this work for C extensions too? There's a ton of work to make this smooth for libraries and I really hope it is being thought through better than the python 2 to 3 story for library authors (which was no story and chaos).

comment 3y ago · link · parent

That's the exact attitude that lead to decades of pain with the 2 to 3 transition and libraries though. There was zero plan for how to help libraries migrate from python 2 to 3, or more importantly how does one library support _both_ python 2 and 3 from one codebase as their users take time to switch their python interpretor. The attitude of "just turn off GIL if you don't need it, just use libraries that support turning it off" means library authors will be asked to provide versions of their library that do and don't support non-GIL mode. That's a big burden to dump on library maintainers.

comment 3y ago · link · parent

Yep there are a ton of issues like that to be found, and unfortunately they will manifest as difficult to find and debug race conditions. This is why the proposal and work is to make non-GIL mode entirely optional and not the default.

It just means for the brave few that flip it on and use it, be prepared to spend a huge amount of time finding and fixing subtle race conditions in decades of old python library code. The early adopters are going to be in for a lot of pain, or more likely they'll restrict their use of non-GIL processes to very specialized and dedicated processes that have as few dependencies as possible.

comment 3y ago · link · parent

Like I said in another reply that's just for drawing tiles, but it has to store level state (what enemies are alive, where they're at, what items have been collected, etc.) in RAM and is severely limited to less than 2kb of data there. A DOS PC has 640kb to multiple megabytes of RAM--you can have thousands of enemies, items, etc. with tons of room to spare.

comment 3y ago · link · parent

It's only more performance if you're using the threading primitives and spawning new threads, moving work to them to do in parallel, etc.--this isn't something any beginner will consciously be doing. It might actually be slower in regular single process use that 99% of python users use (since the GIL is there for a very good reason and synchronizing access to python's internal state doesn't just happen for free or without some cost somewhere).

comment 3y ago · link · parent

Slightly faster performance when you write multithreading code correctly (much easier said than done). Very few python devs are actually running into this as a bottleneck day to day.

comment 3y ago · link · parent

Yep I think over the next year a lot of python devs are going to learn threading isn't magic pixie dust that makes your code fast, and in reality is starts by making your code very unstable.

comment 3y ago · link · parent

Yeah it's going to be weird for some years where some libraries support no-GIL and others don't, while folks cry about the ones that don't support it holding them back.

Like asyncio's introduction we'll probably see core stuff like http requests, file IO etc. all now have an entirely new permutation of libraries made to support non-GIL mode. This is going to get pretty spicy as stuff like http already has regular (blocking IO) and asyncio (non blocking IO) versions, so now do they need regular non-GIL and asyncio non-GIL versions too? Is the default for a library author going forward to be creating four permutations of your library with vastly different behavior in each of them? Yuck.

comment 3y ago · link · parent

You needed to store the state of the entire level, like what enemies are alive, what treasures have been collected, etc. and that turns into a non trivial amount of stuff to store in RAM (only about 2kb on the NES!) for large and complex levels. You can't store that stuff in ROM since it's changing as the player progresses. A PC at the time could guarantee 640k or more of RAM alone.
12345
84