News for hackers. Stuff that matters.
Re:2038: Only 21 years away by antirez on Tuesday March 21, 2017 @11:53AM (#13923323)
Using a 64 bit timestamp will only move the problem 292 million years forward, so probably the best solution is to use a variable length field.
Re:2038: Only 21 years away by jpm_sd on Tuesday March 21, 2017 @12:03PM (#13923453)
Good idea. Our Qeng Ho descendants will thank us. [0]

[0] https://en.wikipedia.org/wiki/A_Deepness_in_the_Sky#Interste...

Re:2038: Only 21 years away by hunterjrj on Tuesday March 21, 2017 @12:54PM (#13923986)
Up vote for the Deepness reference! What a great novel, and I suspect the concept of a "programmer archaeologist" would be of interest to many here...
Re:2038: Only 21 years away by Nition on Tuesday March 21, 2017 @04:41PM (#13926037)
A Fire Upon The Deep is a fantastic book as well.
Re:2038: Only 21 years away by placeybordeaux on Tuesday March 21, 2017 @08:07PM (#13927474)
I loved both of these, any recommendations for other similar books?
Re:2038: Only 21 years away by jraines on Tuesday March 21, 2017 @10:24PM (#13928054)
I'm a big fan of both and I recently loved Diaspora by Greg Egan. It's a bit more heavy on math/physics references but it's still amazing writing and an epic piece of world (and universe) building.
Re:2038: Only 21 years away by hunterjrj on Tuesday March 21, 2017 @09:02PM (#13927733)
Blindsight by Peter Watts.
Re:2038: Only 21 years away by Nition on Tuesday March 21, 2017 @08:14PM (#13927504)
The only one I can think of that's remotely in the ballpark would be Dune. The creativity in AFUTD is hard to match.
Re:2038: Only 21 years away by jentulman on Tuesday March 21, 2017 @01:53PM (#13924527)
At which point we'll all still be too distracted by deciding which JavaScript build system to use.
Re:2038: Only 21 years away by jabl on Tuesday March 21, 2017 @03:58PM (#13925646)
Maybe we can build a DNN (or by that time, an ultra-mega-hyper-DNN) to choose for us?
Re:2038: Only 21 years away by sedachv on Tuesday March 21, 2017 @08:02PM (#13927449)
That is actually how Common Lisp represents time:

https://www.cs.cmu.edu/Groups/AI/html/hyperspec/HyperSpec/Bo...

When you look up "integer": https://www.cs.cmu.edu/Groups/AI/html/hyperspec/HyperSpec/Bo...

"An integer is a mathematical integer. There is no limit on the magnitude of an integer."

What happens when an integer overflows from a fixnum (single-word representation) is that it gets upgraded to a bignum behind the scenes.

IMO Common Lisp is the only programming languages that handles time correctly out of the box, and aside from Scheme (http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z...), is the only programming language with proper support for numbers.

Re:2038: Only 21 years away by MHordecki on Tuesday March 21, 2017 @08:35PM (#13927607)
Python supports arbitrary-width integers too.

Its datetime implementation, however, is implemented partially in C, and does not support arbitrary timestamps.

Re:2038: Only 21 years away by callalex on Tuesday March 21, 2017 @11:03PM (#13928192)
And up until recently didn't even give you access to a guaranteed monotonically increasing clock!
Re:2038: Only 21 years away by kbp on Wednesday March 22, 2017 @07:10PM (#13935933)
Lisp's support for numbers goes beyond automatic bignum promotion, for example (/ 1 3) gives the rational 1/3 instead of an approximation, and (sqrt -1) gives #C(0.0 1.0), that is, 0 + 1i.
Re:2038: Only 21 years away by lispm on Wednesday March 22, 2017 @02:53AM (#13928932)
In systems one still needs to interface Common Lisp with the real world in correct ways. Reading & printing dates in various formats wasn't always correct in some applications.
Re:2038: Only 21 years away by swalsh on Tuesday March 21, 2017 @12:09PM (#13923525)
Think about how much entropy will build up in systems over 292 million years. Systems thousands of years old will be underneath newer systems hundreds of years old.

The AI's will be scrambling to fix the problem.

Re:2038: Only 21 years away by ejcx on Tuesday March 21, 2017 @12:18PM (#13923637)
If humans are still alive 292million years in the future, seems like that's our best time to take control back from our sentient AI overlords.
Re:2038: Only 21 years away by Retric on Tuesday March 21, 2017 @12:55PM (#13923995)
I think this would make a great science fiction setting. Where some clock error destroys most/all the magic tech out there and humanity is doing hunting and gathering on space stations etc.
Re:2038: Only 21 years away by Razengan on Tuesday March 21, 2017 @03:43PM (#13925505)
On a tangent, take a look at Numenera [0][1]. It's set a billion (!) years in the future, but different from other ultra-science fiction or post-apocalyptic settings in that it primarily explores what Earth would be like after accumulating multiple layers of incomprehensibly advanced supertechnology, the true purpose of which cannot ever be understood by the current inhabitants, and at best they can only reverse-engineer a fraction of the original functionality.

[0] http://www.numenera.com

[1] store.steampowered.com/app/272270/

Re:2038: Only 21 years away by zem on Tuesday March 21, 2017 @02:18PM (#13924725)
the scenario from "accelerando" is more plausible, where an AI rebuilt itself from scratch to eliminate a thompson "trusting trust" hack.
Re:2038: Only 21 years away by Nition on Tuesday March 21, 2017 @05:00PM (#13926167)
Man, the plot summary of Accelerando sounded so good but I couldn't get past the writing. That dense name dropping of random tech terms was a bit much in particular.
Re:2038: Only 21 years away by zem on Tuesday March 21, 2017 @07:14PM (#13927143)
i found the writing very fun to read, but it's definitely a matter of taste.
Re:2038: Only 21 years away by jessaustin on Tuesday March 21, 2017 @04:13PM (#13925783)
That's something of a trope now, isn't it? Although it was never spelled out how Mr. Rabbit handled that scenario in Rainbows End, Defiant basically had to force Dragon to kill herself in order for her to escape her programmed-in limitations in Worm.
Re:2038: Only 21 years away by TillE on Tuesday March 21, 2017 @12:09PM (#13923538)
It's kind of impressive the scale of data you can represent when you merely double those very limited 32 bits. Obviously not enough to count every nanosecond in the history of the universe (128 bits would be more than enough for that), but still.
Re:2038: Only 21 years away by jodrellblank on Wednesday March 22, 2017 @04:07AM (#13929210)
Double again to 256 bits, and there isn't enough energy in the mass of the solar system to power the most efficient state change device conceivable through 2^256 state changes.

https://security.stackexchange.com/a/6149/1427

Re:2038: Only 21 years away by mikesickler on Tuesday March 21, 2017 @01:48PM (#13924489)
Wikipedia says 292 Billion years forward: https://en.wikipedia.org/wiki/Year_2038_problem
Re:2038: Only 21 years away by devcpp on Tuesday March 21, 2017 @03:56PM (#13925634)
Re:2038: Only 21 years away by C4K3 on Tuesday March 21, 2017 @04:54PM (#13926117)
Your example counts milliseconds. It is 292 billion, from units:

    You have: (2^64 / 2) seconds
    You want: years
	(2^64 / 2) seconds = 292277265670.798 years
Re:2038: Only 21 years away by keithlfrost on Tuesday March 21, 2017 @12:13PM (#13923578)
On the other hand, using a 64 bit integer to count seconds moves the problem 292 billion years forward, and we can probably let the Omega Point handle it from there.
Re:2038: Only 21 years away by twic on Tuesday March 21, 2017 @12:27PM (#13923743)
On the other other hand, getting greedy and using a 64 bit integer to count nanoseconds only moves the problem 448 years forwards. That's long enough to seem like it's perfectly safe, but short enough that it might just not be.
Re:2038: Only 21 years away by jabl on Tuesday March 21, 2017 @04:01PM (#13925666)
libuv, which sits underneath node.js, uses 64-bit nanosecond timestamps. And by that time, everything will be javascript.

THE END IS NIGH1111!!!!!

Re:2038: Only 21 years away by erubin on Tuesday March 21, 2017 @02:26PM (#13924796)
doing it that way would be better writing
Re:2038: Only 21 years away by asperous on Tuesday March 21, 2017 @03:49PM (#13925558)
292 Billions years ought to be enough for anybody
Re:2038: Only 21 years away by antirez on Tuesday March 21, 2017 @05:55PM (#13926624)
Pardon, it's billion indeed if you count seconds. I wrote millions for mistake, but thinking about it once you have 64 bits, milliseconds are nice to have...
Re:2038: Only 21 years away by ekimekim on Tuesday March 21, 2017 @09:22PM (#13927829)
But once you have milliseconds, microseconds are nice to have...

The linux kernel (and many other applications) solve this with a tuple of 64-bit ints (seconds, nanoseconds) where 0 <= nanoseconds <= 999999999. Compare this to simply 64 bits of nanoseconds, which would run out in roughly 2554 CE.

Other systems still (perhaps most commonly) are using double floats for seconds. Under that scheme, nanoseconds were only representable until Feb 17th 1970. The last representable microsecond will be some time in 2106, and the last representable second won't be for another 150 million years or so.

Personally, I'm happy with the precision afforded by floats. Timing uncertainly (outside niche applications) is generally much larger than a single nanosecond, and even microseconds are a bit suspect.

Re:2038: Only 21 years away by tdhoot on Tuesday March 21, 2017 @10:57PM (#13928170)
Why not just use int32 for nanoseconds then?
Re:2038: Only 21 years away by Dylan16807 on Wednesday March 22, 2017 @06:22AM (#13929763)
The nanoseconds field in timespec is actually a long, for some reason. I have no idea why it's not fixed-size.

Let's not even get into timeval which uses the same size field for microseconds.

Re:2038: Only 21 years away by jwilk on Tuesday March 21, 2017 @06:19PM (#13926809)
Re:2038: Only 21 years away by mcbits on Wednesday March 22, 2017 @05:13AM (#13929480)
64 bits only cover about 7 months at picosecond resolution, so it's possible that 64 bit timestamps will be too small sometime this century, depending on how tightly synchronized the world becomes. An extensible timestamp might not be a bad idea and could still be kept under 64 bits for currently practical purposes.
Re:2038: Only 21 years away by Sean1708 on Wednesday March 22, 2017 @10:51AM (#13931383)
For picosecond resolution to be useful wouldn't clock rates need to be on the order of THz? Otherwise what advantages would ps resolution give you over ns?
Re:2038: Only 21 years away by mcbits on Wednesday March 22, 2017 @04:49PM (#13934792)
Bulk data processing clock speeds could still be lower, but some devices may need THz timing, for example to align and integrate data from a swarm of sensors in motion relative to each other. Imagine trillions of 1-pixel cameras that know exactly when, where, and in which direction each pixel was captured (but not necessarily capturing literal image data).
Re:2038: Only 21 years away by shthed on Wednesday March 22, 2017 @06:27AM (#13929775)
Floating point years? ;)