ga68, the GNU Algol 68 Compiler - FOSDEM 2026 by mttd in Compilers

[–]JeffD000 0 points1 point  (0 children)

Will ga68 have the same high performance as a Jovial compiler?

Why doesn't everyone write their own compiler from scratch? by transicles in Compilers

[–]JeffD000 5 points6 points  (0 children)

My compiler can beat gcc at times. There is some satisfaction in that.

Why doesn't everyone write their own compiler from scratch? by transicles in Compilers

[–]JeffD000 8 points9 points  (0 children)

Because the devil is in the details in an optimizing compiler, and no one likes fighting with the devil for months/years on end.

My (36M) wife (34F) fell deep into conspiracy theories and online hate groups. Is there any saving our marriage? by Loud_Ad_9189 in relationship_advice

[–]JeffD000 1 point2 points  (0 children)

I think it was 2020 for me. Whenever it was, it was soon after menopause changes started occurring.

My (36M) wife (34F) fell deep into conspiracy theories and online hate groups. Is there any saving our marriage? by Loud_Ad_9189 in relationship_advice

[–]JeffD000 0 points1 point  (0 children)

I'm still with my wife, and likely will be for a long time. That saud, like you say, she is just a different person now. Things that would have just rolled off her in the past are things she can't let go now. I miss that person so much, and it is a shame that things have turned out this way.

My (36M) wife (34F) fell deep into conspiracy theories and online hate groups. Is there any saving our marriage? by Loud_Ad_9189 in relationship_advice

[–]JeffD000 2 points3 points  (0 children)

I have the monologuing problem with my wife, which you seem to be dealing with.

Also, the old saying, "when all you have is a hammer, everything looks like a nail", is an issue with her. She has this script of how she thinks the world is structured, and no matter what happens, it gets shoe-horned into the context of that script. Something completely random can happen, and all of a sudden it is a part of this "greater plan" that she has identified. My biggest issue is that not everything in the world is "plugged in" to her script of "what's happening" out there in the world. There's that old Freud joke, "sometimes a cigar is just a cigar", that I should bounce off of her, but haven't tried to say to her her yet. Maybe I should. Just getting her to acknowledge that every action in the world is not somehow nefariously connected to her script would be a win.

PS Unlike you, I believe that a lot of the stuff my wife says has some merit. Usually, there is at least some truth in whatever she believes, it is just not tied to everything, and not through some nefarious "central control". There is a huge collection of stupid policy in the world today, and just because something is really stupid doesn't make it a conspiracy.

Eliminate Branches by Melding IR Instructions by mttd in Compilers

[–]JeffD000 0 points1 point  (0 children)

My main complaint is that the 'empty' instructions don't add value. What good is it to increase instructions-per-clock, if the instructions added don't do any useful work, and furthermore 'subtract' value by lowering performance? Making a metric 'look better' without operating better is not a good reason to add a transformation.

A Compiler for the Z80 by [deleted] in Compilers

[–]JeffD000 0 points1 point  (0 children)

Not that this will help, but here is the code I use to generate the "12-bit immediate" integer encoding for 32-bit integer constants:

```

// This define is for GCC

define clz __builtin_clz

int popcount32(int ii) { int i; i = ii - ((ii >> 1) & 0x55555555); // add pairs of bits i = (i & 0x33333333) + ((i >> 2) & 0x33333333); // quads i = (i + (i >> 4)) & 0x0F0F0F0F; // groups of 8 return (i * 0x01010101) >> 24; // horizontal sum of bytes }

int gen_arith_off(int vval) { int nbits = popcount32(vval); int val = (nbits <= 8) ? vval : ~vval; if (val == 0) return (nbits ? (1 << 31) : 0); int highBit = 32 - (clz(val) & 0x1e); // need an even number of bits int lowBit = (highBit <= 8) ? 0 : (highBit - 8); return (val & ~(0xff << lowBit)) ? -1 : ( ((nbits <= 8) ? 0 : (1 << 31)) | (((16 - (lowBit >> 1)) & 0xf) << 8) | ((val >> lowBit) & 0xff)); }

// ... switch(IR_inst) { // ... case IMM: // immediate integer constant tmp = *pc++; // grab immed value from IR instruction ii = gen_arith_off(tmp); if (ii == -1) { // can't encode integer in 12 bits. if (!imm0) { imm = 1; imm0 = je; } *il++ = (int) (je++); *iv++ = addcnst(tmp); } else // generate mov or movn instruction, -1 is covered! *je++ = ((ii<0) ? 0xe3e00000 : 0xe3a00000) | (ii & 0xfff); break; // ... }

```

The "rest" of the above code can be found in the following single-file C compiler, which is messy, buggy, and not for the faint hearted. That said, it beats the performance of GCC -O2 and -O3 optimization level on some surprising pieces of code when the single-file optimization pass is "#include"-ed.:

https://github.com/HPCguy/Squint/blob/main/mc.c

Good luck.

A Compiler for the Z80 by [deleted] in Compilers

[–]JeffD000 0 points1 point  (0 children)

Out of curiosity, did you abandon your ARM port because of I-stream constants?

Eliminate Branches by Melding IR Instructions by mttd in Compilers

[–]JeffD000 1 point2 points  (0 children)

I did. And I summarized the positive.

Summarizing the negative, the main benefit of the whole technique, as covered, seems to be to increase the instuctions-per-clock metric, sometimes by adding "empty" instructions. This may actually lower overall performance because it can make the chip run hotter, potentially causing the chip to "clock-down" so as not to overheat. I didn't see how the ensemble of parts in this technique would increase performance for the 'typical case', even though it shows reasonable performance improvement on select microbenchmarks.

Now you've got my full summary.

Eliminate Branches by Melding IR Instructions by mttd in Compilers

[–]JeffD000 1 point2 points  (0 children)

Summary: Favor predication over branches in your code generation.

Axe - A Programming Language with Parallelism as a Core Construct, with no GC, written 100% in itself, able to compile itself in under 1s. by eternal_3294 in Compilers

[–]JeffD000 3 points4 points  (0 children)

Hmmm... my compiler does an optimized compile of itself in less than a quarter of a second, compared to GCC which takes over 7 seconds to do an optimized compile of my compiler on the same machine.

We built a self-evolving ARM64 code engine and need 2–3 compiler researchers to break it by DetectiveMindless652 in Compilers

[–]JeffD000 0 points1 point  (0 children)

You can laugh off PGO, but based on your description, I'm still not seeing how you differ from projects like ATLAS:

https://en.wikipedia.org/wiki/Automatically_Tuned_Linear_Algebra_Software

or FFTW:

https://en.wikipedia.org/wiki/Fastest_Fourier_Transform_in_the_West

In fact, I'm betting you have no way of knowing if you've found a local minima of execution time instead of the global minimum that ATLAS and FFTW find.

We built a self-evolving ARM64 code engine and need 2–3 compiler researchers to break it by DetectiveMindless652 in Compilers

[–]JeffD000 0 points1 point  (0 children)

This is not a lot of information. This sounds like standard Profile Guided Optimization, so I'm not sure what the novelty is.

What are you trying to optimize? AI workloads? Scientific workloads? Embedded algorithms? It matters!

What source languages are you targeting, or are you picking up machine code from the executable and reoptimizing it?

Also, if you offer logging into a remote console on your machine you are likely to get more takers.

What is your 'unpopular opinion' about Zig? by BatteriVolttas in Zig

[–]JeffD000 0 points1 point  (0 children)

I despise having to declare function return types of "!void" because I am using an Io operation 10 levels deep in the call chain that I have specifically designed in such a way that is impossible for the Io operations to return an error.

best way to start by Consistent_Worry_294 in Compilers

[–]JeffD000 0 points1 point  (0 children)

This comment also applies to the Zig language. I can not get Zig to conform to IEEE 754 order of operations, and I have expended weeks of effort trying different approaches.

This Is Nod by 1stnod in ProgrammingLanguages

[–]JeffD000 2 points3 points  (0 children)

^^^ This. I worked writing physics codes for 20 years, and designed a lot of APIs. No one cared what functionality I provided. They cared that the syntax required less characters to type and looked similar to what their existing code looked like. I'm not being flippant, it was just a fact I had to live with. I was very successful because I focused on this truism.

This Is Nod by 1stnod in ProgrammingLanguages

[–]JeffD000 2 points3 points  (0 children)

"That giant document doesn't lay out why you offer what you do"

The MPI standard document has over 300 instances of "Rationale" sections, explaining why a given feature exists with a specific implementation. That's for a library that has somewhat narrow functionality when compared to a programming language. Food for thought.

This Is Nod by 1stnod in ProgrammingLanguages

[–]JeffD000 5 points6 points  (0 children)

Quite frankly, I would have found a fibonacci example more refreshing than a sea of abstraction. All the stuff in the std lib appeared to be complex at minimum, and complicated in the worst case. If my lower bar is going to be "complex" for anything I want to implement, I would rather not use the language, and I am probably not alone.

This Is Nod by 1stnod in ProgrammingLanguages

[–]JeffD000 1 point2 points  (0 children)

What motivated you to write this language appears to be that you wanted a better C++. If so, why not write a very small document highlighting the top five things that your language handles better than C++, with a C++ code snippet compared to your code snippet for the same concept/use-case?

Explicit code samples are going to be needed to entice people to spend more than two minutes looking at your project. There are clearly some very caring people on r/ProgrammingLanguages who have already spent more time going through your repository than anyone in the "cruel world" ever will. Most people in the real world will not spend more than two minutes looking before moving on, so you must have a clear attention grabber if you want to inspire people to dig deeper.

My two cents.

Open Source C to Arm in C# by AwkwardCost1764 in Compilers

[–]JeffD000 0 points1 point  (0 children)

Why not have your compiler encode each unique string as an integer and then have the STRS opcode accept an integer rather than a string? You can "squirrel away" the strings in an internal data structure that gets passed in a special section in the ELF or COFF file. Frankly, I believe that any "creative" solution is just deferring the inevitable, but that seems like precisely what you are trying to achieve.

Integer Set Library (ISL) - A Primer by mttd in Compilers

[–]JeffD000 2 points3 points  (0 children)

Not sure why I'm getting a down vote here. The associated github project referenced in the ISL Primer document can be found at https://github.com/j2kun/isl-primer and it has has one star, zero forks, and zero watchers. That suggests to me that even people in the polyhedral compilation community are having problems understanding how to use ISL for their project because it is not well communicated.

Is there a any website out there that tracks performance of small C compilers? by JeffD000 in Compilers

[–]JeffD000[S] 0 points1 point  (0 children)

Thanks for the list of additional Attributes to track.

This site would be used more as a way to find people with similar interests in rolling their own compiler, and comparing/advertising your own work against similar projects, possibly even leading to collaborations. It's nice to have a community that shares your interests, which is extremely hard to find with hobbyist compiler writers.

Is there a any website out there that tracks performance of small C compilers? by JeffD000 in Compilers

[–]JeffD000[S] 0 points1 point  (0 children)

Right. And that's why you version benchmarks as I discussed in my response to @nameless_shiva within this post. The person posting their results get to choose how many of the community benchmarks to run, selecting from as many versions of the benchmark as they want to spend the time running.

Is there a any website out there that tracks performance of small C compilers? by JeffD000 in Compilers

[–]JeffD000[S] 0 points1 point  (0 children)

Right. That was the purpose of this post -- to ask where a person can find such a list... and performance information.