Any sufficiently advanced technology is indistinguishable from magic.
We use the terminal all the time rarely wondering how it works. How does a command shell interact with a terminal emulator in a graphical environment? How can libraries like ncurses render pseudographic windows and controls?
Aram Drevekenin has created a wonderful interactive article where he explains how the various components of the system interact with each other to create such a familiar console experience.
Anatomy of a Terminal Emulator
#unix #terminal #programming #linux
We use the terminal all the time rarely wondering how it works. How does a command shell interact with a terminal emulator in a graphical environment? How can libraries like ncurses render pseudographic windows and controls?
Aram Drevekenin has created a wonderful interactive article where he explains how the various components of the system interact with each other to create such a familiar console experience.
Anatomy of a Terminal Emulator
#unix #terminal #programming #linux
Anatomy of a Terminal Emulator
How does a terminal emulator work? What are ANSI escape codes? Understanding terminal internals for development, fun and mischief.
Do you remember toys from your childhood?
I have vivid memories of just a few of them. One of them is an eight-bit video game console, a pirate clone of the Nintendo Entertainment System (NES), which was sold in Russia under the Dendy brand. I spent a lot of time playing the immortal games for this platform.
Later, when I started working as a system programmer I became interested in how one of the best toys of my childhood was arranged. Information had to be collected bit by bit. Then I marveled at the engineering genius of the NES developers.
Fortunately, today there is more information about the NES hardware and games for it. For example, here is a good illustrated book (still unfinished) about the NES internals and how to develop games for it in assembly language.
Famicom Party. Making NES Games in Assembly
#nes #programming #gamedev #retro #assembly #lowlevel
I have vivid memories of just a few of them. One of them is an eight-bit video game console, a pirate clone of the Nintendo Entertainment System (NES), which was sold in Russia under the Dendy brand. I spent a lot of time playing the immortal games for this platform.
Later, when I started working as a system programmer I became interested in how one of the best toys of my childhood was arranged. Information had to be collected bit by bit. Then I marveled at the engineering genius of the NES developers.
Fortunately, today there is more information about the NES hardware and games for it. For example, here is a good illustrated book (still unfinished) about the NES internals and how to develop games for it in assembly language.
Famicom Party. Making NES Games in Assembly
#nes #programming #gamedev #retro #assembly #lowlevel
I've always been attracted to minimalistic programming languages. Among them were Scheme, TCL, Rebol, Smalltalk and of course Forth. I didn’t write big programs on these languages, but each of them taught me something. Unfortunately, many of them have remained niche and are not widely used in business. Well, okay, the main thing is that programming in these languages makes us a little happier, right? Today I propose to take a look at a modern programming language that develops ideas of Forth.
Retro is a minimalistic modern Forth-like language with a miniature virtual machine implemented in a variety of programming languages. Despite its minimalism, it remains a pragmatic language that allows you to solve real problems.
Just in case, let me remind that I have already written about other Forth-like modern languages, for example, about Factor (1, 2).
#forth #minimalism #plt #programming #retro
Retro is a minimalistic modern Forth-like language with a miniature virtual machine implemented in a variety of programming languages. Despite its minimalism, it remains a pragmatic language that allows you to solve real problems.
Just in case, let me remind that I have already written about other Forth-like modern languages, for example, about Factor (1, 2).
#forth #minimalism #plt #programming #retro
Telegram
Zero Dereference
Factor is a modern concatenative programming language with FORTH-like syntax and a rich standard library.
http://factorcode.org
#forth #plt #programming #retro #compiler
http://factorcode.org
#forth #plt #programming #retro #compiler
Hello everyone!
Today there will be a free online conference dedicated to the secure operating system KasperskyOS.
I will go over the concepts behind the kernel of this operating system.
Colleagues from product development will share their experience in porting drivers, talk about the application model used in a number of products, and about approaches to information security in product solutions.
My colleagues and I will answer questions about our OS and methodology online.
The language of the speeches is Russian. I am sorry if any of the English speaking readers will not be able to watch the conference.
Today there will be a free online conference dedicated to the secure operating system KasperskyOS.
I will go over the concepts behind the kernel of this operating system.
Colleagues from product development will share their experience in porting drivers, talk about the application model used in a number of products, and about approaches to information security in product solutions.
My colleagues and I will answer questions about our OS and methodology online.
The language of the speeches is Russian. I am sorry if any of the English speaking readers will not be able to watch the conference.
Brutal is a fast-growing hobbyist microkernel operating system project.
The design resembles third-generation microkernels: all resources in the system are represented in a generalized form by objects. Access to objects is possible through locally unique handles, which can be transferred between tasks via IPC.
The project has gone through three major milestones. The authors have already implemented their UEFI bootloader, SMP-compatible microkernel, interface description language, PCIe and ACPI services, and interrupt routing to userspace.
Next in line is work on a block layer, a network stack, and own compiler for a C-like programming language.
Apparently, the same community is working on the Brutal project as on SkiftOS.
#osdev #system #programming #lowlevel #microkernel
The design resembles third-generation microkernels: all resources in the system are represented in a generalized form by objects. Access to objects is possible through locally unique handles, which can be transferred between tasks via IPC.
The project has gone through three major milestones. The authors have already implemented their UEFI bootloader, SMP-compatible microkernel, interface description language, PCIe and ACPI services, and interrupt routing to userspace.
Next in line is work on a block layer, a network stack, and own compiler for a C-like programming language.
Apparently, the same community is working on the Brutal project as on SkiftOS.
#osdev #system #programming #lowlevel #microkernel
GitHub
GitHub - brutal-org/brutal: 🏢 An operating system inspired by brutalist design that combines the ideals of UNIX from the 1970s…
🏢 An operating system inspired by brutalist design that combines the ideals of UNIX from the 1970s with modern technology and engineering - GitHub - brutal-org/brutal: 🏢 An operating system inspir...
Stumbled upon a site with an introduction to basic computer science concepts.
The presentation is superficial, but it covers most of the topics that a modern programmer needs to look at.
The author starts with the basic architecture of a computer: the representation of numbers, the concepts of processor and instructions, a description of a typical pipeline, the hierarchy of memory, caches, and buses. There are also chapters about cache coherence, memory paging, and DMA.
Using Unix as example the author explains concepts such as multitasking, system calls, kernel privileged mode, processes, and virtual memory. He also pays attention to ELF object files and dynamic linking.
Of course, after reading these materials, a person will not automatically become a systems programmer but will have a good high-level understanding of how modern hardware and system software work.
You can download the offline PDF version.
#book #cs #system #programming #hardware #osdev #lowlevel
The presentation is superficial, but it covers most of the topics that a modern programmer needs to look at.
The author starts with the basic architecture of a computer: the representation of numbers, the concepts of processor and instructions, a description of a typical pipeline, the hierarchy of memory, caches, and buses. There are also chapters about cache coherence, memory paging, and DMA.
Using Unix as example the author explains concepts such as multitasking, system calls, kernel privileged mode, processes, and virtual memory. He also pays attention to ELF object files and dynamic linking.
Of course, after reading these materials, a person will not automatically become a systems programmer but will have a good high-level understanding of how modern hardware and system software work.
You can download the offline PDF version.
#book #cs #system #programming #hardware #osdev #lowlevel
It seems to me that for most problems one can find not only a complex highly optimized solution but also a simpler solution that gives a fairly good result.
Dominic Szablewski, for example, came up with a lossless image compression format that in most cases shows a compression ratio comparable to PNG. The format is called QOI (Quite OK Image Format). The peculiarity of the format is the linear complexity of the compression algorithm and its incredibly simple design. According to published data, QOI can provide image compression up to 20x faster than most PNG implementations. The decompression speed can be just 4x faster. These results are impressive!
The author made a series of measurements on a set of various images.
The source code for the project is available on GitHub.
#programming #minimalism
Dominic Szablewski, for example, came up with a lossless image compression format that in most cases shows a compression ratio comparable to PNG. The format is called QOI (Quite OK Image Format). The peculiarity of the format is the linear complexity of the compression algorithm and its incredibly simple design. According to published data, QOI can provide image compression up to 20x faster than most PNG implementations. The decompression speed can be just 4x faster. These results are impressive!
The author made a series of measurements on a set of various images.
The source code for the project is available on GitHub.
#programming #minimalism
GitHub
GitHub - phoboslab/qoi: The “Quite OK Image Format” for fast, lossless image compression
The “Quite OK Image Format” for fast, lossless image compression - phoboslab/qoi
Yes, I know that I have already written about ToaruOS, and many of the readers have already heard about this operating system. But it's worth mentioning it because a lot has changed since that time.
Once upon a time, the author of this OS had an alternative branch where he tried to get rid of all external dependencies by rewriting the missing libraries on his own. This branch was called toaru-nih. Surprisingly, Klange finished getting rid of the foreign code and merged toaru-nih into the main branch of the project.
Now, this Unix-like operating system provides a fast GUI based on a compositing window manager Yutani, a package manager, a set of standard applications, and even its Python-like programming language called Kuroko.
Surprisingly, all of this work is done by one person!
#osdev #lowlevel #system #programming
Once upon a time, the author of this OS had an alternative branch where he tried to get rid of all external dependencies by rewriting the missing libraries on his own. This branch was called toaru-nih. Surprisingly, Klange finished getting rid of the foreign code and merged toaru-nih into the main branch of the project.
Now, this Unix-like operating system provides a fast GUI based on a compositing window manager Yutani, a package manager, a set of standard applications, and even its Python-like programming language called Kuroko.
Surprisingly, all of this work is done by one person!
#osdev #lowlevel #system #programming
GitHub
GitHub - klange/toaruos: A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace…
A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network...
Zero Dereference
Yes, I know that I have already written about ToaruOS, and many of the readers have already heard about this operating system. But it's worth mentioning it because a lot has changed since that time. Once upon a time, the author of this OS had an alternative…
By the way, Klange's resume is also an executable image of his operating system. Try putting this PDF (~18 MiB) as a CD image in Qemu.
Typically, hand-computed ciphers are very simple and easy to break. They are interesting only from a historical perspective.
LC4 (ElsieFour) is different. This low-tech stream cipher is well designed to be difficult to break. The cipher allows to encrypt and decrypt messages without any computing device, using only pen and paper.
A simple handmade wooden appliance can greatly simplify the routines required for encryption and decryption.
LC4 can be used not only to encrypt a message but also to authenticate the sender.
#math #cryptography #lowtech
LC4 (ElsieFour) is different. This low-tech stream cipher is well designed to be difficult to break. The cipher allows to encrypt and decrypt messages without any computing device, using only pen and paper.
A simple handmade wooden appliance can greatly simplify the routines required for encryption and decryption.
LC4 can be used not only to encrypt a message but also to authenticate the sender.
#math #cryptography #lowtech
I read once that the best programming language is two programming languages. I don’t remember who this phrase belongs to, but it’s true.
There is always code that needs serious optimization. But there is also a code that is used as glue. This code doesn't need to be very fast. Usually, most of the code in a project is glue code.
There is a family of programming languages that are used in cases where high-performance fragments in C or C++ need to be glued together into a single program. Most often, Lua and Python are used for this. Less often, TCL appears on the scene.
Fortunately, progress does not stand still and new languages appear, made specifically for embedding into other programs.
I recently came across Wren, a simple and fast language with support for traditional class-based OOP. Unlike Lua, which uses a metatable-based approach similar to object prototypes.
Wren was created by Robert Nystrom, the author of Crafting Interpreters. Robert is currently working on the Dart language at Google.
Another great embedded language is fe. It was created by rxi, famous for their minimalist libraries and programs. fe is a small lisp-like language designed specifically to run in resource-constrained environments. One may think that such a small language is of little use. But this is not the case. fe is easily extensible with C code and supports macros. Check out what awesome fantasy console rxi has made. The binary image is only 60 kilobytes!
You may remember that I already wrote about another embeddable Lisp-like programming language called Janet.
#plt #minimalism #embedded #c #lisp
There is always code that needs serious optimization. But there is also a code that is used as glue. This code doesn't need to be very fast. Usually, most of the code in a project is glue code.
There is a family of programming languages that are used in cases where high-performance fragments in C or C++ need to be glued together into a single program. Most often, Lua and Python are used for this. Less often, TCL appears on the scene.
Fortunately, progress does not stand still and new languages appear, made specifically for embedding into other programs.
I recently came across Wren, a simple and fast language with support for traditional class-based OOP. Unlike Lua, which uses a metatable-based approach similar to object prototypes.
Wren was created by Robert Nystrom, the author of Crafting Interpreters. Robert is currently working on the Dart language at Google.
Another great embedded language is fe. It was created by rxi, famous for their minimalist libraries and programs. fe is a small lisp-like language designed specifically to run in resource-constrained environments. One may think that such a small language is of little use. But this is not the case. fe is easily extensible with C code and supports macros. Check out what awesome fantasy console rxi has made. The binary image is only 60 kilobytes!
You may remember that I already wrote about another embeddable Lisp-like programming language called Janet.
#plt #minimalism #embedded #c #lisp
GitHub
GitHub - rxi/fe: A tiny, embeddable language implemented in ANSI C
A tiny, embeddable language implemented in ANSI C. Contribute to rxi/fe development by creating an account on GitHub.
IOCCC (The International Obfuscated C Code Contest) is a well-known annual event for system programmers who know how to make any C code unreadable.
You may know some winners of the contest and their programs. For example, Fabrice Bellard and his otcc which later became the Tiny C Compiler (tcc).
But today I would like to recall an entry submitted by Gavin Barraclough, a multitasking operating system equipped with a window manager, a terminal emulator, and a text editor. All the code was a single 3.5 Kb file written in obfuscated C!
One guy from Russia deobfuscated this OS and fixed some bugs. Now we can compare the original and deobfuscated versions.
#osdev #lowlevel #system #programming
You may know some winners of the contest and their programs. For example, Fabrice Bellard and his otcc which later became the Tiny C Compiler (tcc).
But today I would like to recall an entry submitted by Gavin Barraclough, a multitasking operating system equipped with a window manager, a terminal emulator, and a text editor. All the code was a single 3.5 Kb file written in obfuscated C!
One guy from Russia deobfuscated this OS and fixed some bugs. Now we can compare the original and deobfuscated versions.
#osdev #lowlevel #system #programming
GitHub
gavin/deobfuscated at master · safinaskar/gavin
The smallest operation system in the world. Contribute to safinaskar/gavin development by creating an account on GitHub.
PlanckForth is a FORTH-like programming language bootstrapped from a hand-crafted ELF-binary. Just pass
Let me remind you of another minimal FORTH compiler called StoneKnifeForth. It uses one-letter keywords and can be bootstrapped with a tiny interpreter (300 lines) written in Python.
#forth #lowlevel #plt #bootstrap
planck.xxd
through the xxd command-line tool and get an x86 executable. Then bootstrap.fs
can be loaded to get a familiar FORTH environment with long keywords, arrays, hash tables, and strings.Let me remind you of another minimal FORTH compiler called StoneKnifeForth. It uses one-letter keywords and can be bootstrapped with a tiny interpreter (300 lines) written in Python.
#forth #lowlevel #plt #bootstrap
GitHub
GitHub - nineties/planckforth: Bootstrapping a Forth interpreter from hand-written tiny ELF binary. Just for fun.
Bootstrapping a Forth interpreter from hand-written tiny ELF binary. Just for fun. - GitHub - nineties/planckforth: Bootstrapping a Forth interpreter from hand-written tiny ELF binary. Just for fun.
Rochus Keller is a guy who tends to implement various old programming languages. He has lots of projects on GitHub. All of his projects have three things in common:
1. They use LuaJIT bytecode as a target language
2. They include not only compilers but also full-featured IDEs with debuggers
3. They are written in C++ with Qt.
Rochus has created such development environments for Smalltalk-80, Simula, Som, Algol-60, and Oberon+. The last one is an Oberon-like programming language compatible with Oberon, Oberon II, Oberon 07 and extended by some new features like UTF-8, generics, and FFI.
#plt #smalltalk #oberon #compilers #lua
1. They use LuaJIT bytecode as a target language
2. They include not only compilers but also full-featured IDEs with debuggers
3. They are written in C++ with Qt.
Rochus has created such development environments for Smalltalk-80, Simula, Som, Algol-60, and Oberon+. The last one is an Oberon-like programming language compatible with Oberon, Oberon II, Oberon 07 and extended by some new features like UTF-8, generics, and FFI.
#plt #smalltalk #oberon #compilers #lua
GitHub
rochus-keller - Overview
see http://rochus-keller.ch. rochus-keller has 69 repositories available. Follow their code on GitHub.
Zero Dereference
Rochus Keller is a guy who tends to implement various old programming languages. He has lots of projects on GitHub. All of his projects have three things in common: 1. They use LuaJIT bytecode as a target language 2. They include not only compilers but also…
Time goes by, things change. It turns out that Rochus has implemented a mono-backend for Oberon+ and recommends using it by default instead of LuaJIT.
Escher Circuits is a visual representation of primitive logic gates that allows you to perform computing by following the circuit with your eyes. It uses the inner nature of human visual perception.
#lowtech #cs #logic
#lowtech #cs #logic
esoteric.codes
Escher Circuits: Using Vision to Perform Computation
Alexander Zolotov (Night Radio) released his song as a simple C program with a single dependency on libSDL2. All synthesizers and sound effects are implemented directly in the program.
Alexander is known for his SunVox and other good programs focused on composing music and computer graphics.
#dsp #synth #c #programming
Alexander is known for his SunVox and other good programs focused on composing music and computer graphics.
#dsp #synth #c #programming
GitHub
GitHub - pixicoder/PS: Single file synth + demo song
Single file synth + demo song. Contribute to pixicoder/PS development by creating an account on GitHub.
In his finished series of posts Max Bernstein shows how to write a Lisp interpreter in OCaml. He also has an ongoing series on compiling Lisp to x86 machine code.
#plt #lisp #compilers #ocaml
#plt #lisp #compilers #ocaml
Max Bernstein
Writing a Lisp, Part 0: Fundamentals
So you want to write a Lisp interpreter. I did too, and then I wanted to write about it, so here we are with this post series.