Matt Godbolt is a great speaker as well. I loved this talk that included a bit about the architecture behind his Compiler Explorer. The rest of his talk is super cool as well. E.g. closed form solutions from O(n) code? Compilers are awesome. <a href="https://m.youtube.com/watch?v=bSkpMdDe4g4" rel="nofollow">https://m.youtube.com/watch?v=bSkpMdDe4g4</a>
There is this thing that works similarly but for emacs:
<a href="https://gitlab.com/jgkamat/rmsbolt" rel="nofollow">https://gitlab.com/jgkamat/rmsbolt</a>
It seems pretty gosh darn spicy
This is amazing for all computer science degree courses. I wish I had this when I was learning this stuff. Sadly, I think the truth is that most profs or students won't know this platform exists.
Nice to see this continues to get exposure. It remains awesome and every time I return to it Matt's added some new nifty feature. More please Matt!
See also a command line tool[1] for this, written in Rust.<p>[1] <a href="https://github.com/ethanhs/cce" rel="nofollow">https://github.com/ethanhs/cce</a>
Really nice work by Matt. Haven’t seen a project before that makes some of that stuff quite so quick and simple.<p>Tangentially, anyone have a transpiler recommendation?<p>Started to look at Babel but it seems most inclined to targeting Javascript. Looking to go bidirectional between Python and a proprietary DSL.<p>Would have to reverse engineer the DSL grammmar I assume but it doesn’t seem very complex, so hearing of any good tooling would be interesting.
Or, in one line of shell:<p><pre><code> echo 'int square(int num) { return num*num; }' | gcc -S -x c - -o -
</code></pre>
How about this: open an editor on "test.c". Then in another terminal window, run this script:<p><pre><code> #!/bin/sh
rm -f test_copy.c
while true ; do
if [ test.c -nt test_copy.c ] ; then
cp test.c test_copy.c
clear
gcc -S test_copy.c -o -
fi
sleep 0.3
done
</code></pre>
Every time you save test.c, the compiler output updates in the other shell window (within a fraction of a second).
This would be really useful if it can be run offline. Much easier to use than writing code, compiling it with -S to produce assembly, then trawling through the assembly to look for the code you're interested in.
Is there a way to set this up to have two windows? One window to type code into and the other to run my program? I have been fiddling with the UI for a while, but can't quite figure it out.
It a very nice project.<p>I really like how it grew to encompass any language with AOT/JIT compilers, as long as anyone is willing to support the language related tooling.
Godbolt is very impressive for learning assembly, I also post this 5 days ago <a href="https://news.ycombinator.com/item?id=18635399" rel="nofollow">https://news.ycombinator.com/item?id=18635399</a>