Readit News logoReadit News
_ank_it commented on Linux from Scratch   linuxfromscratch.org/inde... · Posted by u/udev4096
hollerith · a year ago
NixOS separates packages. If the package foo contains a file /usr/bin/foo, NixOS installs it in /nix/store/67c25d7ad7b2b64c67c25d7ad7b2b64c-foo/usr/bin/foo. In order to make this separation work, Nix must sometimes rewrite binaries so that all references in the binary to /usr/bin/foo becomes references to /nix/store/67c25d7ad7b2b64c67c25d7ad7b2b64c-foo/usr/bin/foo.

The advantage of this approach is that it gives more control to the distro maintainers and the admins of the computer, taking that control away from the "upstream" maintainers of the software being packaged. For example the software being packaged cannot just call the library bar because bar is not at /usr/lib/bar.so like it is in most Linux distros -- it is at /nix/store/17813e8b97b84e0317813e8b97b84e03-bar/usr/lib/bar.so, but of course the software does not know that unless the person creating the Nix package (the packager) arranges for the software to know it (again sometimes by doing a search-and-replace on binaries).

If the upstream maintainer of foo thinks foo should link to version 6 of library bar, but you think it should link to version 5, NixOS makes it easier for you to arrange for foo to link to version 5 than most distros do (even if version 6 of bar is needed by other packages you have installed which you need to use at the same times as your using foo).

Note that if this separation of packages imposed by NixOS has any beneficial security properties, it is merely security through obscurity because there is nothing preventing a binary from covertly searching through the directory listing of /nix/store/ for the name of the library it wants to call. Nevertheless it turns out the be useful to seize some control away from upstream in this way even if technically upstream could seize the control back if it were willing to complicate the software to do so.

People, including the creator of Nix and NixOS (Dolstra), will tell you that NixOS's main advantage is "declarativeness" (which in the past Dolstra called "purity") or the fact that the compilation / building process is deterministic. I believe both positions (NixOS's advantage is declarativeness and the advantage is deterministic builds) are wrong. Specifically, I believe that although deterministic builds are useful, the separation of packages I described is much more useful to most users and prospective users of NixOS.

Another way to summarize it is that NixOS package maintainers routinely modify the software they are packaging to use less "ambient authority".

_ank_it · a year ago
Extremely noob here, I was trying nixos and got real confused about how to install python packages as pip was not allowed at system level.
_ank_it commented on Exercises to Learn Rust   rust-exercises.com/... · Posted by u/sebg
_ank_it · 2 years ago
Is there anything of this sort but for golang and python?
_ank_it commented on Advanced Python Mastery   github.com/dabeaz-course/... · Posted by u/a_bonobo
sebk · 2 years ago
Beazley's Concurrency From the Ground Up is one of my favorite tech talks ever: In about 45 minutes he builds an async framework using generators, while live coding in an emacs screen that shows only about 20 lines and without syntax highlighting, and not breaking stride with his commentary and engaging with the audience.

It's 8 years old, but definitely worth a watch: https://www.youtube.com/watch?v=MCs5OvhV9S4

_ank_it · 2 years ago
the love of programming and engineering .. this is what motivated me at first place to do CS
_ank_it commented on Ask HN: How are you feeling about software engineering in 2023?    · Posted by u/mbm
_ank_it · 3 years ago
Given all the advancements in the field of AI, I want to program more. Go more for low level programming. Talk to the hardware
_ank_it commented on Ask HN: What are the most eye-opening textbooks you have ever read?    · Posted by u/debanjan16
ttul · 3 years ago
Pro tip: GPT-4 was trained on this book and can implement Chris Voss’ negotiating strategies quite effectively.
_ank_it · 3 years ago
What prompts one can try?
_ank_it commented on Ask HN: Learn C in 2023?    · Posted by u/0x008
andreygrehov · 3 years ago
I'm not a C engineer, but I think I have an interesting recommendation to consider.

Since you are already familiar with other languages, you obviously don't need to know the basics of C. The basics are the same everywhere. Instead, you'd likely want to build that mindset on how to build good software with C.

I suggest you read other people's code and try to deep dive into the whys.

I heard Redis is a well-written software.

    git clone https://github.com/redis/redis.git
    git log –reverse
    git checkout ed9b544e...
We can now see the very first commit made by Salvatore Sanfilippo. From here, we can start exploring. By looking at the commit diffs and git log messages, you'll be able to understand the motivation behind the changes.

When you read a book, the most interesting parts are usually after all the theory is explained at the beginning. Somewhere in the middle of the book they start showing you code samples and that's when things become really interesting.

What I like about the reverse git-log approach is that it immediately throws you into the middle section of the book. This approach is both fun and eye opening.

Good luck!

_ank_it · 3 years ago
This. But for C++ and Python.
_ank_it commented on Tell HN: My new free note taking tool    · Posted by u/ppetty
mbgu · 3 years ago
emacs org mode
_ank_it · 3 years ago
with org-roam
_ank_it commented on Launch HN: Hello (YC S22) – A search engine for developers    · Posted by u/wayy
_ank_it · 3 years ago
No dark mode?

u/_ank_it

KarmaCake day6July 21, 2016
About
engineer

web: https://nezubn.com twitter: @nezubn threads: @nezubn7

email me at: ankit@nezubn.com

View Original