www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - alternative linters

reply monkyyy <crazymonkyyy gmail.com> writes:
Writing a linter with ai failed, and possibly will never work

Every detail about dscanner screams its not made for me, and of 
course not pre-ai my answer would've been "linters are for code 
written by idiots you dont trust", post-ai my opinion is "linters 
are for code written by idiots you dont trust".

I dont know how to move forward, how to fix code made by the 
worse sort of idiot when my fuzzy nonstructural opinions on code 
are just so different from the one tool.

Ai will only get worse at mimiking my code as it trains and 
retrains on dscanner approved code, and I expect most tools to 
just assume a linter exists and auto add it to the tool chain. So 
this is non-optional.

Taste is everything here, and as far as Im concerned the only 
tool is anti-taste.
Dec 12 2025
next sibling parent reply Basile B. <b2.temp gmx.com> writes:
On Friday, 12 December 2025 at 16:03:48 UTC, monkyyy wrote:
 Writing a linter with ai failed, and possibly will never work

 Every detail about dscanner screams its not made for me, and of 
 course not pre-ai my answer would've been "linters are for code 
 written by idiots you dont trust", post-ai my opinion is 
 "linters are for code written by idiots you dont trust".

 I dont know how to move forward, how to fix code made by the 
 worse sort of idiot when my fuzzy nonstructural opinions on 
 code are just so different from the one tool.

 Ai will only get worse at mimiking my code as it trains and 
 retrains on dscanner approved code, and I expect most tools to 
 just assume a linter exists and auto add it to the tool chain. 
 So this is non-optional.

 Taste is everything here, and as far as Im concerned the only 
 tool is anti-taste.
Do linters based on AI understand side effects (strong purity) ? D-Scanner is a very simple software based on the AST. Some of the checks are maybe doing a bit of sema but that's not really a good linter.
Dec 15 2025
parent reply monkyyy <crazymonkyyy gmail.com> writes:
On Monday, 15 December 2025 at 23:40:25 UTC, Basile B. wrote:
 On Friday, 12 December 2025 at 16:03:48 UTC, monkyyy wrote:
 "linters are for code written by idiots you dont trust"
Do linters based on AI
For ai, classical computing Around a quantum chip is supercomputer and a network stack
 not really a good linter
Im not sure if I need a good linter, and i'm quite sure I wouldn't agree with people who like linters on whats good.
Dec 15 2025
parent reply Basile B. <b2.temp gmx.com> writes:
On Tuesday, 16 December 2025 at 03:28:31 UTC, monkyyy wrote:
 On Monday, 15 December 2025 at 23:40:25 UTC, Basile B. wrote:
 On Friday, 12 December 2025 at 16:03:48 UTC, monkyyy wrote:
 "linters are for code written by idiots you dont trust"
Do linters based on AI
For ai, classical computing Around a quantum chip is supercomputer and a network stack
 not really a good linter
Im not sure if I need a good linter, and i'm quite sure I wouldn't agree with people who like linters on whats good.
I think D should do what I'made for STYX, [a linting-pass](https://gitlab.com/styx-lang/styx/-/blob/master/src/styx/lin .sx?ref_type=heads) directly in the compiler and that can be **optionally** run after sema. You just add a module, new CLI args and you're good. It's really a leaf feature, i.e everything is const and pure (the AST, _the xmas pine tree_, is already "decorated"). The problem of D-Scanner and maybe of any future potential AI solution is that it's based on a single module. Things like "unused import checks" are not possible. When you analize the quality with a compiler pass you suddently have the "project scope". That's a game changer.
Dec 16 2025
next sibling parent reply Serg Gini <kornburn yandex.ru> writes:
On Tuesday, 16 December 2025 at 15:05:54 UTC, Basile B. wrote:
 I think D should do what I'made for STYX, [a 
 linting-pass](https://gitlab.com/styx-lang/styx/-/blob/master/src/styx/lin
.sx?ref_type=heads) directly in the compiler and that can be **optionally** run
after sema.
I think this is the joy of "developing new language" - when you can implement these things into compiler from the beginning. For languages which were not initially designed for this feature - it is quite hard to incorporate it afterwards
Dec 16 2025
parent reply Basile B. <b2.temp gmx.com> writes:
On Tuesday, 16 December 2025 at 15:33:33 UTC, Serg Gini wrote:
 On Tuesday, 16 December 2025 at 15:05:54 UTC, Basile B. wrote:
 I think D should do what I'made for STYX, [a 
 linting-pass](https://gitlab.com/styx-lang/styx/-/blob/master/src/styx/lin
.sx?ref_type=heads) directly in the compiler and that can be **optionally** run
after sema.
I think this is the joy of "developing new language" - when you can implement these things into compiler from the beginning. For languages which were not initially designed for this feature - it is quite hard to incorporate it afterwards
This is partially right (let's stay positive ;) ). The thruth is that Styx followed the D philosophy about warnings, i.e "that's either good or an error". What happened then, way much later than the first self-hosting, is what I've described before. Linting can be a leaf feature. You can do the same in the D front-end. I'm really serious. One or two weeks a pull request with 2 or 3 modules.
Dec 16 2025
parent Basile B. <b2.temp gmx.com> writes:
On Tuesday, 16 December 2025 at 15:41:35 UTC, Basile B. wrote:
 On Tuesday, 16 December 2025 at 15:33:33 UTC, Serg Gini wrote:
 [...]
This is partially right (let's stay positive ;) ). The thruth is that Styx followed the D philosophy about warnings, i.e "that's either good or an error". What happened then, way much later than the first self-hosting, is what I've described before. Linting can be a leaf feature. You can do the same in the D front-end. I'm really serious. One or two weeks a pull request with 2 or 3 modules.
Whoops, 2 or 3 checks in a new **module**
Dec 16 2025
prev sibling parent reply monkyyy <crazymonkyyy gmail.com> writes:
On Tuesday, 16 December 2025 at 15:05:54 UTC, Basile B. wrote:
 Im not sure if I need a good linter, and i'm quite sure I 
 wouldn't agree with people who like linters on whats good.
I think D should do what I'made for STYX, [a It's really a leaf feature, Things like "unused import checks" are not possible.
I think your getting even futher away from understanding https://raw.githubusercontent.com/crazymonkyyy/lintyyy/refs/heads/master/SPEC.md Im quite unsure what your ai usage theory is here, but they are reading and writing code syntaxically not semantically, and despite this I dont see many "semantic" errors, is all logical errors.
Dec 16 2025
parent Basile B. <b2.temp gmx.com> writes:
On Tuesday, 16 December 2025 at 16:24:04 UTC, monkyyy wrote:
 On Tuesday, 16 December 2025 at 15:05:54 UTC, Basile B. wrote:
 Im not sure if I need a good linter, and i'm quite sure I 
 wouldn't agree with people who like linters on whats good.
I think D should do what I'made for STYX, [a It's really a leaf feature, Things like "unused import checks" are not possible.
I think your getting even futher away from understanding https://raw.githubusercontent.com/crazymonkyyy/lintyyy/refs/heads/master/SPEC.md Im quite unsure what your ai usage theory is here, but they are reading and writing code syntaxically not semantically, and despite this I dont see many "semantic" errors, is all logical errors.
The idea, to rephrase a bit, is the cross relations between modules, the "xrefs", let's say. It will be very hard to understand, for an AI, to get eponymous template instances. All the information are there, right before the middle-end pass, just plug a few linters "sub-programs" right there.
Dec 16 2025
prev sibling parent monkyyy <crazymonkyyy gmail.com> writes:
On Friday, 12 December 2025 at 16:03:48 UTC, monkyyy wrote:

Currently ai's edit text via an ed like json editer
this is insane and everyone knows it; they do this to prevent 
hullinations and blah blah blah and ai's cant "see" or be 
embodied at all

What if I try to appooch my goals here via a new "text editor" 
for ai?
Dec 16 2025