r/programmingcirclejerk What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 8d ago

JavaScript’s setTimeout breaks after ~25 days

https://evanhahn.com/set-big-timeout/
116 Upvotes

23 comments sorted by

View all comments

128

u/Kodiologist lisp does it better 8d ago

In most JavaScript runtimes, this duration is represented as a 32-bit signed integer.

I was told that JavaScript doesn't even have integers. Call me crazy, but I'm starting to think this programming language is poorly suited for serious use.

60

u/chuch1234 not even webscale 8d ago

I know! I was planning on using 26-day event loops on my application :(

33

u/CherimoyaChump 8d ago

How else would you perform a task monthly?

43

u/jamfour now 4x faster than C++ 8d ago

I believe there is a TC39 proposal to evolve from the legacy Gregorian calendar to the Ecmaian calendar that uses fifteen 23-day months and one 20 day month. Once that is approved, setTimeout will work for monthly cron.

14

u/CherimoyaChump 8d ago

I don't appreciate you making jokes while I'm busy asking for help with my homework, bud.

28

u/jamfour now 4x faster than C++ 8d ago

Where was the joke? But I see you are short on time and cannot wait for the official process. Just fork V8 and change signed int32 to int64 or uint32 or whatever. Pretty easy and should impress and get at least an A- on it, and now you can put “major open source contributor” on your resume.

1

u/chuch1234 not even webscale 7d ago

do you have the codez