News for hackers. Stuff that matters.
Re:(On | No) Syntactic Support for Error Handling by munificent on Wednesday June 04, 2025 @07:02PM (#44186518)
> you can automatically box your references

Yes, but that is now a different runtime cost which Go also didn't want to pay.

The language goes to great pains to give you pretty good control over layout in memory and avoid the "spray of tiny objects on the heap with pointers between them" that you get in Java and most other managed languages.

I think Swift maybe does something more clever with witness tables, but I don't recally exactly how it works.

It's not an easy problem.

Re:(On | No) Syntactic Support for Error Handling by mananaysiempre on Friday June 06, 2025 @08:57AM (#44200383)
> I think Swift maybe does something more clever with witness tables, but I don't recally exactly how it works.

Pestov actually wrote a long explanation of what it is that Swift does there[1,2]. And I’m almost sure you’ve already seen it, but it’s been on my reading list forever and I’m hoping that maybe if I can’t get myself to read it, than somebody else will see this comment, get interested and do it.

[1] http://download.swift.org/docs/assets/generics.pdf

[2] https://github.com/apple/swift/tree/main/docs/Generics

Re:(On | No) Syntactic Support for Error Handling by munificent on Sunday June 08, 2025 @08:06PM (#44220297)
Yeah, I've had that PDF sitting on my hard drive for years. I'm definitely interested but it's 600 pages.