Hacker News new | ask | show | jobs
by throwA29B 143 days ago
No. You want 'for' to be a looping construct with no other meanings.

Seeing code in my native language makes me laugh, I can't take it seriously.

1 comments

I strongly disagree. Take, for example...

  foreach (apple in fruitbasket)
    apple.Eat()
vs.

  for (int i = 0; while i < fruitbasket.Count; i++)
    fruitbasket[i].Eat();
Even as a low-level programmer, I truly loathe C-style for loops. It takes several seconds to parse them, while the C#-style foreach is instantly grokkable with zero mental overhead. When you're scanning over thousands of lines of codes, the speed and ease of reading constructs like these adds up and makes a huge difference. The desire to apply human-friendly syntax to low-level programming is among the greatest motivating factors for the language I'm working on. All of that being said, I think there is a huge advantage in having code that reads like natural language you understand, rather than having keywords that are foreign and meaningless to you.
Coming soon to a programming ecosystem near you:

LLM(eat apples in fruitbasket)

vs

foreach (apple in fruitbasket) apple.Eat()

Your comment can be repeated almost word for word here.

Not at all. I'm comparing two different syntaxes that can reliably compile to the same machine code. A syntax that produces non-deterministic results is a completely different matter.
> non-deterministic

You can control the amount of non determinism.

And also, it is interesting that you think modern compilers are deterministic.

While an LLM with a fixed seed is technically deterministic, it’s still unpredictable.

> And also, it is interesting that you think modern compilers are deterministic.

A compiler, unless it has a bug, will always produce output matching the specification of the language.

> the specification of the language

Guess what language the specification is written in (if it exists at all) ?

It's usually natural language, and even then, compilers deviate from the specification all the time, and the specification has bugs.

Formal specifications are a thing, but the science is nowhere mature enough to dictate what compilers do.

> unless it has a bug

Compilers are not magic, the way it follows specifications is up to the interpretation of compiler developers like yours truly. And there are tens of thousands of compiler bugs. There was a notorious LLVM pass that had more bugs than lines of code ;)

https://github.com/llvm/llvm-project/issues?q=is%3Aissue

This is a list for just the last few years after LLVM switched to the using github for tracking issues.

Please do not engage in bad-faith arguments centered around pedantry. You know very well what I mean.
I know what you mean, and it was correct a year or more ago. Now, you are wrong.

AI is reliable enough to not mess up this translation now, especially if you configure it right (top p, and temperature parameters).

This abstraction lifting is absolutely happening in front of our eyes now. For the exact same reason the C for loop is less readable.

The different is that you don't yet store the prompts, just the generated code. That difference is not going to last too long. Storing prompts and contexts along with generated code is likely how we are going to be doing software engineering for a few decades before whatever the next leap in technology works out to be.