This is probably just continued post-COVID demand normalization. Basically all software and gaming got a massive bump that was obviously going to have an unsustainable component to it. But in many cases companies planned like it was totally sustainable and would continue. That’s why even super profitable companies like Microsoft and Epic are doing layoffs in 2023. The other reason of course is that they went a bit cr…
fun sieve(n: Long) = (2L until n).fold((2L until n).toMutableList()){p,i->p.apply{for(j in i * 2 until n step i)this[(j-2).toInt()]=0}}.filter{it!= 0L}
and it works OK in some situations:
>>> sieve(100L)
res5: kotlin.collections.List = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]
Let's try another test input -
>>> sieve(10000000L)
java.lang.OutOfMemoryError: Java heap space
Oops.
Also if the 12th-20th most popular language (Kotlin) being too obscure is the reason, how will they fare currently except with the most popular languages?
This is about as simple as a function as you can get. 95% of my programming work is standups, sprint planning and grooming, looking at Swagger or other API backend documentation for information, looking through Outlook, Teams and Confluence for information about my story, looking for UI on Figma, contacting various teams for more information - then someone wants me to review their pull request and stop to do that - but notice they have some business logic wrong because they don't fully understand the domain. Yet even something simple like a function generating a list of prime numbers, ChatGPT struggles with.
Not that it can't get better, but it's no threat to most programmers I know in the short term (and if it becomes one, I'll shift over to writing Python scripts that call Pytorch, numpy etc. - I already do so in my spare time).