HNHacker News
TopNewBestAskShowJobs

develatio

1,242 karma · joined May 23, 2021

submissionscomments
develatio··on So you think you know box shadows?
dgerrells, please add RSS support to your blog!
develatio··on Google Chrome has an API accesible only from *.google.com
There is a link pointing out the exact place in Chrome's code.
develatio··on What's up Python? Django get background tasks, a new REPL, bye bye gunicorn
I have been doing Django for most of the last 10 years and I love it. I love Python. I love how well made are most of its core parts. And I love how some 3rd party packages (DRF aka django-rest-framework, django-filter, django-storages) fill the "missing" gaps.

That said, boy does Django must change it's current strategy...

RoR and Laravel have been getting all sort of goodies baked in the framework itself such as tasks queue, nice admin features, integration with frontend technologies (scss, js, even jsx/tsx), even entire packages to manage payment systems, mailing and so on... Good quality features that are ready to use and are integrated inside the framework, which easy to use APIs and fantastic admin integration.

Django devs, on the other hand, have been (imho) ignoring the users (devs) and have been denying any and all attempts at bringing something similar to Django. There are at least half a dozen packages for each "thing" that you want to do, and some are in a very good shape, but others are just hopelessly broken. What's even worse, because they're not part of Django, most of the time there are some edge cases that just can't be implemented without subclassing Django's core.

One of the most recent examples being Django's support for async operations. Except that Django itself doesn't provide a nice way to create / expose an API, which is why people use DRF. But DRF doesn't support async, which is why you need to add "adrf" (https://github.com/em1208/adrf) to DRF. But adrf doesn't support async generic viewsets, so you must add aiodrf (https://github.com/imgVOID/aiodrf) to adrf. But aiodrf doesn't support (...) you get the point. You end up in a situation in which you're pilling packages on top of packages on top of packages just so you can have an asynchronous API. Madness.

Supporting scss it another example of pilling packages on top of packages. It just never ends...

I can't express the desire I have for Django to start integrating packages into its core and get on par with RoR and Laravel.

/rant

develatio··on Cloudflare took down our website
175 comments and +350 points in 1 hour is anything but "vanished interest" imho.
develatio··on Making EC2 boot time faster
By "the size" I meant to say "the size of the infrastructure", meaning that AWS has to manage orders of magnitude more instances than Hetzner. This might as well contribute to "things" being slower.
develatio··on Making EC2 boot time faster
Maybe AWS should actually take a look into this. I know comparing AWS to other (smaller) cloud providers is not totally fair given the size of AWS, but for example creating / booting an instance in Hetzner takes a few seconds.
develatio··on WinBtrfs – an open-source btrfs driver for Windows
How come this has "basic and advanced" (whatever that means ¿?) RAID 5/6, while BTRFS itself doesn't? (https://btrfs.readthedocs.io/en/latest/btrfs-man5.html#raid5...)
develatio··on IKV: embedded key-value store, 100x faster than Redis
“100x faster than Redis” hosted where? on a machine across the world? on a machine across the country? on a machine in my local network? on the same server that my application is sitting?

This a very bold statement.

develatio··on Hold on there: WPA3 connections fail after 11 hours
This is the hardware version of Netflix's "Are you still watching?"
develatio··on RcloneBrowser: Simple cross platform GUI for rclone
I haven’t personally used rclone mount (neither OPs project), but your link contains quite some caveats and external required applications (on windows). Maybe an rclone GUI would be more friendly to some people.
develatio··on Slashing data transfer costs in AWS
Ooohhh!! It is, indeed!
develatio··on Slashing data transfer costs in AWS
A had a suspicion that this was against AWS's terms, but I never bothered to look if that was actually the case. Thank you for the heads up!
develatio··on Slashing data transfer costs in AWS
I'll share my trick :)

Lightsail instances can be used to "proxy" data from other AWS resources (eg EC2 instances or S3 buckets). Each Lightsail instance has a certain amount of data transfer included in it's price ($3.5 instance has 1TB, $5 instance has 2TB, $10 instance has 3TB, $20 instance has 4TB, $40 instance has 5TB). The best value (dollar per transferred data) is the $10 instance, which gives you 3TB of traffic.

Using the data provided by the post:

3TB worth of traffic from an EC2 would cost $276.48 (us-east-1). 3TB worth of traffic from a S3 bucket would cost $69.

Note: one downside of using Lightsail instances is that both ingress and egress traffic counts as "traffic".

develatio··on Operation Triangulation: What you get when attack iPhones of researchers
I am by no means a security expert whatsoever. Period. But reading the article carefully, there is a step in the chain of exploits (CVE-2023-32435) which depends on exploiting Safari. Apple implemented a "Lockdown mode" (https://support.apple.com/en-us/105120) which might have handled this (?).

Answering more broadly to your question, the "step-change" that you're asking for is precisely the "Lockdown mode" in iOS devices. It disables most of the features in order to reduce the attack surface of the device.

develatio··on System-wide open source ad blocker for Mac, Windows, and Linux
But doesn’t that apply to chromium / firefox as well (or any other big application). Web browsers are insanely huge, nobody is reading the entire code. What makes this different?
develatio··on System-wide open source ad blocker for Mac, Windows, and Linux
If you can read the code and asure that the traffic won’t be sent to a malicious third party, why not? What is the concern?
develatio··on The Thing About PHP
> You don't need a systemd unit to keep your server running

You do, actually. You need a systemd unit to keep your apache / nginx + fpm / whatever server that is actually handling and processing your requests.

Edit:

> You could use Ansible to deploy your PHP but you can probably just use git.

You can use Ansible to deploy your [Python | Ruby | Perl | JS | Java | literally every other language on earth]. I can't see your point.

develatio··on Security pros question EU zero-day rule
Even if they knew, what would they do about it? It's not like "the governments" could pull up a Spectre patch out of thin air. There are no mitigations. So what do they gain from knowing if they can't avoid it anyways?
develatio··on Security pros question EU zero-day rule
This is a very simplistic take. There are CVEs and then there are CVEs. Some may take months to be properly fixed, no matter how many engineer-hours you put on them (e.g. the entire side-channel attacks saga). And that's not even taking into account the time required to alert different vendors (think about all the different linux distributions, upstream, big companies, etc...) and coordinate adequate steps.
develatio··on The $53.000 Intel Mac Pro won't be usable for developing VisionOS apps
I'm sorry for the click-bait title, comments are right, it's misleading to compare the abilities of that machine with the ones of M-series machines. They are different machines with different purposes.
develatio··on Wayland breaks your bad software
> HDR is a pretty new thing. It’s still a child everywhere but TVs and consoles.

I'm not sure where does the author draw this conclusion from, but HDR has been around since at least 15 years ago and it's pretty much everywhere at this point: TVs, console, phones, portable gaming devices, laptops, tablet, you name it. On Windows and Mac, iOS, Android, the several OSes for TVs...

develatio··on Musl 1.2.4 adds TCP DNS fallback
IIRC this was causing some exotic problems when deploying docker images based on musl.
develatio··on A PostgreSQL Docker container that automatically upgrades your database
Related: https://github.com/tianon/docker-postgres-upgrade
develatio··on Patching GCC to build Actually Portable Executables
There is a ticket in Go's repo about this: https://github.com/golang/go/issues/51900
develatio··on Devtools for mobile browsers
Oh! I really didn't realise (young?) people don't use computers even for developing purposes. I'm indeed out of touch
develatio··on Devtools for mobile browsers
But why not just use the browser's dev tools? Both Android and iOS support connecting a phone to a computer and debugging using the browser's native tools.
develatio··on A thread on the deterioration of accessibility in GTK4 and Wayland
Any reason why everything is "hidden" by default? It's imho a very unfriendly UX (which is quite ironic coming from a thread criticising "GUI")
develatio··on Sketch of a Post-ORM
This is how it works. ORMs generate migration files automatically.
develatio··on Sketch of a Post-ORM
> ORMs can't use DB specific features

This is technically false. There is no technical reason an ORM couldn't use DB-specific features. It's also practically false. Have a look at https://docs.djangoproject.com/en/4.2/ref/databases/

Django's ORM will do quite clever stuff, specific to your database (eg, if you're using Postgres, it will create additional indexes using appropriate PSQL operator classes).

> I can insert an entry and return the generated ID in a single query. ORMs can't do that

This is also false. Calling .save() on a model will issue an INSERT statement, then the ORM will assign the auto-incremented PK to the "id" property of the model without issuing any further queries. https://docs.djangoproject.com/en/dev/ref/models/instances/?...

> I can also upsert entries in a single statement. ORMs can't do that.

This is also technically and practically false. There is no technical reason an ORM couldn't do an upsert with a single query (granted that the database itself supports it). Practically, while Django's ORM itself can't do this, you could easily use django-postgres-extras (which is just an extension to the ORM's capabilities) to issue an "ON CONFLICT target", which will achieve an upsert with a single query: https://django-postgres-extra.readthedocs.io/en/master/confl...

develatio··on Sketch of a Post-ORM
> Performance: the generated SQL is often badly optimized.

I can't but disagree completely with this statement. There might be an edge case in which a raw query, tailored to a specific need or a particular use case, might be faster, but generally speaking ORMs will know much much better than the average developer how to optimise queries.

They will also know exactly what DB features to use to leverage extra features (for example, Django's F() functions).

Edit: I'm totally amused that the author didn't even mention the fact that ORMs will go ways to prevent you from shooting yourself in the foot (from a security stand point). ORMs have made SQLi so much less common than it used to be. Of course, there still might be a bug here and there which will lead to an SQLi, but it's like day and night compared to how it used to be before, when average Joe would just slap a bunch of queries in a "queries.php" and call it a day.

Edit 2:

> I think migrations should come first. You should write migrations as separate files

Why? Why would you want any of that? The entire point of having the ORM do its thing is so that you (the developer) can focus on the code itself (the models, in this case). Modifying the models to adapt them to the requested changes is something that you'll do anyways, as that's your job. Then the ORM generates the migrations between each modification you did in the code, which leads you to not having to think or even care about how to apply these changes to the database. Why would you want it any different? We've literally reached the point where the code itself can represent "what the database should look like", and the changes to that code represent (via migrations generated by the ORM) "how the database should be changed in order to adapt to the new code".

← PreviousPage 2 of 4Next →