News for hackers. Stuff that matters.
Re:(On | No) Syntactic Support for Error Handling by platinumrad on Tuesday June 03, 2025 @04:37PM (#44174447)
Even Rust and F#[1] don't have (generalized) do notation, what makes it remotely relevant to a decidedly non-ML-esque language like Go?

[1] Okay fine, you can fake it with enough SRTPs, but Don Syme will come and burn your house down.

Re:(On | No) Syntactic Support for Error Handling by nine_k on Tuesday June 03, 2025 @06:52PM (#44175632)
IDK, Python was fine grabbing list comprehensions from Haskell, yield and coroutines from, say, Modula-2, the walrus operator from, say, C, large swaths from Smalltalk, etc. It does not matter if the languages are related; what matters is whether you can make a feature / approach fit the rest of the language.
Re:(On | No) Syntactic Support for Error Handling by platinumrad on Wednesday June 04, 2025 @02:53AM (#44177864)
Generalized do notation as GP is proposing requires HKT. I don't think it's controversial to say that Go will not be getting HKT.
Re:(On | No) Syntactic Support for Error Handling by pjmlp on Saturday June 07, 2025 @03:22AM (#44208041)
The := is from Pascal, not C.
Re:(On | No) Syntactic Support for Error Handling by evntdrvn on Tuesday June 03, 2025 @05:44PM (#44175080)
hahaha :D
Re:(On | No) Syntactic Support for Error Handling by ablob on Wednesday June 04, 2025 @02:15AM (#44177697)
Afaik the F# supports do notation through computation expressions.
Re:(On | No) Syntactic Support for Error Handling by platinumrad on Wednesday June 04, 2025 @02:51AM (#44177854)
Like Rust, F# doesn't have higher-kinded types so it's not generalized like GP is proposing. Each type of computation expression is tied to a specific monad/applicative.