{"@attributes":{"version":"2.0"},"channel":{"title":"Kishore Ganesh","link":"https:\/\/kishoreganesh.com\/","description":"Recent content on Kishore Ganesh","generator":"Hugo -- gohugo.io","language":"en-us","lastBuildDate":"Wed, 10 Jan 2024 12:10:32 -0800","item":[{"title":"Software Complexity comes from reification of complex domains","link":"https:\/\/kishoreganesh.com\/post\/software-complexity-about-making-things-concrete\/","pubDate":"Wed, 10 Jan 2024 12:10:32 -0800","guid":"https:\/\/kishoreganesh.com\/post\/software-complexity-about-making-things-concrete\/","description":"Has this ever happened to you: You come across some piece of software and want to take a look at its source code. You open its codebase and it is sprawling - many layers of abstraction and much more complicated than what you expected. You think you can implement the concept in much fewer lines of code and in a much simpler fashion. If you attempt to do so, you may get the core concept (the &ldquo;kernel&rdquo;) implemented pretty quickly."},{"title":"Rust lifetimes: Separate your immutable parts from your mutable parts using RefCell","link":"https:\/\/kishoreganesh.com\/post\/rust-separate-immutable-from-mutable\/","pubDate":"Sun, 17 Dec 2023 14:45:55 -0800","guid":"https:\/\/kishoreganesh.com\/post\/rust-separate-immutable-from-mutable\/","description":"I recently ran into a Rust lifetimes issue when working on a toy project of mine. The simplified problem is as such: I have a struct Foo which owns a String and has a counter.\nstruct Foo { owned_string: String, prefix_index: usize } What I want to do is to implement the Iterator trait for this struct. I want to iterate over all prefixes of this owned string. We might do something like this:"},{"title":"Are Ubuntu APT repositories wasting space?","link":"https:\/\/kishoreganesh.com\/post\/apt-archive-wasted-space\/","pubDate":"Sun, 10 Dec 2023 07:10:28 -0800","guid":"https:\/\/kishoreganesh.com\/post\/apt-archive-wasted-space\/","description":"Sometime back, I went into a deep rabbit hole. This is a documentation of what I found. Consider the Ubuntu APT repository. I&rsquo;m using the bionic-backports one.\nEach APT registry contains a &lsquo;Release&rsquo; file which is an index of all the files in the repository. There are files listed with their associated archive files (a &lsquo;.gz&rsquo; and a &lsquo;.xz&rsquo; archive).\nSomehow I wondered what gzip options are used to create the archives."},{"title":"Build arcana","link":"https:\/\/kishoreganesh.com\/build-arcana\/","pubDate":"Sun, 10 Dec 2023 04:04:20 -0800","guid":"https:\/\/kishoreganesh.com\/build-arcana\/","description":"A set of arcana about build tools, linkers, programming languages etc which are probably only useful to me\nLD_DEBUG spits out debug information about linkers cmake &ndash;trace to trace the evaluation of a cmake file Use LD_PRELOAD + RTLD_NEXT in order to &ldquo;intercept&rdquo; function calls #include_next to include the next header file match. Similarly RTLD_NEXT RTLD_LOCAL to restrict symbol leak Linker version map Linker symbol map patchelf to directly modify attributes of an ELF ELF can be marked as NODELETE to not be deleted on NODELETE dl_close won&rsquo;t unload a libary if it has any symbols marked as STB_GNU_UNIQUE (&lsquo;u&rsquo; in nm) or have any thread-local destructors registered sudo apt install package:arch to install package for specific architecture rpath and runpaths are attributes inside ELF which dictate where it&rsquo;ll search for dynamic libraries dl_open can be used to implement loadable plugins procFS (mounted at \/proc\/pid) has info on command used to launch process, env, virtual memory maps, mount points, fds, files You can use stat on a process fd (stat \/proc\/pid\/fd\/4) gdb -p pid to attach to a running process lldb &ndash; to forward args."},{"title":"Why did dlclose not unload the library?","link":"https:\/\/kishoreganesh.com\/post\/why-dl-close-did-not-work\/","pubDate":"Sat, 09 Dec 2023 23:07:54 -0800","guid":"https:\/\/kishoreganesh.com\/post\/why-dl-close-did-not-work\/","description":"Recently, at work, we were debugging an issue where dlclose was not unloading the library . You might wonder why that even matters - if your library contains any global symbols, then their state will persist across a dlopen, dlclose sequence. In other words, your library isn&rsquo;t starting from a clean state every time.\nIn the case we were debugging, this issue manifested in the following fashion: We had two libraries libA and libB and libA dynamically depends on libB."},{"title":"Hi","link":"https:\/\/kishoreganesh.com\/about\/","pubDate":"Sat, 09 Dec 2023 22:01:41 -0800","guid":"https:\/\/kishoreganesh.com\/about\/","description":"I\u2019m Kishore Ganesh. I love everything about Computer Science, from nifty discrete math proofs to more concrete systems-domains like Operating System to visual domains like Computer Graphics. I love building projects, especially in domains I\u2019m unfamiliar with.\nOne of my favorite things to do is to dive into a new topic and spend multiple weeks building up expertise on it.\nMy most notable projects are:\nJack Toolchain: Wishing to know how computers work on a low level, I followed the NAND2Tetris book and built a computer from scratch in a hardware simulator, along with a two-phase compiler and assembler for the same computer."},{"title":"Writing a simple JSON Parser from scratch in C++","link":"https:\/\/kishoreganesh.com\/post\/writing-a-json-parser-in-cplusplus\/","pubDate":"Fri, 30 Apr 2021 21:18:05 -0800","guid":"https:\/\/kishoreganesh.com\/post\/writing-a-json-parser-in-cplusplus\/","description":"JSON is one of the most common data interchange formats there is. Thankfully, it is also a pretty simple one. I had written a JSON parser in C++ sometime back, and whilst making it I came across a few decisions that were more involved than I thought they would be. So I have decided to write an article around that JSON Parser. While JSON Parsing is simple, writing one would definitely be useful to build more complex parsers, since the general principles are still present."},{"title":"Taking away control: The dumb programmer and the smart compiler","link":"https:\/\/kishoreganesh.com\/post\/programming_languages\/","pubDate":"Thu, 29 Apr 2021 22:29:29 -0800","guid":"https:\/\/kishoreganesh.com\/post\/programming_languages\/","description":"Good compilers prevent you from shooting yourself in the foot. Today, you have a wide assortment of programming languages to choose from, you can have your pick of paradigm. As a brief detour, the perspective of programmers comes full circle as they move from beginner to slightly experienced to intermediate.\nThe beginner is deathly afraid of the differences between programming languages. In the beginning, they stick to one language out of the fear of learning something new."},{"title":"Bootup","link":"https:\/\/kishoreganesh.com\/post\/bootup\/","pubDate":"Thu, 29 Apr 2021 20:29:29 -0800","guid":"https:\/\/kishoreganesh.com\/post\/bootup\/","description":"A long, long time back, in a galaxy far far away, I was doing the same thing I\u2019m doing right now. Booting up a blog. Genesis. Creation. My older blogs are many years behind me, and now a new journey begins.\nI have witnessed a stark change in how I view blogging, or how I view writing in general over my 4 years of college. More on that in a later post, but I\u2019m excited to embark on this new journey, incorporating the many insights hidden away in some deep dark corner of my Google Keep."}]}}