Terminal-Based Image Viewer, and Multi-OS Binary, and Under 100kb

[Justine Tunney]’s printimage.com is a program capable of splatting full-color images to text mode terminal sessions, but that’s not even its neatest trick. It’s also a small binary executable capable of running on six different operating systems: Linux, Windows, MacOS, FreeBSD, OpenBSD, and NetBSD. All without having to be installed or otherwise compiled first. On top of it all, it’s less than 100 kb.

How is this possible? It’s thanks to [Justine]’s αcτµαlly pδrταblε εxεcµταblε format, implemented by a project called Cosmopolitan which aims to turn C into a build-once-run-anywhere language. The printimage.com source code is included within the Cosmopolitan project.

If the name sounds a bit familiar, it’s probably because the Cosmopolitan project is a key piece of a tool we recently covered: llamafile, which allows people to package up an LLM (large language model) as a single-file, multi-OS executable.

As printimage.com shows, terminal windows are capable of more than just text. Still, plain ASCII has its appeal. Check out the ASCII art STL file viewer which might just make your next sick ASCII art banner a bit easier to generate.

One Less Binary Blob

Open-source software has gone a long way into making modern technology the way it is today. The Linux kernel alone is almost single-handedly holding up the entire Internet, and various other open-source projects allow for more access to computing resources not just because the software is often free, but because it’s possible to look under the hood and modify it for specific needs. Without open-source software available we often run into problems both expected, such as software licensing costs, and unexpected, which often come up because a developer can’t or won’t fix issues or add features. To that end, a group at Ghent University in Belgium are attempting to rectify a problem with the ESP32 by eliminating one of its binary blobs and replacing it with an open source driver.

The ESP32 is famously a low-cost microcontroller with on-board wireless capabilities, but its Wi-Fi functionality currently relies on closed-source software from Espressif. The team is currently working on building a fully working open-source networking stack with the hopes of enabling greater flexibility of these devices but also making things like security auditing possible. The other major goal is to improve low-cost mesh networking which is currently not available with the proprietary driver. Reverse engineering is the name of the game here, both from a hardware and a software level, but current versions of the software already able to send and receive packets.

The source code for the project is available on the team’s GitHub page for any open-source aficionados to take a look at. We certainly hope the project gains some steam, as any new open source project helps all of us using the platform. Open source projects frequently get stymied by a single or small handful of binary blobs too, often with little hope for recourse. Examples include Android being an open-source operating system but generally using the closed-source Google Play suite in practice, or Firefox including support for Adobe Flash. Another great example is that even computers running 100% open-source code once they boot their operating systems, there’s still some black boxes running in the background few of us think about.

Thanks to [Crote] for the tip!

BASIC In Your Browser

If you are a certain age or just like retrocomputers, you probably have a soft spot for good old-fashioned BASIC. If you miss those days but don’t want to install a modern interpreter, you don’t have to. Just load a web page containing the “BASIC Anywhere Machine” from [CJ Veniot]. Worried about it being “in the cloud?” It isn’t? It runs in your browser, and if you are a TiddlyWiki fan, it will even live inside your Wiki, which you can host as you please.

The project has lots of features, including some integration back into TiddlyWiki, which we haven’t tried. But you can use graphics commands, work with the mouse, and do other fun things.

Continue reading “BASIC In Your Browser”

Wine Is For Windows And Darling Is For MacOS

Wine has become a highly optimized and useful piece of software for those that live in Linux, but occasionally need to walk on the Windows side. In case you’d wondered, there’s a similar tool for when you need to run a MacOS program in your Linux environment. Enter Darling, the translation layer you’ve needed all along.

Just as Wine is not an emulator, nor is Darling. As a translation layer, it duplicates functions of the MacOS operating system that programs need to operate but within Linux. It’s fast, because it’s effectively running the MacOS software directly. Initially, Darling was mostly only capable of running MacOS apps at the console level. However, there is rudimentary support for running graphical applications that are based on the Cocoa framework.

Hilariously, if you’re into weird recursive situations, you can go deeper and run Darling within Windows Subsystem for Linux, itself running within Windows. Why? Well, you’re probably bored or just trying to for the sake of it. Regardless, we don’t judge. If you’ve got your own nifty translation or virtual machine hacks in the works, don’t hesitate to let us know!

Zork Zcode Interpreters Appear Out Of Nowhere

Some of our readers may know about Zork (and 1, 2, 3), the 1977 text adventure originally written for the PDP-10. The game has been public domain for a while now, but recently, the interpreters for several classic 1980s machines have also appeared on the internet.

What’s the difference? Zork is not a PDP-10 executable, it’s actually a virtual machine executable, which is in turn run by an interpreter written for the PDP-10. For example, Java compiles to Java bytecode, which runs on the Java virtual machine (but not directly on any CPU). In the same way, Zork was compiled to “Z-machine” program files, called ZIP (which was of course used in 1990 by the much more well known PKZIP). To date, the compiler, “Zilch” has not been released, but the language specification and ZIP specifications have, which has led some people to write custom ZIP compilers, though with a different input language.

For more on the VM, check out Maya’s Zork retrospective. (And dig the featured art. Subtle!)

Of course, that’s not the only type of interpreter. Some programming languages are interpreted directly from source, like this BASIC hidden in the ESP32’s ROM.

Bringing Back The CRT TV Experience In Software

Cathode-Retro is a collection of shaders and sample C++ code for reliving the glorious days when graphics were composite video signals displayed on a CRT screen. How? By faking it in software and providing more configuration options than any authentic setup ever had.

Love it or don’t, there’s nothing quite like it.

Not satisfied with creating CRT-style color images with optional scanlines and TV picture controls like tint and saturation, Cathode-Retro can emulate more nuanced elements as well.

The tool includes the ability to imitate things like the slight distortion of a period-correct curved screen, the subtle effects of different methods CRT displays used to actually work (such as shadow mask vs aperture grille), and even taking into account the slight distortion of light refracting imperfectly through the glass face of the CRT. There’s even options for adding noise and ghosting, which may spark some artistic ideas.

If all you need is software to recreate an old-school CRT terminal, we have you covered. But if your needs are a bit more low-level, Cathode-Retro might be what you’re missing.

There’s No AI In A Markov Chain, But They’re Fun To Play With

Amid all the hype about AI it sometimes seems as though the world has lost sight of the fact that software such as ChatGPT contains no intelligence. Instead it’s an extremely sophisticated system for extracting plausible machine generated content from the corpus on which it is trained. There’s a long history behind machine generated text, and perhaps the simplest example comes in the form of a Markov chain. [Ben Hoyt] takes us through how these work, and provides some Python code so that you can roll your own.

If you’re uncertain what a Markov chain is, consider the predictive text on your phone. It works by offering the statistically most likely next word in your sentence, and should you accept all of its choices it will deliver sentences which are superficially readable but otherwise complete nonsense. He demonstrates with very simple short source texts how a collocate probability map is generated for two-word phrases, and how from that a likely next word can be extracted. It’s not AI, but it can be a lot of fun to play with and it opens the door to the entire field of computational linguistics. We haven’t set one loose on Hackaday’s archive yet but we suspect it would talk a lot about the Arduino.

We’re talking about Markov chains here with respect to language, but it’s also worth remembering that they work for music too.

Header: Bad AI image with Dall-E prompt, “Ten thousand monkeys with typewriters”.