Re:A function decorator that rewrites the bytecode to enable...
by selcuka on Monday September 20, 2021 @09:48PM
(#28601215)
The name of the language should have given it away.
Re:A function decorator that rewrites the bytecode to enable...
by robertlagrant on Tuesday September 21, 2021 @12:57AM
(#28602157)
Hopefully Go 2 won't have Goto
Re:A function decorator that rewrites the bytecode to enable...
by umanwizard on Monday September 20, 2021 @09:46PM
(#28601204)
Why does it go against the Go ethos? (Asking out of curiosity. I’ve never used the language.)
Re:A function decorator that rewrites the bytecode to enable...
by ladberg on Monday September 20, 2021 @09:59PM
(#28601274)
I feel like they usually prioritize simplicity and readability instead of tricks, syntactic sugar, and one-liners.
For example there's no ternary operator. Instead you'll have to write out a few lines of if/else. There's no function overloading or operator overloading, no built in min/max, and currently no generics (though they're being added).
They definitely try to keep the number of keywords down to a minimum compared to languages like Swift where you could write the same business logic in fewer lines using stuff like try, guard, !, and ?.
Re:A function decorator that rewrites the bytecode to enable...
by withinboredom on Tuesday September 21, 2021 @05:35AM
(#28603372)
An if-statement is essentially sugar for conditional jump which is sugar for compare then jump. Goto is a jump. It’s all sugar.
If you had asked me a few minutes ago if Go had goto I would have said "definitely not and they would never add it because it goes against the Go ethos".