MIDREAL

Show HN: Godbolt-in-a-floating-window for Neovim (C, C++, Rust)

Comments

shmerl 10d ago on HN
That's interesting. There is also https://codeberg.org/Jorenar/nvim-dap-disasm if you want to get it for actual compiled result + debugger.
evmar 10d ago on HN
https://github.com/pacak/cargo-show-asm is a nice helper for the Rust->asm part of this that has seen a decent amount of work for handling all the edge cases. (I've contributed a bit to it to handle some Windows issues.)
bajard 10d ago on HN
Maybe I should say Compiler Explorer instead of Godbolt.

This should be mandatory for any programming environment, along with a CPU emulator showing how data moves through the ALU, and all the ports, to which registers it goes to, and how everything works clock by clock.

I hope AI makes this possible, at least for VS Code and C++.

rpqt 10d ago on HN
Yeah there is so much to do on the visualization side! I know people who still draw these things on paper and count cycles by hand.
0c3ca83 10d ago on HN
Paper is a medium of thought, and writing without a computer is still one of the best ways to slow down and organize your mind.

I still write code out on paper as I think through algorithms.

bee_rider 10d ago on HN
Modern cores are quite wide, I don’t know if my monitor is big enough to show this info for all the in-flight instructions…
bajard 10d ago on HN
When I program, I imagine the registers and ports. Only the ones I use. I see the sequence of micro-ops moving like in a queue, the stack in a different column, and the L1 cache as neighboring lines. That could be drawn.

The parts not involved could be drawn in miniature, like the AVX2 hardware. More detail could be shown if the user clicks.

It probably isn't as complex to draw.

bee_rider 9d ago on HN
Does that give good results?

I try to push the computations involve in the critical path up as high as possible, and then just hope that between the compiler and hardware somebody’ll take advantage of that.

I haven’t tuned a ton of kernels though, I mostly do linear algebra stuff and good BLAS implementations do better than I could hope to.

bajard 9d ago on HN
uica.uops.info has been down for a long time, but it used to show graphically how many CPU cycles it takes to execute a small piece of code.

Modern x86 CPUs have multiple execution ports, with duplicated hardware for the same operations, and the exact same operation can be performed in different ways.

As a toy example, multiplying a number by 2 can be done using multiplication, a bit shift, addition (adding the value to itself), or the pointer calculator. On x86 CPUs, these instructions can execute simultaneously on different ports, allowing you to perform six or more operations in parallel. This means you can achieve higher throughput by using different implementations of the same operation instead of relying on a single instruction.

You can't leave this to the compiler. It chooses only one implementation, leaving other execution ports unused.

ceryle 10d ago on HN
i don't think IHVs would give out the RTL required for this to be possible, and it would also require a ton of compute to simulate it. TDA will be the best you can get reasonably.
ivanjermakov 10d ago on HN
I usually want to see assembly during debugging, not development. For which rad debugger is a must (now on Linux!): https://github.com/EpicGames/raddebugger
FirstClassTree 10d ago on HN
genuinely asking, but isn't today the AI writing the code?
FirstClassTree 10d ago on HN
I mean I'm not a nub I know C and has a degree in CS and stuff, worked at Microsoft
FirstClassTree 10d ago on HN
I also use VIM for my Obsidian note taking, which kind of replaces my code writing
0xdeadf1sh (author) 10d ago on HN
I've made this for my hobby projects where I still get to write the code manually. If you are using agentic coding then you don't need neovim to begin with.
0c3ca83 10d ago on HN
It's certainly making the business decisions, at least. It's incredible how many CEOs admit that their decisions came from asking ChatGPT.
swatcoder 10d ago on HN
Some of the code, some of the time, for some of the people.

Yet far from all of the code, all of the time, for all of the people.

People just like to talk it up, especially if they've been able to let it take over they're own coding. And some people work and chat in bubbles where they only know people working similarly to themselves.

waschl 10d ago on HN
+1 only because of the seemingly non-AI README. Such a joy to get the core info in one glimpse
0xdeadf1sh (author) 10d ago on HN
The whole reason this extension exists is to help me with my non-AI hobby projects like path tracer in C, and my C++ Vulkan renderer.

I don't think this extension is valuable for people who use agents to code.

RahulMishra315 10d ago on HN
Tested this on mobile Chrome — loads super fast and the UI is very clean. Nice work!

Comments are loaded live from Hacker News and are not stored by Mid or Real.