UDP Broadcasting And Easily Finding Network Services

Local area networks (LANs) that use technologies like Ethernet and Wi-Fi are incredibly useful for letting devices talk with each other. Yet a core problem here is knowing which devices are where on the network, as anyone who has ever tried to add a network printer or network share to their system can probably attest to. Unless you happen to know the IP address of the LAN device, the port, and protocol, the target device may as well be located on the Moon without further help, such as automatic network discovery in lieu of waddling over to the device and reading the label listing its IP address.

Over the decades quite a few ways have been developed to enable such network discovery, with many of them using UDP broadcast as the first step. By broadcasting a global message on the entire LAN, any device that has an actively listening UDP socket on that particular port can parse said message and decide whether it’s feeling sociable enough to reply.

The topic of UDP broadcasting is however not as straightforward as it may sound if you’re just getting started, including the existence of many opinions on the ‘right way’. There is also a massive divide between a sprawling service discovery protocol like mDNS and a light-weight one like that one that I had to implement a few years ago for an open source project.

Continue reading “UDP Broadcasting And Easily Finding Network Services”

Bringing Swift To The Apple II

Swift is a relatively modern program language, appearing in 2014 as a replacement for Objective-C. Since then, it’s become a popular solution for programming apps across Apple platforms. That led [Yeo Kheng Meng] to a simple yet fun idea—porting Swift to the oldest Apple platform of all.

Yes, [Yeo] managed to build a development environment for Swift that targets the Apple II platform. Not just one machine, either—everything from the original Apple II up to the IIe and a little beyond. Now, the Apple II is very different from modern Macs and iPhones and the like, having debuted in 1977 with a 1 MHz 6502 CPU and a minuscule 4 KB of RAM. But that doesn’t mean you can’t use a modern language to develop for it!

[Yeo] does a great job of explaining how it all works, and how Claude Code and GPT 5.5 Codex were used to help piece things together. The compiler is set up to spit out bytecode that’s executed by a virtual machine running on the 6502. The target was to allow the setup to work on a standard 1977 Apple II from the factory, which would allow it to then run on subsequent models without issue. However, there is a small note— [Yeo]’s implementation requires the RAM to have been upgraded to 48 KB.

We love seeing modern stuff ported to the Apple II. This Portal port was a particular highlight.

Continue reading “Bringing Swift To The Apple II”

CSS On The ESP32

There are lots of graphics libraries available for the ESP32, and lots of ways to program one to boot. Even still, most of us wouldn’t immediately think to CSS when it comes to embedded products — yet that’s now a thing on the Espressif platform, apparently.

The Gea stack allows one to compose CSS and TypeScript code that is then turned into generated C++ code that compiles to native firmware. The team behind Gea have demoed this ability by running a 3D cube animation on an ESP32 at up to 60 FPS. This isn’t some ugly, low-res wireframe demo, either. It’s a full-color animation running on a 410×502 AMOLED screen. It’s very fluid, and can even handle transparency on the cube faces (albeit with a performance penalty).

It’s worth noting that this isn’t a full browser engine. As you might expect, some concessions had to be made to get it running on the ESP32. Namely, it doesn’t handle “:hover” states because it’s designed for touchscreen use, fonts are rasterized, and the UI tree is limited to just 512 nodes. Regardless, it shows that using CSS and TypeScript to develop for the ESP32 is entirely possible without some crazy loss of performance. If you want to build easy interfaces on an ESP32 while leaning on web dev experience, this could be very useful indeed.

There are lots of fun ways to write code for the ESP32; you can even try MicroPython if you like.

Continue reading “CSS On The ESP32”

MSYS2 And The No-Fuss Way To Get More GNU Into Your Windows

As great and streamlined as the Windows desktop experience is, one area where it’s at best disappointing and at worst rage-inducing is when it comes to its command line interface (CLI) offerings. In Windows 9x/ME this could be excused by the fact that it was essentially just a dressed-up MS-DOS CLI experience, but on Windows NT-based OSes no such excuse exists.

Yet even after Microsoft finally acknowledged the shortcomings of the cmd.exe shell by 2006, they then proceeded to go their own way with PowerShell, industry standards be damned. Especially for those of us who have no beef with the UNIX/BSD/Linux CLI experience and the joys of shell scripting, this insistence was disappointing. Simultaneously, everyone from OS X/MacOS to Haiku were happily offering a familiar CLI environment alongside POSIX compatibility.

Although Windows NT OSes were POSIX compliant, they never offered a suitable shell along with it, nor any of the other things you’d expect in a modern-day BSD, Haiku or Linux CLI environment. In a recent article by my esteemed colleague Al Williams, these sore points were somewhat addressed as far as basic CLI tools go, but the issue goes obviously much deeper than just the basic userland tools. Which is where MSYS2 comes into the picture.

Continue reading “MSYS2 And The No-Fuss Way To Get More GNU Into Your Windows”

Blender 5.2: Coming Soon With Improved Simulations

Traditionally, one of the weak points in Blender has been simulations, with even professional users of the free and open source computer graphics suite off-loading such tasks to programs like Houdini. But according to [3Dan], once version 5.2 is out of beta in July, that may become a thing of the past. 

Simulations aren’t a necessary part of a 3D animation software, but they are very, very nice to have. If you want realistic-looking fluids, hair, or cloth, it’s incredibly difficult to animate it by hand. One, because there are so many degrees of freedom in, say, flapping cloth, keyframing is a major pain, but also figuring out how to make the model move and deform realistically is by no means trivial. It’s easier to offload all that on a physics simulation; then, as long as the physics is realistic, the animations will be as well.

That’s not easy, computationally speaking, and one thing that’s clear is there’s been work behind the scenes to optimize the simulation algorithms, not just improve the workflow, as the basic “drop cloth on a monkey head” demo now runs twice as fast. The new workflow itself bring simulations more into line with how Blender has been going– it’s part of geometry nodes now. So there’s simulation nodes you bring in, but that means things like tearing cloth become quite straightforward compared to the occasionally byzantine workarounds required before. This node-based workflow also brings Blender more into line with how paid software works these days.

[Dan] demonstrates the power of it by adding air pressure to a cloth simulation with some custom nodes, inflating and popping a fabric sphere. He also demonstrates how cloth simulation can be applied to animate realistic foliage. This update probably doesn’t have Houdini developer SideFX shaking in their boots, but it might allow some animators to stop paying that license and go fully-open source, which is great to hear.

Even if you’re not into digital sculpting or animating, you may find yourself downloading a copy of Blender at some point to add texture to 3D prints, or make fancy resin-print miniature models FEM-friendly. The right addon can even let Blender do parametric CAD, though FreeCAD is getting better all the time, too.

Continue reading “Blender 5.2: Coming Soon With Improved Simulations”

Skip The Embedded Filesystem With The TAR-like UTFS Format

If you need to store some data on a resource-constrained embedded platform, the prospect of dragging in a dependency for something like FAT filesystem access to flash or other storage medium can seem rather daunting. Not only is your binary size now significantly larger, the overhead of these filesystems is also not insignificant as they were not really designed for this type of environment. Here [Drew Gaylo]’s UTFS format is an interesting alternative to just writing raw binary data to said storage medium.

As explained in the accompanying introduction article, the basic idea is similar in scope but very much slimmed down compared to the venerable Tape ARchive (TAR) format, hence the Micro (µ) Tar File System name. The provided UTFS implementation is quite small, spanning two source files in C99 with zero heap usage. Targeting a custom store medium requires implementing one read and one write function to match the underlying platform.

A couple of examples are also provided, covering using the built-in Flash of a SAMD20 MCU and the EEPROM of an ATmega328. Compared to raw binary data that’d have to be fully rewritten, UTFS allows for sections of the storage to be accessed as files and thus updated in-place.

A Brief History Of Unix Commands On Windows: CoreUtils (Again)

If you use Windows today and type ls, cat, grep, or awk in a terminal, there is a good chance something useful will happen. That was not always true. For most of the history of personal computing, Unix/Linux and Windows lived on opposite sides of a cultural border. Unix people had pipes, small composable tools, shell scripts, make, sed, awk, grep, tar, and the idea that everything was a file. Windows people had drive letters, backslashes, COMMAND.COM or cmd.exe, and an API that did not care much about what POSIX thought.

Yet there has always been a demand for Unix tools on Windows. Some of it came from programmers who wanted the same build scripts everywhere. Some came from administrators who missed grep and awk. Some came from companies trying to port big Unix applications to NT without rewriting them all. The result is a long, strange history of Unix-on-Windows layers, toolkits, compromises, and almost-but-not-quite compatibility.

Easy?

The simplest version of the problem sounds trivial. How hard can cat be? Open a file, copy bytes to standard output, done. Writing ls is a little more work, but Windows has directory APIs. Common commands like cp, mv, rm, mkdir are not very mysterious. Even pipes are not foreign to Windows. A lot of the everyday Unix command set can be ported as ordinary Win32 console programs with some path handling and enough patience.

But not all of Unix or Linux translates cleanly to Windows. The big issue is fork(). On Unix, a process can clone itself. The child gets a copy of the parent’s address space, open file descriptors, environment, signal state, and so on. Modern kernels make this efficient with copy-on-write memory, but the programming model is old and deeply baked into Unix. Shells use it constantly. Servers use it. Build systems use it. Scripting languages assume it exists, or at least that the surrounding environment behaves as though it does.

Windows process creation is different. Windows has CreateProcess(), which starts a new program. That is a perfectly reasonable model, but it is not fork() (more like fork()+exec()). If you are just launching notepad.exe, no problem. If you are trying to implement a POSIX shell that forks, redirects file descriptors, adjusts the environment, and then starts another program, the mismatch is extreme and you’ll have to do some strange things to fake things out.

One of the early commercial answers was the MKS Toolkit, originally from Mortice Kern Systems. MKS gave Windows users a pile of familiar commands, shells, and development tools. It was not just ls and friends; it included things like ksh, vi, grep, find, awk, make, and many of the utilities needed to move scripts and build procedures between Unix and Windows. The current PTC MKS documentation still describes it in exactly that spirit: Unix shells and hundreds of commands for interoperability with Windows.

MKS was attractive because it treated Windows as Windows. You were not necessarily pretending your machine was a Unix workstation. You were getting a Unix-flavored toolbox that could operate in a Windows environment. For many people, that was enough. You could write scripts, process text, drive builds, and avoid learning three different syntaxes for the same job.

Continue reading “A Brief History Of Unix Commands On Windows: CoreUtils (Again)”