HNHacker News
TopNewBestAskShowJobs

fiedzia

592 karma · joined January 21, 2013

submissionscomments
fiedzia··on Re: 100k Threads? (2002)
> without using a bunch of excess thread context resources

If the threads are cheap, there is no point in making this distinction, which greatly simplifies the language. And they can be, we just need programming languages designed for that.

fiedzia··on Ask HN: How does one practice day to day shell scripting
Don't. My rule is if it's more then 3 lines or more complex than simple commmand call, it'll be written in Python. It will be easier to read for everyone around and avoid all the shell footguns.
fiedzia··on Ask HN: SQLite as Dump Export?
For one-time dump of everything, that would work fine. For keeping in sync regularly, look at Dolt (google "git for data" for more solutions like this one, there are a few already).
fiedzia··on I'm all-in on server-side SQLite (2022)
> Why not just use SQLite directly?

SQLite does not provide replication, so there is no way to use it directly (other than copy whole file). If you mean it as "Why not use it as a database" than sure, you can use it directly, though the article states reasons for not doing so (resiliency and concurrency). Postgres is a lot better in those areas, and so is the tooling.

>I'd also like to understand wrappers and ORMs for migration to other systems, should SQLite stop scaling

1. It heavily depends on the orms. For example Django provides good abstraction layer and many things works with any database with no change needed, but many other don't bother about that. However just because a query runs, doesn't mean it will return the same results. Any non-trivial app will rely on numerous accidental details and you can't switch db and expect everything will be fine. SQL is not really portable even in the parts it does cover, and there are many it doesn't.

fiedzia··on Ruby 3.3's YJIT Runs Shopify's Production Code 15% Faster
> # you would have to be a psychopath to pass this > # anything but a User object > def grant_admin_privileges(user:)

I had an app once where we used user objects, and later switched to ids to save db calls. Now you have some functions that can accept both, and some that accept one of them, and without type hints (that was long time ago) you can easily make a mistake.

fiedzia··on The State of Async Rust – Corrode Rust Consulting
> Sure, you no longer have to use the await keyword, but it's just a keyword.

It is not. It splits ecosystem and you can't easily mix sync and async libraries. We need green threads at language level to fix that.

fiedzia··on Ruby 3.3's YJIT Runs Shopify's Production Code 15% Faster
> Productivity and Scalability(in performance sense) aren't opposites.

They often clash with each other. Rust for example is a lot less pleasant to debug than interpreted languages and that is a loss of productivity.

fiedzia··on Ruby 3.3's YJIT Runs Shopify's Production Code 15% Faster
and Dropbox with Python
fiedzia··on Ruby 3.3's YJIT Runs Shopify's Production Code 15% Faster
It's easy to believe (and probably true) that there are some low-hanging fruits in a place nobody looked at before.
fiedzia··on Localhost Will Inevitably Die
> If you can't reliably run production on localhost

I don't need to run all of production, just enough of it to get the job done with no shared parts. That's usually very little.

fiedzia··on Localhost Will Inevitably Die
Wasm changes nothing here. Your docker image will have exact same problems as wasm file. If some service preloads 10GB of data and takes 2 mins to start, wasm alone won't magically make it better, smaller or faster.

> 30+ lambdas all hooked together in confusing ways.

You can use localstack to run them locally, but tooling definitely sucks either way.

fiedzia··on Skip the API, ship your database
Postgres can run arbitrary code too, but at this point it just makes more sense to create a service that acts as a database and translates sql to whatever (people already do that). This however makes whole game pointless, as we are back where we were.
fiedzia··on Vector Search with OpenAI Embeddings: Lucene Is All You Need
It's no match for lucene (in practice ES or Solr) in terms of performance and features, as it's very different model of indexing and operating. Keeping it running while 1000s of customers run search queries AND the app uses db AND users want faceting or other features is not an option.
fiedzia··on Mashing Enter to bypass full disk encryption with TPM, Clevis dracut and systemd
It's not the first bug of this type: https://www.engadget.com/2015-12-18-log-into-most-any-linux-...

I recall Gnome had similar issue, though can't find a link right now.

fiedzia··on Patterns with Rust Types
3. should be one click in your IDE.
fiedzia··on The case for Nushell
The case for any other shell: ls -R and find exist and work. Nushell doesn't cover that. I like the idea, but execution has so glaring holes that I had to go back to fish 1 min after installing nu. (there is glob ** that doesn't have any column and I don't see a way to compose it with ls, and ls ** doesn't work).
fiedzia··on File Attachments: Databases can now store files and images
> If the system you're working on is small, and going to stay small, then that doesn't matter.

Having good default solution saves a lot of problems with migration. Storing files outside of database today really isn't that more complicated, while benefits even for small files are significant: you can use CDN, you don't want traffic spikes to affect database performance, you will want different availability guarantees for your media than for database and so on.

fiedzia··on File Attachments: Databases can now store files and images
>Think of it as having a new database column type where you can store files of any size, and behind the scenes they are stored in AWS S3 and cached through a global CDN.

So the files are not stored in the database, but somewhere else. This belongs to a web framework, not database.

fiedzia··on Front-end is harder than back-end
> If you mess up the backend (data corruption, data removal, data leaking, etc.) you are in hell.

True, but also tooling is better. I have seen a data corruption in a database only once in my life (at least in production). Finding some issue with ui is closer to norm then exception.

fiedzia··on Front-end is harder than back-end
The issue is simple to resolve - most ui frameworks will have some sort of virtual table that only display and manage elements user will see, so just use that (react window does that, but there are table variants that are doing all the work as well). This is a limitation of a browser/UI/OS more then react, as any ui element comes with a cost, though you'd need to know someone who knows about browsers, ui libraries and operating systems to explain where the cost comes from exactly, and you won't be able to do anything about it anyway (that's the problem with the frontend).
fiedzia··on Memory Safe Languages in Android 13
> Just like the majority of the bugs are not prevented using rust,

"For more than a decade, memory safety vulnerabilities have consistently represented more than 65% of vulnerabilities". That's not minority. We are getting into minority territory now because of Rust and other memory-safe languages.

> while a SQL injection can be exploid by a script kiddie with average IQ.

Use any framework and it's solved problem.

fiedzia··on Memory Safe Languages in Android 13
> all of us make mistakes and will keep making them, in any language

.. unless said language makes making those mistakes difficult or impossible. Sanitizing input for example has not been an issue for me for decades, as every framework I used handles that by default, I'd have to work extra hard to make a mistake there.

> Google problems are not everyone's problems.

In this case they are. Not only memory safety is an issue for many codebases that have at least some C somewhere, but also because Google products are used by milions.

> Goggle's solutions to problems are not everyone's solutions to the same problems. > Assuming that what Google says is applicable everywhere is at best naive

Any other time I'd agree with you, but I don't see anything Google-specific here.

fiedzia··on Memory Safe Languages in Android 13
> using a low budget project with few developers maintaining one of the most used libraries in the whole World as an example of non memory safe languages perils is not exactly honest

Why? That's the situation of enormous amount of code people use.

fiedzia··on Memory Safe Languages in Android 13
> We can also reimplement everything in JavaScript

Look at js package stats - that's exactly what's happening. Many of apps and packages created today in js would be created in C/C++ few years ago. People who learn programming today don't know what C/C++ is. If they need something low-level, it's Rust.

fiedzia··on Memory Safe Languages in Android 13
> Implementing a linked list in Rust is somewhat challenging because of the safety issues that arise

Implementing linked list in any language that is not memory-safe is challenging because of safety issues. Rust just points it out.

fiedzia··on Smartphones wiped out 97% of the compact camera market
> Cameras are designed to capture & store the light in a way we can interpret later. They intentionally weren’t designed to edit or interpret the light and make corrections.

That's one thing, but still there are many features of the camera firmware that people want to have, and cameras failed to deliver. One of such thing was apps - Sony provided few in some of their camera, but next model removed them, because they couldn't implement that in a model-agnostic way. They just don't get software.

fiedzia··on “...Rust in the kernel is dependent on *kernel* rules”
> Any kernel that did panic would stop getting used by the majority of people pretty fast as being "too unreliable".

So will kernel that corrupts data, but panic is much easier to fix than corrupted data because it's closer to the source of the problem.

fiedzia··on “...Rust in the kernel is dependent on *kernel* rules”
> There are some people who would prefer the purity of "Panic" on a memory corruption/error,

If the OS will encounter memory corruption, it cannot reliably do anything but restart. Anything else will risk further corruption and will make any investigation more difficult and effects more distant from the cause.

> and there are some people who are operating space craft and safety critical systems where a "Panic" could lose lives.

So could erratic behaviour.

fiedzia··on Memory Safe Languages in Android 13
> When I read memory safe it means that it cannot happen at all, and therefore I don't have to think about that kind of stuff when I write a program.

I've never needed to use unsafe in my Rust applications, which means that my code is 100% memory safe (by Rust definition of course). I expect libraries I am using to provide safe abstractions over unsafe, if there is any there. Sure, there were bugs (including Rust stdlib), but such small scale effectively means that this problems disappeared comparing to languages that aren't safe and that means all I need to do is maybe update some dependency once a year. It's that rare, so I will call it safe and solved problem. We can move to next one (and there are many).

> It'd be more honest to say: it's memory safe until:

Which is what most Rust introductions I've seen will say. I don't think anyone misunderstood this part.

fiedzia··on Memory Safe Languages in Android 13
> they told you that Rust is a memory safe language and you don’t need anything else than the rust compiler - this is how I find 99% of today’s articles about Rust.

It is - as long as you don't use unsafe. Which is very rare, so we've made huge progress here already. Validation for cases where unsafe is necessary is needed and welcomed, but doesn't change the fact that 99% safe Rust is much better than 100% unsafe C/C++.

> Again, there is no way of escaping bad programming and bad practices, no matter which language you use.

Escape entirely maybe not. Eliminate most of it - definitely.

← PreviousPage 4 of 16Next →