Zero Dereference – Telegram
Zero Dereference
127 subscribers
3 photos
3 files
372 links
Interesting links related to systems programming, hacking, and science.

Contact: @richiefreedom
Download Telegram
In the following series on Medium Tomáš Bouda tells about 100 interesting algorithms for 100 days.

https://medium.com/100-days-of-algorithms
C for all (C∀) is a new programming language based on C and supported by Huawei. C∀ extends C with many useful features like tuples, references, constructors and destructors, type extension, nested procedures, polymorphism, traits, coroutines, threads, and etc.

https://cforall.uwaterloo.ca/
George Hilliard, an embedded systems engineer, has designed a business card with a minimal ARM computer inside. And it runs Linux!

https://www.thirtythreeforty.net/posts/2019/12/my-business-card-runs-linux/
Lilith is a hobby operating system written in Crystal. It includes a simple Unix-like kernel, a window system and several applications.

https://github.com/ffwff/lilith
A short and clear introduction to a programming language is a rarity. The following article is just such a case. Take a closer look at the Smalltalk language. Possibly you may not be using it in everyday practice, but it can greatly change your way of thinking.

http://web.cecs.pdx.edu/~harry/musings/SmalltalkOverview.html
SSG is a tiny perl noscript that compiles markdown-like text files to simple postnoscript presentations. Fonts and colors are easily configurable.

https://github.com/jroimartin/ssg
Redshirt is a research operating system written in Rust. It executes WASM binaries and can theoretically obtain them from a decentralised network.

Any program in Redshirt can declare that it implements some interface and OS will use the program to handle requests corresponding to the interface. For example such a program can work as a filesystem server or a TCP/IP stack.

Interfaces and programs in Redshirt are uniquely identified by their hashes, it allows to store the programs in an IPFS-like distributed database.

https://github.com/tomaka/redshirt
One old blog post about register allocation in CompCert.

http://gallium.inria.fr/blog/register-allocation/
I didn't consider WebAssembly seriously and thought that this technology was tightly connected to JavaScript and WEB browsers. Fortunately, I was totally wrong!

WASM is a modern low-level representation for portable executables. It is compact, efficient and compatible with "unsafe" programming languages like C and C++.

There are research projects developing WASM-based operating systems or firmwares for small devices. Many programming languages can be compiled to WASM. This is a very promising technology.

Today I would like to share a link to a small introductory article about WASM.

https://rsms.me/wasm-intro
I already wrote about bearssl, but it was a surprise for me that a huge part of the library was implemented in T0 - a special concatenative programming language with concurrency and memory safety features.

That language influenced another one, T1. T1 is type and memory safe, it provides a number of static guarantees, supports OOP, garbage collection and a kind of metaprogramming.

https://t1lang.github.io/
Bootstrapping a whole operating system from a simple in-memory monitor or debugger is a very catching topic. Just imagine: everything you have is just your hardware with some minimal firmware preloaded, just to give you an ability to edit data in memory, execute it and store somewhere. Could you start with these tools and develop or just build an existing modern operating system?

The Mes project aims to bootstrap the modern GNU toolchain starting from the bare minimum.

https://www.gnu.org/software/mes/

There is also an old conversation on Reddit which is related to the topic.

https://www.reddit.com/r/programming/comments/9x15g/programming_thought_experiment_stuck_in_a_room/
I have been using different text editors, most of them are lightweight and easy to modify: nano, vis, edit (by Quentin Carbonneaux). The only one exception is vim, which is a typical example of bloated software, but situation becomes better, thanks to neovim.

Looks like I just found a new favourite, its name is Lite. This editor is made with C and Lua, but Lua here is used not only as a noscripting language for plugins, almost everything is written in Lua: object system, UI, text view, command system, all the mechinics laying behind a good text editor. Only a small portion of code is written in C: drawing of rectangles, STB-based font rendering and input handling. Lite is really simple to study and modify, it is blazing fast and user friendly.

https://github.com/rxi/lite
PagedOut is a cool e-magazine with a simple idea: every article fits to only one A4 page. The main topics are hacking, programming, retro computing, electronics and the demoscene.

https://pagedout.institute/
There are many good books on construction of compilers, but lots of them are just theoretical or suggest to use various high-level instruments like scanner and parser generators, existing compiler backends, etc.

The next free book is little bit old-fashioned, but it is still relevant. It follows the idea that practical approach to studying is the best one.

Did you read about bottom-up parsing? Nice, so try to implement a LALR parser generator similar to YACC in ANSI C. How about implementation of a whole C compiler and a bunch of tools that simplify the development? This book shows how to do it.

https://holub.com/compiler
Writing unit tests in C is a difficult matter. The most crazy part is mocking functions and complex data structures. The following article gradually shows various ways to mock functions in C programs.

The authors start with a simple macro-based approach but they try to make mocking more convenient and eventually finish with a bunch of trampoline wrappers written in assembly language.

https://locklessinc.com/articles/mocking/
Have you heard about SWEET16? That was a meta-processor (virtual machine) written by Steve Wozniak for Apple II. Thanks to this technology it was easier to bring 16-bit operations to MOS 6502, a popular 8-bit processor.

http://www.6502.org/source/interpreters/sweet16.htm
A good introduction to typesystems based on linear types.

http://pauillac.inria.fr/~fpottier/slides/fpottier-2007-05-linear-bestiary.pdf
There are two well-known libraries for rasterization of TrueType fonts. The first one is FreeType which can be found in dependencies of almost any widely used free software that shows text on the screen. The second one is stb_ttf - a lightweight and portable rasterizer which is used primarily in computer games and small-footprint applications. Both libraries are examples of good software, but they are complex enough for studying by people unfamiliar with font rasterization.

The following git repository contains a tiny library for straight and dirty rasterization of TrueType fonts. It is buggy, especially the demonstration tool, but it shows how simple any rasterizer is in essence.

https://github.com/ZhUyU1997/ttf