How can we make it easier to experiment with the compiler?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Mon May 24 14:37:45 UTC 2021


On Monday, 24 May 2021 at 10:47:16 UTC, Johan Engelen wrote:
> My standpoint on the original topic of "make it easier to 
> experiment with the compiler": I disagree with making the code 
> more stable. If anything, we should be refactoring much more 
> aggressively, changing function names etc.

Thank you for bringing us back on topic. Yes, or at least have a 
map of what is considered stable and well encapsulated and what 
is considered unstable and likely to change.

I don't believe this is a matter for git rebasing 
tooling/understanding. I just don't want to build _directly_ on 
top of something that looks like it is likely to change (from a 
software engineering point of view).

I consider every hour spent on rebasing, dealing with regressions 
etc to be losses,  or more importantly "not fun". I only want to 
do "not fun" things if I can learn something from them.

D has to rely on hobbyists, so getting "not fun"/"no learning 
potential" out of the way is important.

> others too). The frontend source code is not nice, but I'm not 
> drawn to fix it at all (even if paid for) because I am not 
> ashamed by it as I would be if I would have some shared 
> 'ownership' of it.

That is a bit harsh, of course all code bases that have evolved 
over a long time are not nice, parts of LDC too.

Anyway, my main wish is just to be able to inject my own IR 
between the frontend and backend.

My feeling right now is that to do that I have to choose LDC and 
then heavily modify it. I sense that in the end I basically will 
end up with my own backend, something I don't want to maintain...

Think of it like LEGOs. The front end is a green brick and the 
back end a red brick. I want to insert a white brick between 
them. I don't want to modify the bricks more than "cleaning" the 
studs.

Another analogy, if the frontend is an engine, my IR is the 
transmission and the backend is the wheels, then I don't mind 
that the current engine is oily and grease, I leave that to other 
mechanics to clean up. Same with the wheels. I just want to be an 
expert on the transmission and evolve it from a manual 
transmission into a nice automatic transmission. Right now the 
engine is coupled directly to the wheels... which basically means 
being forced to drive in the same gear all the time.

I am less interested in getting my fingers greasy and am happy to 
leave that to others as long as I can focus on polishing the 
chrome on my transmission line...

(I belive many things could be done with an intermediary high 
level IR, such as ARC, stackless coroutines, heap 
optimizations... LLVM is too low level. AST is too cumbersome.)





More information about the Digitalmars-d mailing list