Tech Explained: MetaLens

I was recently playing around with ST’s VL53L8CX time-of-flight (ToF) sensor. It sends out 940nm infrared light and measures how long reflections take to return. ST uses two metalenses inside this tiny module, and that sent me down a rabbit hole in optics to figure out what that is.

Think of an ordinary camera lens. Its curved glass or plastic surfaces bend light until it reaches a focus. A metalens can shape light using a surface that is almost flat. Across it sit millions of nanometre-scale pillars, each deliberately sized or shaped.

What is MetaLens?

Light really does pass through these structures in common designs. Each pillar changes the phase of the passing light, meaning how that small part of the wave lines up with the rest. Together, they create an outgoing wave that converges at a point, or spreads light into a chosen pattern. That is how a flat surface can perform the job of a curved lens. The pattern can also spread a laser beam into a designed shape, which is useful in sensors.

What are they made from? Usually a transparent substrate, often glass, with patterned materials such as silicon for infrared, or titanium dioxide and silicon nitride for visible light. Manufacturers use chip-making methods like lithography and etching to define the pillars. Nanoimprinting, rather like stamping, can replicate a master pattern for volume production. The patterned layer can be around 1 µm thick.

Applications are limitless. You can make compact optics, shape a laser beam precisely and sometimes replace multiple optical elements. They’re already in depth sensors, facial sensing and other specialised modules. But wide-angle, full-colour cameras are harder. Different colours don’t automatically focus at the same point, efficiency can fall and large areas demand extremely precise manufacturing.

One detail I think is worth keeping in mind: an almost-flat optical layer doesn’t make an entire camera that thin. Light still needs some distance to travel from the lens to the sensor.

If you liked the post, Share it with your friends!

Tech Explained: Compressed RAM

Last week, I happened to go through a slide deck by Gregory Price of Meta about CRAM, presented at the Linux Plumbers Conference. It’s good stuff. With RAM prices rising, I think the idea is worth understanding.

From fundamentals first. Linux already uses kernel modules zram & zswap that compress less-used blocks of memory called pages. A 4 KiB page might shrink to 1 KiB. That’s 3 KiB saved, letting you store more in the same RAM. But when an application needs it again, it triggers a page fault. Linux pauses the app, decompresses the page and restores access. Repeating this costs time.

How does CRAM work?

Now CRAM asks a simple question. What if the CPU could read that page without Linux first unpacking it? The idea is to put compression and decompression inside the memory hardware. Data stays compressed in RAM, but when the CPU requests it, the hardware returns the original bytes automatically. Applications still use normal memory addresses. Linux doesn’t need to swap the page back in just for a read. This could be especially useful for data you read often but rarely change.

Writes are harder. Our 1 KiB compressed page might expand to nearly 4 KiB if you replace its contents with data that won’t compress. CRAM handles this by keeping compressed pages read-only. A write triggers a move back to ordinary RAM before the change is made. So the benefit depends on the workload. His work reported a 452x throughput gain over zram. But the test used DRAM-backed memory to isolate page-fault overhead. It doesn’t prove 452x faster applications on real compressed hardware.

I think the question is whether this can scale. With RAM prices rising, saving physical memory could matter for servers. But it’s no magic bullet. CRAM needs compression-capable hardware, making widespread use a next-generation change rather than a software update. The approach isn’t limited to Linux either. Will hardware makers and OS developers, including Microsoft, see value in adopting it? I really hope they do.

If you liked the post, Share it with your friends!
1 2 3 … 24