www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Imperative template patterns

reply monkyyy <crazymonkyyy gmail.com> writes:
As we all should know, the ast is modified live and the compiler 
never deallocates. This leads to compiler bugs that give glimpses 
behind the veil. Such ~~bugs~~ features I think are actually 
quite valuable when the devs are overly cautious, see them 
disallowing ct io.

Whats the current knowledge of compiler bugs, and how to use 
them? Anyone found any that Im unaware of?
May 05
next sibling parent reply user1234 <user1234 12.de> writes:
On Monday, 5 May 2025 at 22:52:57 UTC, monkyyy wrote:
 As we all should know, the ast is modified live and the 
 compiler never deallocates. This leads to compiler bugs that 
 give glimpses behind the veil. Such ~~bugs~~ features I think 
 are actually quite valuable when the devs are overly cautious, 
 see them disallowing ct io.

 Whats the current knowledge of compiler bugs, and how to use 
 them? Anyone found any that Im unaware of?
mmmh, do you want to know if people are secretly using undocumented compiler bugs like a secret magic knowledge ? That would not be reliable. Someone else can notice the problem, report it, later it gets fixed, and then your exploit does not work anymore. Sorry if I'm "off the spot" but in first place your question was not very clear.
May 07
parent reply Monkyyy <crazymonkyyy gmail.com> writes:
On Wednesday, 7 May 2025 at 13:32:41 UTC, user1234 wrote:
 On Monday, 5 May 2025 at 22:52:57 UTC, monkyyy wrote:
 As we all should know, the ast is modified live and the 
 compiler never deallocates. This leads to compiler bugs that 
 give glimpses behind the veil. Such ~~bugs~~ features I think 
 are actually quite valuable when the devs are overly cautious, 
 see them disallowing ct io.

 Whats the current knowledge of compiler bugs, and how to use 
 them? Anyone found any that Im unaware of?
mmmh, do you want to know if people are secretly using undocumented compiler bugs like a secret magic knowledge ? That would not be reliable. Someone else can notice the problem, report it, later it gets fixed, and then your exploit does not work anymore. Sorry if I'm "off the spot" but in first place your question was not very clear.
I think several of the bugs I found will never be fixed, probably can't be except by completely disallowing the syntax or major rewrites of systems(the live editing of the ast, is a feature, probably why d is fast while c++ is slow) and there is an compiler fork.
May 07
parent reply user1234 <user1234 12.de> writes:
On Wednesday, 7 May 2025 at 14:49:21 UTC, Monkyyy wrote:
 On Wednesday, 7 May 2025 at 13:32:41 UTC, user1234 wrote:
 On Monday, 5 May 2025 at 22:52:57 UTC, monkyyy wrote:
 As we all should know, the ast is modified live and the 
 compiler never deallocates. This leads to compiler bugs that 
 give glimpses behind the veil. Such ~~bugs~~ features I think 
 are actually quite valuable when the devs are overly 
 cautious, see them disallowing ct io.

 Whats the current knowledge of compiler bugs, and how to use 
 them? Anyone found any that Im unaware of?
mmmh, do you want to know if people are secretly using undocumented compiler bugs like a secret magic knowledge ? That would not be reliable. Someone else can notice the problem, report it, later it gets fixed, and then your exploit does not work anymore. Sorry if I'm "off the spot" but in first place your question was not very clear.
I think several of the bugs I found will never be fixed, probably can't be except by completely disallowing the syntax or major rewrites of systems(the live editing of the ast, is a feature, probably why d is fast while c++ is slow) and there is an compiler fork.
The "live editing of the ast" works (I assume you talk about mixin) because the front-end decomposes analysis in several phases. There are well observed limits however. Not always specified.
May 07
parent Monkyyy <crazymonkyyy gmail.com> writes:
On Wednesday, 7 May 2025 at 14:58:28 UTC, user1234 wrote
 The "live editing of the ast" works (I assume you talk about 
 mixin)
I don't mean mixin. This is from snar rants and some bugs, but a compiler textbook would want you to have stages of parsing that are pure and sane. Instead it's imparitive, and people complain about "walterisms". If you priece the veil and find a compile time side effect, it will act surprisingly sanely, and not undecidably. For reference I suggest the (T, T data) bug, when this as a template header resolves, as an int, the ast starts acting as (T int data) afterwards.
May 07
prev sibling parent monkyyy <crazymonkyyy gmail.com> writes:
On Monday, 5 May 2025 at 22:52:57 UTC, monkyyy wrote:
 As we all should know, the ast is modified live and the 
 compiler never deallocates. This leads to compiler bugs that 
 give glimpses behind the veil. Such ~~bugs~~ features I think 
 are actually quite valuable when the devs are overly cautious, 
 see them disallowing ct io.

 Whats the current knowledge of compiler bugs, and how to use 
 them? Anyone found any that Im unaware of?
New code, unlike my old aliaslist doesn't need compiler flags and I believe its should be a sane big O, should be easier to read: https://gist.github.com/crazymonkyyy/6600a4bb3937e73715093430f7dfb103
May 07