489 karma · joined Jul 9, 2007 (19y ago) · 207 submissions
comment 7y ago · link · parent
One day is more than one revolution of the planet. The sidereal day is exactly one rotation of the planet, but that's about four minutes shorter than a civil day.
The reason is that the planet also moves around the sun, so in order to get the sun to the same position in the sky for noon the planet needs to turn a little bit more than 360 degrees, about 360/365 extra.
comment 7y ago · link · parent
https://www.lenovo.com/us/en/laptops/thinkpad/thinkpad-x/Thi...
comment 7y ago · link · parent
Been a big fan of the thinkpads for 20 years. All of them very solid machines that just last and last, and never had a problem with running Linux on them
comment 7y ago · link · parent
comment 7y ago · link · parent
comment 7y ago · link · parent
comment 7y ago · link · parent
I really wanted to show that core part of a programming language can be quite simple and nothing to be afraid of so everything else was subservient to getting that across :-)
comment 7y ago · link · parent
I expect we'll extend use of this sort of mechanism much further the more people understand it.
I'll watch that video, sounds interesting. A company I worked for nearly ended up getting a Symbolics LISP machine for CGI in the early 90s. Would have been pretty sweet I think.
48.
127 points · by KayEss · 7y ago · 68 comments
comment 7y ago · link · parent
Adding a garbage collector would make code more complex, not simpler, as it would break RAII. I spend a lot more time dealing with memory and resource allocation issues in GC languages than I do in C++.
In languages like Python we have to use `with`, and this is harder to use in the client code, and the class is much harder to write, than anything in C++ where we just add a destructor to clean up.
std::vector<char> data(10 << 20);
std::ifstream("/dev/urandom", std::ios::binary).read(data.data(), data.size());
The above code can never leak (either memory or file handles) under any circumstances and the implementations of the types involved push zero overhead/boilerplate on me as a user of them.I think if you want to reduce complexity of C the place that everybody else is looking is at how to allow opting in and out of legacy support.
comment 8y ago · link · parent
comment 8y ago · link · parent
comment 8y ago · link · parent
This is exactly what the report says they did. The original post may exist on Twitter, but the conversation that happened on Facebook does not.
I just checked my feed, and my Twitter posts do seem to still be on my FB profile, at least when I look at it.
comment 8y ago · link · parent
It's really incomplete, and I have had hardly any time to work on it over the many years that it's been around, but the general idea is to type construction to determine the aspects that a scene actually uses and let the compiler sort out what to do about it.
For example, the depth count attached to a ray doesn't appear until it hits a reflective surface so there is no overhead if the scene doesn't need it. As you can probably imagine the template errors can be obscene :)
The next thing would be to constexpr everything so that the scene could be built up in the compiler, I guess ideally in parts and then combined by the linker. I think it'll be really fun to try that with this Moana scene, but don't expect the compilers or linkers will survive let alone the tracer
EDIT to say, I really love your book. I feel hugely inspired every time I look at it, which unfortunately means I can't look too often as I don't have the time to play with these things as much as I'd like.
comment 8y ago · link · parent
Personally I'm OK with the more aggressive optimisations, but they are still very controversial -- I think more so in the C than the C++ community (I'm in the C++ one).