82 karma · joined Sep 25, 2015 (11y ago) · 34 submissions
comment 5y ago · link · parent
See https://github.com/ValveSoftware/steam-for-linux/issues/4924....
comment 5y ago · link · parent
Every package installed with Nix is isolated into content-addressable* directories, so for example, my install of Firefox is located at /nix/store/c7pmng2x05dkigpbhnjs8fdzd8kk31np-firefox-85.0.2/bin/firefox. This is pretty inconvenient to use directly, so Nix generates a profile that symlinks all your packages into one place (eg. /run/current/system/sw, ~/.nix-profile), and then environment variables like PATH can just include <PROFILE_DIR>/bin.
With this approach, I can have multiple versions of the same package installed simultaneously, without them conflicting with each other. Like in a traditional distro, any dependencies that are shared between packages aren't duplicated, but if a package needs to explicitly depend on a different version, it can.
Also, because Nix is designed as a functional package manager for building packages from source (even though it has a binary cache), you can trace back exactly what sources were used to build your package and its dependencies, all the way back to the bootstrap binaries used to build any self-hosting compilers (gcc, rust, openjdk, ...)
* Most packages use a hash that's generated from the inputs used to build it, rather than the output that's generated.
comment 5y ago · link · parent
It's also easy enough to emulate all control flow statements with goto. Tagged unions are valuable because they help communicate restraints. Not only to other developers, but also to the compiler.
comment 5y ago · link · parent
X only allows setting a DPI per "display", but not per screen (multiple monitor setups where you can drag windows between screens use one X "display"). So you have to resort to these hacks.
comment 5y ago · link · parent
The old libcurl will still exist on your system to allow you to rollback to previous states of your system, but you can always run nix-collect-garbage if you want to free up disk space.
This is similar to the situation in Arch Linux where pacman keeps all downloaded packages, and you have to run paccache if you want to free space.
comment 5y ago · link · parent
For example, serde uses the visitor pattern to encode its intermediate representation. If it used pattern matching instead of the visitor pattern, it would have to instantiate its intermediate representation as an enum, which would add unnecessary overhead.
comment 5y ago · link · parent
Have you seen how many new features have been added to C++20? (which is probably the closest language to Rust) Not to mention any of the dynamically typed languages.
comment 6y ago · link · parent
You can usually grep or even use static code analysis to help find where your existing code is using "tainted" data to construct a query.
Also, if you use an ORM, you'll generally be working at a high enough level where SQL injection is impossible (unless there's a bug or design flaw in the ORM); since you won't be directly dealing with text queries.
comment 6y ago · link · parent
I was trying to say that the comment isn't transphobic at all, and if people think stuff like this is the reason why trans people kill themselves then they're probably blind to the actual transphobia that happens in the world.
Also, I strongly believe that we shouldn't be restricting language out of fear of being offensive, because then people become too afraid to talk about important issues.
comment 6y ago · link · parent
With the language server protocol & debug adapter protocol, I can just plugin in a couple of servers and have a full-blown IDE environment that uses a consistent interface across multiple languages. I remember spending so much time trying out and setting up ctags, ggtags, irony, rtags, gdb-mi, etc...
I don't see myself switching to VSCode because I can just take the best features from VSCode and use them Emacs.
comment 6y ago · link · parent
So many times, I've run into the issue where I've wanted to chain a set of commands with a concise syntax (specifically in Python) without having to shell out to bash.
What I really like about this library is that it gives you the concise composability of bash, without having to deal with its pitfalls (eg. variable escaping, lack of Windows support, clunky interface for anything that's not a command invocation...).
Using a DSL will always come with certain tradeoffs, and it won't be the best solution for every use case, but I think this library fills a certain need very well.
comment 6y ago · link · parent
Not exactly. The Rust compiler is usually pretty smart about optimizing out memcpy for most moves.
For example when returning a large struct from a function, the optimizer could add an "out" reference parameter to the function and the function would directly initialize the return value into that reference.
comment 6y ago · link · parent
The last comment I made mocked the title of the post, and while I don't agree with the direction of the project I was mocking, it felt terrible that I got a bunch of upvotes for it.
I'd be interested to know if anyone has any data to back up / disprove my claims.
comment 8y ago · link · parent