@tagir_valeev 3/ Listened lately to an interview with Linus Torvalds. He hopes AI may help on finding bugs, more code-qualitity things, support refactoring , ... But no short term expectations.
@tagir_valeev 2/ while developing complex enterprise-grade software which we will have to maintain in much cases for at least one or two decades. Maybe it helps less experienced devs a bit more. (As long as they critically evaluate things thrown out by GenAI and/or someone does good reviews.)
@tagir_valeev From my perspective (senior / "dinosaur" dev with >25 year dev experience working on software for public administration) AI is - even knowing it will have massive influence on our world within the next one or two decades - overhyped when we expect massive productivity-gains 1/
*** The AI challenge ***
Some people say today that AI writes 10%, 30%, 50%, or even 80% of code for them today. I'm not even close to these numbers. It probably makes my coding faster by 1-2% but no more. However, it's possible that I use AI in the wrong way, or your AI coding assistant tool is better than mine.
So, here's a challenge. We have a function in IntelliJ IDEA Community Edition, UNeDfaValueEvaluator.BuilderEvaluator#calculateBuilder. Here it is:
https://t.co/hGmzovM30C
Note: take exactly this revision, not a newer one, as I may solve it by myself in the future.
The problem: the function is recursive and sometimes eats a lot of stack. In particular, there's a test UStringEvaluatorWithSideEffectsTest#test many appends which eats more than 1000 frames. As a result, it occasionally fails with StackOverflowError. Here's the link to the test:
https://t.co/D8YYIuvXFv
The task: make your AI coding tool, whatever it is, to rewrite the calculateBuilder function to a semantically equivalent one, which uses much less stack (at least 2x less) for the same test many appends test. Ideally, make it non-recursive completely, but making it 'less recursive' also counts. You may guide your tool with a series of prompts or fix small mistakes by yourself, but the problem should be essentially solved by AI, not by you. Also, you should not edit the test, or anything outside the BuilderEvaluator class. If you need to declare additional functions or data structures, feel free to declare them inside the class or even inside the original function.
An additional hint: the stacktrace during the StackOverflowError looks like this:
...
at calculateBuilder(UNeDfaValueEvaluator.kt:364)
at calculateBuilder(UNeDfaValueEvaluator.kt:302)
at calculateBuilder(UNeDfaValueEvaluator.kt:364)
at calculateBuilder(UNeDfaValueEvaluator.kt:374)
at calculateBuilder(UNeDfaValueEvaluator.kt:302)
at calculateBuilder(UNeDfaValueEvaluator.kt:364)
at calculateBuilder(UNeDfaValueEvaluator.kt:302)
at calculateBuilder(UNeDfaValueEvaluator.kt:364)
at calculateBuilder(UNeDfaValueEvaluator.kt:374)
at calculateBuilder(UNeDfaValueEvaluator.kt:302)
...
You and your tool may use this information if you find it helpful.
I find this task pretty suitable for AI. It's well formulated and short. It does not require the deep knowledge of the project. You don't need to understand anything outside of this source file (aside from common Kotlin knowledge), so it will easily fit into any context window. I think you may even skip importing the whole project and simply feed one file to your tool. On the other hand, it's not a common 'Yet another TODO list app' sample which is usually used to promote AI. It's a real task from real enterprise development.
My AI tool was not able to solve it. It generated the compilable code, but it was not nearly equivalent. Probably I haven't tried enough or I used wrong prompts, so you might be more lucky.
To test your solution, you may run other tests inside UStringEvaluatorWithSideEffectsTest, as they cover this method more or less well. Alternatively, you can post your solution (as a gist or whatever) in the comments, and I will run tests for you.
I think this might be an interesting AI experiment. Please repost if you agree with me.
1/ ich werde nie verstehen, warum viele #deutsche ein romantisches #russland-bild pflegen: der staat ist nicht nur kolonial, gewalttätig und autoritär regiert, sondern in weiten teilen ein armenhaus mit rückständigsten lebensbedingungen. ein thread mit einigen fakten.
A long personal thread..hopefully useful for some you. The past 16 days I have learned more about discs than I ever planned to learn, but may be should have done sooner..Not computer discs, but the ones in my spine. But let me start at the beginning for some context.
In der ZIB2 bei @MartinThuer habe ich zu erklären versucht, wie ein soziales & wirtschaftliches Desaster verhindert werden kann. Die Materie ist komplex. Deshalb ist mir die Langfassung des Gesprächs wichtig. Hier: https://t.co/ohsN1dEv02
@OmniFaces Yep. You only have to look what Spring (Boot) does. DI as core used everywhere. Central, environment-aware configuration as core concept. (But please don't forget some people combine JavaEE/JakartaEE-Tech with Spring.)
@pivotal - Is it possible to support https://t.co/QzrtiSGXMQ as (some kind of) part of Spring? @RestController misses OpenAPI-support. OpenAPI is really important for professional RestAPIs.