HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Hercuros

no profile record

comments

Hercuros
·7 месяцев назад·discuss
How do you count how many bugs a program has? If I replace the Clang code base by a program that always outputs a binary that prints hello world, how many bugs is that? Or if I replace it with a program that exits immediately?

Maybe another example is compiler optimisations: if we say that an optimising compiler is correct if it outputs the most efficient (in number of executed CPU instructions) output program for the every input program, then every optimising compiler is buggy. You can always make it less buggy by making more of the outputs correct, but you can never satisfy the specification on ALL inputs because of undecidability.
Hercuros
·9 месяцев назад·discuss
“Expression” is a bit of an overloaded word here. Carrying a swastika is considered similar to hate speech. Just like you cannot just make death threats in the U.S., even though you are just “expressing” yourself as long as you do not carry out the threat. Not saying those are exactly the same, but there are limits to expression, and spreading hate against large swathes of people is considered like that in Europe. Especially because that kind of speech can at some point turn into actual physical violence against the groups in question.
Hercuros
·10 месяцев назад·discuss
With the way things are going with climate change, I think that assuming “extreme climate events in different geographies are independent statistical events” is an extremely flawed assumption to make. You acknowledge that it is a simplified model, but that is not some minor oversight. Any model that does not account for this is deeply flawed, and I think no insurance company would choose to model extreme event risk like that. There are common factors (e.g. global average temperature) that can cause many of these events to be triggered in a correlated way.

A “2% risk of default” on an individual bond is something a retail investor might be able to understand, but no one should be buying a “diversified” bundle of these things if they cannot form a reasonable understanding of how correlated they are. Why should understanding the correlation risk be left up to individual investors building their own portfolios?

I also think forming an intuition for these more “all-or-nothing” type events is more difficult than e.g. understanding that if GOOG goes down 10% then AAPL might do too at the same time because they are both tech stocks.
Hercuros
·7 лет назад·discuss
I think that for function definitions in Rust you would in principle be able to leave out lifetime annotations on arguments/return values in more cases than is currently allowed by lifetime elision. I believe they don't allow this since it can become very confusing if the lifetimes are not written out when there are multiple references arguments. I'm not entirely sure about this, though.
Hercuros
·7 лет назад·discuss
I think there are essentially two ways of making the compiler statically aware of lifetimes: you can annotate the program with lifetimes, as in Rust, or you can have the compiler infer all of the lifetime information somehow.

Adding annotations requires more programmer effort and reduces the level of abstraction of your programming language. Rust takes this approach, but tries to keep the level of annotation somewhat reasonable, and provides the "unsafe" escape hatch for when you cannot convince the compiler that what you're doing makes sense. (Although I do believe that it would be possible for the Rust compiler to infer most/all lifetimes).

For instance, in a functional programming language, you are typically creating closures all over the place, like one of the other posters mentioned. It seems quite unlikely that there is any kind of reasonable lifetime annotation system that would capture all of the complex lifetime patterns that you would see in such a language.

One can say "Oh, but surely someone smarter than me must be able to come up with something that works for those situations", but I don't think that is a very constructive line of thought, since you could say that about pretty much everything. Rust is an example of a language where lifetimes work reasonably well, but Rust already makes some tradeoffs that reduce its level of abstraction to some degree. It doesn't provide the same level of abstraction that, say, Haskell does.

Program analysis would allow you to keep your level of abstraction and ideally not require only little annotations. However, since any non-trivial program property is undecidable, program analysis is fundamentally incomplete and it is again unlikely that it would be able to deal with all lifetime patterns that you see in practice.

Therefore, it seems to me that there is no free lunch here. Either you sacrifice abstraction by requiring annotations or you don't require any annotations but then you have an incomplete program analysis.

(Also, you seem to think 30 years of good research has been wasted on the "obviously bad idea" of garbage collection, but somehow none of these researchers were good enough to realize this and come up with the silver bullet that makes GC unnecessary? After all, people were already thinking about GC-less languages long before Rust was a thing)