If you do much Linux shell scripting, you’ve probably encountered
sed — the stream editor — in an example. Maybe you’ve even used it yourself. If all you want to do is substitute text, it is easy and efficient. But if you try to do really elaborate editing, it is often difficult to get things right. The syntax is cryptic and the documentation is lacking. But thanks to [SoptikHa2] you can now debug sed scripts with a text-based GUI debugger. Seriously.
According to the author, the program has several notable features:
- Preview variable values, both of them!
- See how will a substitute command affect pattern space before it runs
- Step through
sed script – both forward and backward!
- Place breakpoints and examine program state
- Hot reload and see what changes as you edit source code
- Its name is a palindrome
There’s only one word for that last feature: wow.
Continue reading “Debugging For Sed — No Kidding”
We aren’t sure how we feel about [pemistahl’s] grex program. On the one hand, we applaud a program that can take some input samples and produce a regular expression. On the other hand, it might be just as hard to gather example data that produces the correct regular expression. Still, it is an interesting piece of code.
Even the author suggests not to use this as an excuse to not learn regular expressions, since you’ll need to check the program’s output. It is certain that the results will match your test cases, but it isn’t certain that it won’t accept things you didn’t expect. Bad regular expressions have been the source of some deeply buried bugs.
Continue reading “Program Guesses Your Regular Expression”
[Michael] volunteers with emergency services, and sometimes has to monitor radio traffic. Sometimes there’s a lot to review, and to make it easier he wrote a noise gate — think of it as a squelch — to break apart recorded audio into parts. Rust has been gaining popularity for writing low level software, and that’s the language he uses. However, you’ll see even if you don’t know Rust, it is pretty easy to figure out.
For test data, [Michael] took some publicly-available recordings of air traffic control. Using some ready-made audio processing functions and a simple state machine makes the code easy to write.
Continue reading “Audio Processing In Rust”
Can you generate VGA and handle a PS/2 keyboard with a Cortex-M4 in Rust? That’s precisely what [theJPster] wanted to find out with Monotron, a 1980s style home computer programmed in pure Rust.
In order to run embedded Rust without a working operating system, some tools are necessary: an LLVM back-end for generating machine code, a target file for specifying memory sizes and other configs, and a pre-compiled libcore as a substitute for a compiler when running an operating system. Rust takes the place of C running on top of the board support package (BSP) and hardware abstraction layer (HAL), and peripheral access crates (PACs) that specify the hardware and allow the code to be portable across different chips.
The implementation generates a 800 x 600 VGA video signal at 60 Hz, displays text on a 48 character by 36 line display, displays color graphics using color lookup (stored in flash memory), and runs applications that take less than 24 KiB for all data. Monotron also generates 8-bit audio with PWM and sports a synthesizer that uses a three-channel wavetable allowing it to make sounds with square waves, sine waves, sawtooth waves, and create white noise.
So far, the Monotron has been able to work with an Atari joystick, a PS/2 keyboard, and has outputs to VGA, MIDI, SD card, and audio. Next up for the Monotron: writing a programming language (tentatively named Monotronian), adding support for Sega Megadrive pads, displaying sprites, and many more exciting developments.
Continue reading “A DIY Retrocomputer Programmed In Pure Rust”
The last Amiga personal computer rolled off the assembly line in 1996, well over 20 years ago. Of course, they had their real heyday in the late 80s, so obviously if you have any around now they’ll be in need of a little bit of attention. [Drygol] recently received what looks like a pallet of old Amiga parts and set about building this special one: The Vampiric Amiga A500.
The foundation of this project was a plain A500 with quite a bit of damage. Corrosion and rust abounded inside the case, as well as at least one animal. To start the refurbishment, the first step was to remove the rust from the case and shields by an electrochemical method. From there, he turned his attention to the motherboard and removed all of the chips and started cleaning. Some of the connectors had to be desoldered and bathed in phosphoric acid to remove rust and corrosion, and once everything was put back together it looks almost brand new.
Of course, some other repairs had to be made to the keyboard and [Drygol] put a unique paint job on the exterior of this build (and gave it a name to match), but it’s a perfect working Amiga with original hardware, ready to go for any retrocomputing enthusiast. He’s no stranger around here, either; he did another extreme restoration of an Atari 800 XL about a year ago.
For many people, a retrocomputer is a classic machine from the past lovingly brought back to working order. But for some, the idea of a retrocomputer is wider than that, encompassing modern hardware that delivers to feel like a device from the past.
The Monotron from [Jonathan Pallant] is one such computer. It’s definitely a retrocomputer such as you might have found in the 1980s, but it’s running on a much more modern Tiva-C TI Launchpad dev board sporting an ARM Cortex M4.
The platform has been created entirely in Rust, and emulates what would have been a rather desirable machine in the early 1980s. With an 800×600 pixel 8-colour VGA display interface, 32k of RAM, and mono 8-bit audio, it already has a few simple demos and games running upon it. [Jonathan Pallant] has given more than one talk on its design and capabilities, we’ve placed one of them as a video below the break. There is even a PCB available which adds all the ports as well as a micro SD card slot for program storage.
We like the Monotron, and we look forward to seeing it develop. It’s an exciting time for retrocomputig with projects such as the RC2014 Z80 machine and the Gigatron TTL RISC processor, but is there space for an emulated one such as this? We hope so.
Continue reading “The Monotron, A Rusty Retrocomputer”
If you have something rusty, you can get a wire brush and a lot of elbow grease. Or you can let electricity do the work for you in an electrolysis tank. [Miller’s Planet] shows you how to build such a tank, but even better, he explains why it works in a very detailed way.
The tank uses a sodium carbonate electrolyte — just water and washing powder. In the reaction, free electrons from the electrolyte displace the oxygen from the rusted metal piece. A glass container, a steel rod, and a power supply make up the rest.
Continue reading “Electrolysis Tank Removes Rust”