Create A Compiler Step-By-Step

While JavaScript might not be the ideal language to write a production compiler, you might enjoy the “Create Your Own Compiler” tutorial that does an annotated walkthrough of “The Super Tiny Compiler” and teaches you the basics of writing a compiler from scratch.

The super tiny compiler itself is about 200 lines of code. The source code is well, over 1,000 but that’s because of the literate programming comments. The fancy title comments are about half as large as the actual compiler.

The compiler’s goal is to take Lisp-style functions and convert them to equivalent C-style function calls. For example: (add 5 (subtract 3 1) would become add(5,subtract(3,1)).

Of course, there are several shortcut methods you could use to do this pretty easily, but the compiler uses a structure like most full-blown modern compilers. There is a parser, an abstract representation phase, and code generation.

Continue reading “Create A Compiler Step-By-Step”

Portable Commodore 64 Lives!

When you think of a luggable computer, you might think of the old Compaq or — if you are old enough — a Kaypro. But you don’t see as many Commodore SX-64 computers. [The 8-Bit Guy] has wanted one for a while and finally got one, but it wasn’t working. No problem! Just fix it!

The device actually looks sleek compared to some other portables of the era and had a color screen, but — probably due to the price — they didn’t sell very well. The outside of the device looked pretty clean other than some loose screws and clips. The space key was quite yellow but at least there was a keyboard cable which is nearly impossible to find anymore.

Continue reading “Portable Commodore 64 Lives!”

Tesla Coil Makes Sodium Plasma

Looking for a neat trick to do with your Tesla coil? [The Action Lab] uses his coil to make a metal plasma — in particular, sodium. You can see the results in the video below.

To create a metal plasma, you need a metal vapor and sodium can create a vapor at a relatively low temperature, especially in a vacuum. The resulting glow is pretty to look at, but you will need a bit of lab gear to pull it off.

Continue reading “Tesla Coil Makes Sodium Plasma”

Honey, We Shrunk The Nuclear Reactor

[Power Engineering] took a trip to the Westinghouse facility that provides maintenance for nuclear reactors. The research division there has a new microreactor called eVinci and — according to the company — it is a disruptor. Technically, the device is a heat pipe-based passive cooling design that can generate 5 MW of electricity or 13 MW of heat from a 15 MW heater core. You can see a video about the device below.

The company says its initial targets are remote areas like mines that usually depend on diesel generators. Hundreds of passive heat pipes inside a graphite core which contains TRISO (tristructural isotropic) fuel pellets. The heat pipes allow efficient transfer of thermal energy with no pumps.

Continue reading “Honey, We Shrunk The Nuclear Reactor”

Electroplated 3D Printed Sword: Shiny!

We all want to 3D print metals, but the equipment to do that is still beyond most home workshops. However, [HEN3DRIK] takes resin 3D-printed items and electroplates them. Might not be as good as printing in metal, but it sure looks metallic. As you can see in the video below, the sword looks like it was crafted from highly-polished steel.

The sword comes out in four pieces. He repeats several times that sanding is the key because you must have flat surfaces. Using sandpaper and steel wool, he worked the parts to a fine finish. The parts assemble along an M8 threaded rod to form a whole. The next step was to electroplate with copper.

Continue reading “Electroplated 3D Printed Sword: Shiny!”

Don’t Believe Everything You Read: The Great Electric Toaster Hoax

We’ve all looked up things on Wikipedia and, generally, it is usually correct information. However, the fact that anyone can edit it leads to abuse and makes it somewhat unreliable. Case in point? The BBC’s [Marco Silva] has the story of the great online toaster hoax which erroneously identified the inventor of the toaster with great impact.

You should read the original story, but in case you want a synopsis, here goes: Until recently, the Wikipedia entry for toasters stated that a Scottish man named Alan MacMasters invented the electric toaster in the 1800s. Sounds plausible. Even more so because several books had picked it up along with the Scottish government’s Brand Scottland website. At least one school had a day memorializing the inventor and a TV show also honored him with a special dessert named for Alan MacMasters, the supposed inventor. Continue reading “Don’t Believe Everything You Read: The Great Electric Toaster Hoax”

The 13.5 Million Core Computer

Having a dual- or quad-core CPU is not very exotic these days and CPUs with 12 or even 16 cores aren’t that rare. The Andromeda from Cerebras is a supercomputer with 13.5 million cores. The company claims it is one of the largest AI supercomputers ever built (but not the largest) and can perform 120 Petaflops of “dense compute.”

We aren’t sure about the methodology, but they also claim more than one exaflop of “AI computing.” The computer has a fabric backplane that can handle 96.8 terabits per second between nodes. According to a post on Extreme Tech, the core technology is a 3-plane wafer processor, WSE-2. One plane is for communications, one holds 40 GB of static RAM, and the math plane has 850,000 independent cores and 3.4 million floating point units.

The data is sent to the cores and collected by a bank of 64-core AMD EPYC 3 processors. Andromeda is optimized to handle sparse matrix computations. The company claims that the performance scales “almost linearly.” That is, as you double the number of cores used, you roughly half the total run time.

The machine is available for remote use and cost about $35 million to build. Since it uses 500 kW at peak run times, it isn’t free to operate, either. Extreme Tech notes that the Frontier computer at Oak Ridge National Labs is both larger and more precise, but it cost $600 million, so you’d expect it to be more capable.

Most homebrew “supercomputers” we see are more for learning how to work with clusters than trying to hit this sort of performance. Of course, if you have a modern graphics card, OpenCL and CUDA will let you do some of this, too, but at a much lesser scale.