Totally, and the #nanopass framework is a joy to use. While I'm starting to get interested in #LLVM, primarily because the learning resources are immense, I'm not sure why anyone would choose it except for very low-level matters, or targeting something like SPIRV.
I just finished building #LLVM + #Clang on my #RISCV dev board! The entire process, from cloning the repo to building, linking, and installing, was all done natively on RISC-V!!
It took about 19 hours of work and 16 hours of having the puny quad-core in-order RISC-V CPU pinned at 100%, but the thing actually built successfully and is compiling and running programs. Insanely impressive stuff.
I have half an hour trip to climbing gym and back 3 times a week. Not to waste this time I take my laptop with downloaded materials with me and watch courses.
scratch86 is a super fast compiler for MIT #Scratch projects--- it's meaningless to so much as try to compare to the standard Scratch interpreter. scratch86 compiles projects directly to #LLVM IR, and the Scratch standard library is handwritten in C.
A nice side effect of the new state machine synthesis is that I can now generate nice graphs of the state machines.
Let's look at the blink example from before:
while (1) {
__output_led(0);
for (uint64_t it = 0; it < CLOCK_FREQ; it++)
clock();
__output_led(1);
for (uint64_t it = 0; it < CLOCK_FREQ; it++)
clock();
}
So I started building a high level synthesis tool that compiles LLVM IR to verilog...
It allows you to precisely control timing behavior by inserting clock() statements in your code. Here is a simple blink example:
while (1) {
__output_led(0);
for (uint64_t it = 0; it < CLOCK_FREQ; it++)
clock();
__output_led(1);
for (uint64_t it = 0; it < CLOCK_FREQ; it++)
clock();
}
The tool now automatically generates a state machine for this code.
I'm playing with #llvm - trying to follow what it's doing in #mesa compiling OpenCL shaders. Now, I've taken the debug IR dump from the AMD driver and written that to a .ll, fed it into llvm's 'llc' program and thrown it --debug (after building my own llvm build). Now just a 36700 line debug file to look at 🙂
I never knew this! #Mojo is created by the guy behind #LLVM and #Swift. This is just insane, makes me take it more seriously after just reading a few comments about it here on #Mastodon.
Looks great, but it is still closed. Will let you know if I get #beta access.
Just to mess with the other guys: #Rust hahhaha made you read a #Python post
It seems literally impossible to get #ClangFormat to not align stuff.
Don't believe me? Take this piece of code and find a clang-format config which doesn't align stuff:
auto getWhateverStmt = db_.stmt(
"SELECT * FROM mytable "
"WHERE k = 2 "
"ORDER BY createdAt").bind();
Feel free to play with it in https://zed0.co.uk/clang-format-configurator/. I literally can not find a way to make it not produce something absolutely ridiculous where the SQL is pushed all the way to the right.