preciz

preciz

I like to find performance optimizations and hidden bugs in Elixir codebases with coding agents.
If I just ask them directly to find those, they are not that successful, but recently I found two ways that are more fruitful.

Core Erlang and BEAM bytecode inspection:
If I ask my agent to inspect the Core Erlang and BEAM bytecode of a module, it finds much more insightful details and higher quality performance patches.

One of my prompts looks like this:

Further refactor ModuleName.function towards the Pareto frontier of performance, simplicity, elegance.
First, always check the Core Erlang & BEAM bytecode. Then do the refactor, then check Core Erlang & BEAM bytecode again so you continuously gain performance insights from them.

If there are low hanging performance improvement opportunities, the above prompt can find those usually.

Lean 4 formalization:

I would do something like this:

/goal Fully formalize module N of this Elixir codebase in a new formalization/ dir with the Lean 4 theorem prover.

Then it goes to work for a long time (it probably never finishes), but while the main thread is running, I’m using the /btw command to ask questions about the code based on the formalization. This can find very interesting things about the code and it seems like the optimizations/bugs/security issues it can find this way are numerous.

My Conclusion:
Maybe these are just different ways to force an agent to do work and to look at code from different perspectives, but I found that these work well enough to find surprisingly good issues in established codebases.

Showing Posts 1 to 4

mudasobwa

mudasobwa

Creator of Cure

The examples of both in the shape “Code: …, AI Finding: …, Fix: …” would have drastically improved the quality of this observation.

preciz

preciz OP

For me the real insight here is to force the agent to use Core Erlang, BEAM bytecode, Lean 4. Not in what form it reports the issues if you mean that.

mudasobwa

mudasobwa

Creator of Cure

I mean without an example this is not an insight. I was advocating for using static analysis with AI for more than a year already, but I am also an author of a bunch of static tools, way more powerful than just looking into bytecode, and I am an author of Cure language, making Lean4 just a redundant link in this chain.

preciz

preciz OP

That’s great, cause one of my goals were to learn more about this space. I’m now looking into Cure then.

— All posts loaded —

Where Next? Top

Trending in AI / LLMs Top

webofbits
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself. My main conc...
#ai
New
AstonJ
This showed up on my feed.. anyone heard of it? Just hype? Ox Alpha is a reasoning model designed for coding, sustained ag...
New
sergio
It’s not that it’s vocabulary is too advanced. It’s something worse. I get lost trying to follow even a paragraph written by Claude. It’...
New
AstonJ
With advancements in AI gathering pace and set to increasingly accelerate, perhaps it’s worth having an annual thread on the topic - feel...
New
AstonJ
Following on from some recent threads about AI and AI created projects I’m curious what people have been creating with AI tools …and perh...
New
preciz
I like to find performance optimizations and hidden bugs in Elixir codebases with coding agents. If I just ask them directly to find tho...
New
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews