Programming Leftovers
-
Over 900 RARBG Magnet Link Repos Anonymously Nuked From GitHub
The shutdown of major torrent site RARBG in May sent shockwaves through the entire pirate ecosystem. As part of an effort to preserve access to content, archivists began uploading RARBG magnet link databases to platforms including GitHub. One repo was forked 900 times but a single DMCA notice sent by a single rightsholder has wiped every last one from GitHub. Their identity is a secret.
-
Bash source Command with Examples
The Bash source command is a built-in shell tool that plays a pivotal role in the world of Linux and UNIX operating systems. It’s designed to read and execute commands from a specified file within the current shell environment.
-
Bash eval Command with Examples
Bash scripting offers a powerful built-in utility known as the eval command. This command evaluates and executes strings as shell commands, making it an essential tool in scenarios that involve special operators, reserved keywords, or scripts where variable names are not predetermined.
-
Bash printf Command with Examples
In Bash scripting, the printf command is a robust utility that offers extensive control over output formatting. Originating from the C programming language’s printf() function, printf in Bash is a built-in command, taking precedence over the standalone /usr/bin/printf binary.
-
Python random string generation
The “random.choices()” method of the random “module” and the “secrets.choice()” method of the “secrets” module is used to retrieve the random string in Python.
-
Comparing niche programming languages to the mainstream
I think you are focusing on the trees and so not seeing the size and the shape of the forest.
Most organisations use C and languages implemented in C, on OSes implemented in C, because they do the job, the people are cheap and readily available, and the dominant OS is free and costs nothing to deploy.
Which can be reduced to:
Most people use the tools most people use.
That's not a very useful observation, but it poses an interesting question:
Why?
That's easier.
Here is the shape of the outside of the answer:
They use them not because they are good -- they aren't very good, measured objectively -- but because they are ubiquitous and cheap.
Other tools are better, and just as free, but then the people cost more, and the associated tooling costs more. (Frameworks, supporting libraries, deployment costs, whatever. E.g. it's very cheap to deploy Javascript because all you need is a reasonably modern browser, and those are free and almost all OSes have them.)
Those are the externalities, in a manner of speaking.
-
Twilight Of The Programmers
Our profession does structured analysis in a way no other profession has ever done. Let's not lose that precious gift.
-
XML is the future
My first hype exposure was "use the Extensible Markup Language for everything". Learning from it allowed me to live through the front end stack explosion, the micro-service overdose and many, many more silly trends.
-
Gathering the streams
Java 8 introduced the java.util.stream API, which represents a lazily computed, potentially unbounded sequence of values (Streams was also the first designed-for-lambdas API in the JDK). Streams supports the ability to process the stream either sequentially or in parallel.
A Stream pipeline consists of a source (collection, array, generator, etc), zero or more intermediate operations (Stream -> Stream transforms), and an eager terminal operation which produces a value or a side-effect.
The Streams API come with a reasonably rich, but fixed set of built-in operations (mapping, filtering, reduction, sorting, etc), as well as an extensible terminal operation (Stream::collect) that enables the stream contents to be flexibly summarized in a variety of forms. The resulting API is rich enough that users have had good experience with streams, but there are repeated requests for “please add operation X to streams”.
In this document, we explore a corresponding extensible intermediate operation, called
-
Rust fact vs. fiction: 5 Insights from Google's Rust journey in 2022
Reaching version 1.0 in just 2015, Rust is a relatively new language with a lot to offer. Developers eyeing the performance and safety guarantees that Rust provides, have to wonder if it's possible to just use Rust in place of what they've been using previously. What would happen if large companies tried to use it in their existing environment? How long would it take for developers to learn the language? Once they do, would they be productive?
In this post, we will analyze some data covering years of early adoption of Rust here at Google. At Google, we have been seeing increased Rust adoption, especially in our consumer applications and platforms. Pulling from the over 1,000 Google developers who have authored and committed Rust code as some part of their work in 2022, we’ll address some rumors head-on, both confirming some issues that could be improved and sharing some enlightening discoveries we have made along the way.
-
Making C++ Memory-Safe Without Borrow Checking, Reference Counting, or Tracing Garbage Collection
Adding memory safety to C++ is a very difficult problem, to say the least.
I've spent most of the last decade exploring this area (mainly to design Vale's memory safety) and I've discovered some surprising things.
The world largely believes that the only ways to make code memory safe are through reference counting, tracing garbage collection, or borrow checking.
It turns out, there's at least eleven more methods 0 1 with more being discovered all the time if you know where to look. 2
Someone asked me recently, can we use these techniques to add memory safety to C++?
We can! It's something I've been thinking about for a while, and it's about time I write it all down.
-
Programming Languages Going Above and Beyond
Having been a programmer for a long time now, I have experienced my fair share of programming languages. What strikes me the most is that programming languages have not improved much over the years. Java, for example, has certainly improved from when I started using it in the mid-nineties — but only in pretty minor ways. We still get buffer overflows and integer overflows. The compiler still cannot tell when our loops will terminate (yes, this is possible). Aliasing is still a complete unbridled mess. Even Rust, my favourite language du jour, only offers a minor improvement on the status quo. These are not stop-the-world everything has changed kinds of improvements.
Still, big improvements are possible. I now use, on a daily basis, a language (Dafny) which often genuinely amazes me. I’ll admit, its not super easy to use and perhaps not ready yet for mainstream — but, it gives a glimpse of what is possible. Dafny’s ability to statically check critical properties of your program goes well beyond what mainstream languages can do (that includes you, Rust).
-
Hubert Figuière: Niepce June 2023 updates
Since the inception I had the plan to have two kinds of way to "store" image imported. Managed and mot managed. Managed meant that the file would be "owned" by the library, copied into a location controlled by the app. Not managed meant it's just a reference to a file on the filesystem. This concept idea came from Apple Aperture™ that did just that, where you'd have a library occuping dozens of GB on your disk. The storage layout of the files was abstracted.
Instead I decided to simplify the approach. Importing files will by default reference, or will copy into a specific location (when importing from a camera, only the latter). The folders are actual directories in storage and this goes hand in hand with the recursive import.
So I just ripped out the Managed enum wherever it was used and ignored. This was unfortunately ported from the C++ code a while ago.
-
Sriyansh Shivam: GSoC 2023: Monthly Report
It's been a month since the start of the GSoC 2023 coding period. There is a lot to talk about and show, but here are the highlights of the month and the things I worked on.