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
The following article on Wikibooks shows how the category theory is applied to the Haskell programming language. All topics like functions, functors and monads are well illustrated with figures that show elements of categories as circles, morphisms between objects as arrows and morphisms over categories as dashed arrows. The article explains functor and monad laws using Maybe and List as examples and shows how the monad laws power the do-notation.

https://en.wikibooks.org/wiki/Haskell/Category_theory
Some time ago (May 17) I mentioned the software 3D rasterizer written by David Oberhollenzer. That library is not all the beautiful code that David made — his another project, sgui, offers a super-lightweight cross-platform GUI toolkit with X11 and Win32 backends. All regular controls are available, including an OpenGL canvas. The demo application looks really good and the whole toolkit including the demo builds blazingly fast (around 3 *seconds*).

https://github.com/AgentD/sgui
If you have any experience with modern WEB-frameworks you definitely know what scaffolding is. Openradtool (ort) is a compiler of data model specifications to front-end and back-end code. Openradtool is special, because it generates back-end code in C, thus it can be used to develop high-performance WEB solutions in C or C++. Openradtool is a part of the toolset used in the BCHS stack of WEB technologies (BSD, C, httpd, SQLite).

https://kristaps.bsd.lv/openradtool/
A dissertation about the call-by-push-value programming language paradigm written by Paul Blain Levy.

http://www.cs.bham.ac.uk/~pbl/papers/thesisqmwphd.pdf

And a short FAQ on the same topic.

http://www.cs.bham.ac.uk/~pbl/cbpv.html
There are plenty of tutorials on writing bare metal code and boot loaders in x86 assembly language and most of them consider the legacy boot variant (BIOS, real mode, MBR, etc). The following example breaks the tradition and sets up an environment with linear framebuffer and basic I/O using the modern UEFI interfaces. Everything is written in NASM and doesn't require any third party libraries. You can run the example in Qemu with OVMF or on real UEFI-enabled hardware.

https://github.com/BrianOtto/nasm-uefi
There is a nice modern course on advanced topics in operating systems written by Colin Perkins for the School of Computing Science at the University of Glasgow. The course includes such topics as: principles of real-time operating systems, real-time scheduling policies, resource management, embedded systems programming, garbage collection, region-based memory management (with Rust as an example), implications of multicore systems, transactional memory, GPGPUs and virtualization.

https://csperkins.org/teaching/2015-2016/adv-os/
Talloc is an interesting memory allocator for the C programming language. It tracks lifetimes of heap objects by organising them hierarchically. Each time you allocate a new object - you must provide a pointer to some previously allocated object with longer lifetime. When any object is destructed - all the objects with shorter lifetimes, associated with it, are also destructed. You can bind custom destructors to allocated objects, keep them from automatic collection, change ownership and do many other things.

Talloc can be found in CCAN (already observed in the channel).

https://ccodearchive.net/info/talloc.html
Neatroff is a modern reimplementation of the classical Unix troff tool set. In spite of its compactness (the binary distribution requires approximately two megabytes of disk space) it allows to prepare beautifully typed PDF documents with complex layout. It supports UTF-8 encoding, OTF and TTF fonts and bidirectional output. Neatroff includes reimplementation of all popular troff pre-processors like eqn, tbl, refer and others. The implementation is clean and easy to understand in comparison with the original Unix troff full of one-letter variables and other unpleasant things.

I think neatroff can easily replace LaTeX and the heirloom documentation tools for most of tasks performed by typical "home users".

The following link points the umbrella repository that refers to other subrepositories necessary for building of the tool set. Just follow the instructions in README.

https://github.com/aligrudi/neatroff_make
A nice bachelor thesis in which the author tries to determine rational arguments for leaving some actions undefined or unspecified in the standard C. He also researches how optimizing compilers react on code containing various cases of UB.

https://www.cs.ru.nl/bachelors-theses/2017/Matthias_Vogelaar___4372913___Defining_the_Undefined_in_C.pdf
Today I want to step back from the topics of the community and talk about the blog "Simplifier".

In the blog, the author shares the results of his "garage" experiments, publishing short reports with illustrations. I have been reading Simpifier for a long time and am still impressed with the combination of utmost laconicism of reports, asceticism of design and scale of projects.

Just imagine, this modest person who does not even give his name writes about how he tried to create vacuum electrical tubes: diodes and triodes. He described in detail the process of creating several versions of the tubes and gradually improved their characteristics. He achieved good results in a home workshop with minimum of resources. But, of course, the experimenter did not stop there and created a carbon microphone, a wired telephone from home-made components, a paste for creating conductive glass, solar panels, various types of varnishes and coatings for wood and metal, several tools, paints and substances for everyday use, like glass cleaner. Impressive?

The blog is published on the Neocities free hosting service, it is extremely ascetic: a white index page with blue links pointing to denoscriptions of individual experiments. It seemed to me that the author makes diagrams and illustrations in Paint or a similar simple program for raster graphics. With such simplicity of design, it is impossible to break away from reading the text. Content rules!

https://simplifier.neocities.org
A list of tutorials on oldschool graphic effects and techniques like plasma, flame and raycasting.

https://lodev.org/cgtutor/
The following page is a regularly updated illustrated list of computer games available in OpenBSD. This is one of those sites whose reading gives me aesthetic pleasure.

https://mrsatterly.com/openbsd_games.html
Fbpad is a minimalistic virtual terminal that works with the Linux framebuffer. It supports a kind of tabs associated with one-letter tags, so the terminals can be easily switched back and forth.

After minor modifications and configuration, this program has taken a permanent place among my working tools.

This wonderful program was created by the author of neatroff and neatcc.

https://github.com/aligrudi/fbpad
A nice report about breaking the Moscow internet voting system.

The reaction of the developers was strange: they changed a lot the architecture of the system and kept the protocol in secret (according to the report's updates). Security through obscurity? All the modifications were done a few weeks before the first real elections with the help of this voting system. Looks like it is still not ready for production.

https://members.loria.fr/PGaudry/moscow/
GOT (game of trees) is a version control system designed by Stefan Sperling with simplicity in mind. It uses the GIT storage format and is compatible with this popular VCS.
GOT was made for the needs of the OpenBSD community and follows its style and best practices.

https://gameoftrees.org/
Modern reincarnations of troff like neatroff or Heirloom Documentation Tools are very useful and compact. These tool kits can do the same as any LaTeX distribution but require smaller resources. Unfortunately there aren't much documentation on how troff-like processors can be used to prepare nice-looking documents with good typography. Macro packages are also little bit outdated. The project Utroff tries to resolve the problem and provide good macro packages and preprocessors for everyday use.

http://utroff.org/
ZStandard is a lossless compression algorithm and its reference implementation available under the BSD license. The algorithm uses the Finite State Entropy (FSE) encoding with a variant of Huffman dictionary-based compression. The compression ratio is comparable to zlib and decompression speed is better than LZO can achieve in existing implementations.

https://facebook.github.io/zstd/
Team 28 at Imperial College London has created a baremetal clone of the StarFox game. They wrote the remake for RaspberryPi using the ARMv6 assembly language. Almost 6000 lines of code include a software 3d rasterizer, math and utility libraries, a sound engine (via DMA) and an input subsystem for NES-compatible gamepads. Visit their github account for more information.

https://github.com/ICTeam28/PiFox