frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

MacPaint Art from the Mid-80s Still Looks Great Today

https://blog.decryption.net.au/posts/macpaint.html
308•decryption•5h ago•61 comments

The fish kick may be the fastest subsurface swim stroke yet (2015)

https://nautil.us/is-this-new-swim-stroke-the-fastest-yet-235511/
37•bookofjoe•1h ago•14 comments

OpenAI’s Windsurf deal is off, and Windsurf’s CEO is going to Google

https://www.theverge.com/openai/705999/google-windsurf-ceo-openai
769•rcchen•16h ago•497 comments

Malware found in official gravityforms plugin indicating supply chain breach

https://patchstack.com/articles/critical-malware-found-in-gravityforms-official-plugin-site/
95•taubek•7h ago•17 comments

ETH Zurich and EPFL to release a LLM developed on public infrastructure

https://ethz.ch/en/news-and-events/eth-news/news/2025/07/a-language-model-built-for-the-public-good.html
527•andy99•19h ago•80 comments

First malaria treatment for babies approved for use

https://www.bbc.com/news/articles/c89e872jdjxo
55•toomuchtodo•3d ago•13 comments

Faking a JPEG

https://www.ty-penguin.org.uk/~auj/blog/2025/03/25/fake-jpeg/
280•todsacerdoti•15h ago•62 comments

Preliminary report into Air India crash released

https://www.bbc.co.uk/news/live/cx20p2x9093t
309•cjr•17h ago•557 comments

Only on Nantucket: The Curious Case of the "Stolen" Mercedes

https://nantucketcurrent.com/news/only-on-nantucket-the-curious-case-of-the
12•brigham•2d ago•9 comments

Sieve (YC X25) is hiring researchers to build large video datasets for AI labs

https://sievedata.com/about/jobs
1•mvoodarla•2h ago

New Date("wtf") – How well do you know JavaScript's Date class?

https://jsdate.wtf
150•OuterVale•5h ago•71 comments

Upgrading an M4 Pro Mac mini's storage for half the price

https://www.jeffgeerling.com/blog/2025/upgrading-m4-pro-mac-minis-storage-half-price
381•speckx•1d ago•239 comments

Fundamentals of garbage collection (2023)

https://learn.microsoft.com/en-us/dotnet/standard/garbage-collection/fundamentals
77•b-man•3d ago•21 comments

jank is C++

https://jank-lang.org/blog/2025-07-11-jank-is-cpp/
255•Jeaye•20h ago•84 comments

Replication of Quantum Factorisation Records with an 8-bit Home Computer [pdf]

https://eprint.iacr.org/2025/1237.pdf
96•sebgan•12h ago•11 comments

Bill Atkinson's psychedelic user interface

https://patternproject.substack.com/p/from-the-mac-to-the-mystical-bill
430•cainxinth•1d ago•260 comments

Maine police caught lying about using AI to alter drug bust photo

https://boingboing.net/2025/07/02/maine-police-caught-lying-about-using-ai-to-alter-drug-bust-photo.html
10•montroser•52m ago•0 comments

ICANN fumes as AFRINIC offers no explanation for annulled election

https://www.theregister.com/2025/07/11/afrinic_election_annulled_why/
84•rntn•3h ago•12 comments

Leveraging Elixir's hot code loading capabilities to modularize a monolithic app

https://lucassifoni.info/blog/leveraging-hot-code-loading-for-fun-and-profit/
78•ronxjansen•4d ago•9 comments

Andrew Ng: Building Faster with AI [video]

https://www.youtube.com/watch?v=RNJCfif1dPY
242•sandslash•2d ago•59 comments

Dict Unpacking in Python

https://github.com/asottile/dict-unpacking-at-home
104•_ZeD_•3d ago•38 comments

Increasing the Fidelity of Qubit Operations

https://www.nature.com/articles/s41467-025-61126-0
3•zahirbmirza•3d ago•0 comments

Incus – Next-generation system container, application container, and VM manager

https://linuxcontainers.org/incus/
43•motorest•9h ago•22 comments

Reverse proxy deep dive

https://medium.com/@mitendra_mahto/cross-posted-from-https-startwithawhy-com-reverseproxy-2024-01-15-reverseproxy-deep-dive-html-c3443dc3e0e5
43•miggy•4d ago•10 comments

OpenAI delays launch of open-weight model

https://twitter.com/sama/status/1943837550369812814
172•martinald•12h ago•123 comments

Repasting a MacBook

https://christianselig.com/2025/07/repaste-macbook/
230•speckx•1d ago•115 comments

Show HN: I built a toy music controller for my 5yo with a coding agent

https://github.com/jeffmccune/sonoserve
22•JeffMcCune•3d ago•8 comments

A software conference that advocates for quality

https://bettersoftwareconference.com/
114•leoncaet•16h ago•99 comments

Rice rebels: Research reveals grain's brewing benefits

https://phys.org/news/2025-06-rice-rebels-reveals-grain-brewing.html
22•PaulHoule•2d ago•6 comments

Commodore 64 Ultimate

https://www.commodore.net
4•peterkelly•4h ago•2 comments
Open in hackernews

New Date("wtf") – How well do you know JavaScript's Date class?

https://jsdate.wtf
150•OuterVale•5h ago

Comments

schoen•4h ago
Lots of surprises here! The general theme seems to be that the parser is very eager to find some interpretation of the input as a date, even in ways that appear pretty unprincipled, even in circumstances where human users would probably not agree with the interpretation, and even though it does have ways that it could signal errors. Though maybe some of the weird cases actually do trace back to unusual real-world use cases!
2muchcoffeeman•1h ago
The problem is that you couldn’t start to guess all of these. It’s just random noise. Strings 32-49 are in the 2000s but 50 onwards are in the 1900.

Burn it and start again.

spiffytech•48m ago
> Burn it and start again

Good news! The builtin Temporal API is on its way. It's widely regarded as a solid API, learning from some of the best time APIs in other languages.

In terms of parsing, it looks like Temporal only accepts RFC 9557 strings (an extension of ISO 8601 / RFC 3339). Anything else throws an exception.

4ndrewl•4h ago
Related: https://www.destroyallsoftware.com/talks/wat
leipert•4h ago
10/28. Not bad. But probably also is implementation dependent: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
samwho•4h ago
It very much is. I put the lil notice at the start that I verified the questions on a specific version of Node, with a specific timezone, because both things matter.
zinekeller•3h ago
Some notes that I have noticed. First, why does it seem that the V8 date parser is heavily inspired by the Windows date parser (https://devblogs.microsoft.com/oldnewthing/20200304-00/?p=10...)? EDIT: Apparently not, "new Date('Savvyday 29 Oatmeal 94')" is invalid both in Firefox and Chrome.

Second, I opened this in Firefox with the console open to answer these questions, and found these divergences (to summarize, Firefox is strict):

Question 14:

  new Date("12.1")
> "12.1" is interpreted as the date December 1st, and as before for dates with no year the default is 2001 because of course.

Firefox returns an Invalid Date object instead.

Question 16:

  new Date("12.-1")
> The dash here is ignored, so this is interpreted the same as "12.1".

Again, Firefox returns an Invalid Date object instead.

Question 19:

  new Date("maybe 1")
> "may" in "maybe" is parsed as the month May! And for some reason this expression cares about your local timezone, which happens to be BST for me right now.

Seems a broken record, but this is still an Invalid Date for Firefox.

Question 20:

  new Date("fourth of may 2010")
> "fourth of" is ignored, this is just parsing "may 2010" and again local timezone is important.

Ibid in Firefox.

Question 21:

  new Date("May 4 UTC")
> UTC is correctly parsed as a timezone.

No, Firefox is still not accepting this one.

Question 22:

  new Date("May 4 UTC+1")
> You can add modifiers to timezones and it works as you would expect.

Neither this one.

Question 23:

  new Date("May 4 UTC+1:59")
> It also supports minutes!

Firefox: Not really.

Final note: It parses Question 24 as you expect in Firefox. Which honestly, it shouldn't!

samwho•3h ago
Yeah, as I understand it this isn’t backed by any spec. I decided to go with Node’s (v8’s) implementation for the quiz. Fun to see how much divergence there is!
mnahkies•3h ago
It's probably improved the past 8 years or so, but I remember Safari was particularly bad for bugs around DST and just dates in general back then, even when using valid input.

We ended up with a bunch of Safari specific workarounds that weren't necessary on Chrome (it was mostly a webview use case so Safari and Chrome were the two we cared about at the time)

Assumingly to me this was around the same time that Apple seemed to have DST problems more generally, such as their iOS alarm clock mishap https://www.theguardian.com/technology/blog/2010/nov/01/ipho...

JdeBP•2h ago
A quick test of Vivaldi with some of those shows it nowhere near as strict as your Firefox is. Amusingly

    new Date("2025-07-12 12:30:45 BST")
is an invalid date, whereas all three of

    new Date("2025-07-12 12:30:45 GMT")
    new Date("2025-07-12 12:30:45 UTC")
    new Date("2025-07-12 12:30:45 Z")
are valid but in British Summer Time.
mcv•3h ago
I'm not sure if I should be pleased or embarrassed about my 17/28. Why do I even know this?

My son was pretty happy with his 11/28 without any experience with js Date. Just deduced it from previous answers. And I explained type coercion to him.

I now realize I may have put him off a career in IT.

croes•4h ago
Why?
samwho•4h ago
I discovered the 0/“0” disparity in work this week for the first time. Then I tried “1” and “2” and knew there was fun to be had. :)
worble•4h ago
So... any browser other than Firefox feel like shipping Temporal yet?
bubblebeard•4h ago
Haha that was fun :D

Thanks!

torlok•4h ago
Always fun to click through JS quizzes for the laughs. I've been programming JS since over a decade, and I never dared to use Date to parse anything I didn't verify with a regex.
1oooqooq•10m ago
so true.

i coded security js code for a decade. right when the standard started to get the many updates.

our system was just a really tiny subset of things you could use that worked safely (and predictably) across browsers. even after the updates, we only incorporated was array.filter and structuredcopy. everything else offered no real benefit and only added to the attack surface.

and then came typescript. the biggest missed opportunity in js history.

even today, good js is knowing you can only use 1% of the language, and even that with lot of care

KaiMagnus•4h ago
12/28, could've gotten a few more by thinking harder, but I was getting so annoyed that I didn't want to, great job!
bsmth•3h ago
Post by the author Sam Rose about it: https://bsky.app/profile/samwho.dev/post/3ltpdkr3bmk2o
samwho•3h ago
It me.
bsmth•3h ago
Oh hi! Thanks for the great quiz
samwho•2h ago
You’re welcome!
sankalpmukim•3h ago
9/28 - This was very good fun. Can't believe so much of the world's (important?) software is written in this toy language.
ilovethe80s•3h ago
JavaScript has survived because it must be backwards compatible, not because it ever made sense.

Adding Temporal will only add to the chaos. Now there will be Date, moment, Luxon’s objects, and Temporal. See??? We fixed it!!!

mcv•3h ago
Too many standards? Time to add another one. This one will be final, I promise.
actinium226•1h ago
Temporal is the language's attempt to fix the issues, instead of relying on 3rd party tools. The current situation forces developers to either choose something supported by the language, which has certain guarantees for backwards compatibility but is awful, and a 3rd party tool, which does not and is not as bad. It seems like the logical resolution is for the language to step up its game, since 3rd party tools have no obligation to be maintained or backwards compatible, or even to remain popular.
mnahkies•3h ago
It's a fun quiz, and there's a lot of surprising behaviour. However in my opinion from a practical perspective it mostly doesn't matter.

Think hard about whether your use case really cares about local time, try and find ways to make instants appropriate. Then stick to UTC ISO 8601 strings / Unix timestamps and most of the complexity goes away, or at least gets contained to a small part of your software.

I know this isn't always possible (I once had to support a feature that required the user took a break covering two periods of 1-5am local, which was obviously fun around DST boundaries) - but in my experience at least the majority of the time you can find ways to minimise the surface area that cares.

If you're passing raw/unvalidated user input to the date parser you're holding it wrong.

samwho•3h ago
I agree with this. I do think it’s an easy trap to fall into if you’re unfamiliar, and hopefully this quiz has made a whole wave of folks more familiar. :)
lukan•2h ago
"If you're passing raw/unvalidated user input to the date parser you're holding it wrong."

Exactly. I would have never thought about using the Date class in this way. So the behavior is pretty much wtf and local time can get pretty complicated, but I wouldn't expect to get the right time, when passing some vague strings.

JonChesterfield•2h ago
Given that the right way to turn user input into validated input is to _parse_ it, passing it to the language feature called the _date parser_ is a completely reasonable thing to do. That this doesn't work probably doesn't surprise javascript programmers much.
mnahkies•1h ago
Yeah this is a fair take - I guess my unwritten stipulation was don't expect anything from the JavaScript standard library to behave as you'd expect, outside of fairly narrow paths.

TBH even when working with other languages I'd skew towards doing this, possibly because I've worked with JavaScript/TypeScript too much. It's a balance but there's a certain comfort in making constraints really explicit in code you control over blindly trusting the standard library to keep it's behaviour over the lifetime of the product.

masfuerte•4m ago
It's not just JS. I'm familiar with a language implementation that used C++ stream I/O for parsing numbers. When C++ expanded the syntax for numbers it broke the language in some cases. This isn't too bad if you catch it quickly but if people start relying on the new, undocumented feature it can be impossible to fix without upsetting someone.
Hilift•1h ago
I agree, and/or give an option to specify the DST offset. That is sometimes useful. I was always confused that Excel did not infer the format when using CSV's though.
BrandoElFollito•3h ago
This is one of the reasons that I, an amateur dev, never touch dates other than via date-fns or other date libs.

Dates and times are insane, no matter the language.

hidroto•3h ago
4 / 28 "You would have scored higher by guessing at random."

I think my strategy for JavaScript going forward is to 'drop & run'.

plqbfbv•39m ago
Same here! Too bad... I did guess at random! :D

Anyway, after the experience trying to automate something with Google Sheets and wasting 4 hours just to discover that months start at 0 (in the context of parsing string dates and creating Date objects)... yep, no more JS for me.

norskeld•3h ago
Scored 17/28. Thank you, this is absolutely cursed! It's probably a good time to go and check out the Temporal stuff (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...).
actinium226•1h ago
They're certainly taking their sweet time with it. Reading the last progress update is mildly entertaining though: https://github.com/tc39/notes/blob/HEAD/meetings/2024-07/jul...
wiseowise•3h ago
Cute. But things like these have tendency to be abused by “haha, js” crowd even if those things are irrelevant in practice.
rplnt•2h ago
Generally true, but the Date and everything around it being absolutely incomprehensible and totally bonkers is very relevant in practice. It's pain to use and triggers billions of bugs daily. It's not an abuse to point out even more wtf about it.
samwho•2h ago
This matches my experience. This is a bit of fun but I’m hoping it has the positive side effect of making people more cautious about how they use Date.
AndroTux•1h ago
date.getYear() => 125

If that’s not relevant, I don’t know what is.

wiseowise•1h ago
> date.getFullYear() => 2025

`getYear` is literally deprecated everywhere and is not part of the spec.

https://tc39.es/ecma262/multipage/numbers-and-dates.html#sec...

porridgeraisin•1h ago
Today you should use getFullYear() => 2025

getYear() returns 125 as it was standard for dates to be offset from 1900 (which led to the Y2K problem). This behaviour should be maintained forever. "Nothing is more important than backwards compatibility"

Or rather, that should be mindset, so that we can achieve at least 90% backwards compatibility in practice.

nikolayasdf123•3h ago
someone should make one for Python based on https://github.com/satwikkansal/wtfpython
LoganDark•3h ago
I just fixed a bug at work where JS Date was parsing arbitrarily long strings as random date values just because they happened to contain an integer anywhere in the string. Madness.
tialaramex•2h ago
In a language which doesn't understand that "false" isn't true? I would be entirely unsurprised to discover it's secretly calling a browser vendor web API to search for similarly named dates, or that it's now AI powered and might decide "Last Christmas" means the release date (December 3 1984) of the single not like, Christmas Day in 2024...

I think after the 1970s "Worse is better" languages vanish from the Earth the last shadow of that thinking left might be Javascript, hopefully by then humans aren't writing it but of course for "compatibility" it'll still be implemented by web browsers.

nailer•2h ago
What do you mean? false isn’t true in JavaScript.
Filligree•2h ago
“false”, not false. So there’s odd type coercion, but the problem is that it can happen without you asking for it.

Python does the same thing. I don’t like it there either, but at least it’s more consistent about it.

nailer•1h ago
Yes strings aren’t false unless they’re empty. Good thing.
astura•2h ago
The string with the value of "false" evaluates to true.

In other words

If ("false") { /* You will be here */ }

wiseowise•2h ago
Why wouldn’t “false” be true? It’s a non-empty string.
ascar•2h ago
yea that's an odd example to pick. expecting type conversion to add meaning to strings is a programmer problem not a language problem. really comes down to developers not thinking about types and their meaning anymore.

there are plenty of javascript examples that are actually weird though, especiall when javascript DOES apply meaning to strings, e.g. when attempting implicit integer parsing.

010101010101•1h ago
It’s the _existence_ of an implicit conversion from string to boolean that the parent is pointing out as a problem, not how it’s implemented. But that’s Jãvascript bb
echoangle•1h ago
Maybe I’m missing the example but can you not check the truthiness of strings in basically any high level language? At least python does it the same way and it’s very useful.
tialaramex•2h ago
For the same reason dogs aren't the square root of two and justice isn't golf? They're not the same kind of thing at all, if you insist that we should be able to compare them then they're not equal, and since programmers are human and make mistakes probably comparing them is itself a mistake.
wiseowise•1h ago
You've completely disregarded type system rules of the language, and continue doubling down on your ignorance with ridiculous examples.

> They're not the same kind of thing at all, if you insist that we should be able to compare them then they're not equal, and since programmers are human and make mistakes probably comparing them is itself a mistake.

It is literally encoded in the spec.

https://262.ecma-international.org/13.0/#sec-toboolean

thfuran•1h ago
But it shouldn’t be
echoangle•1h ago
You don‘t think being able to check the truthiness of strings is a useful thing?
camblomquist•1h ago
edit: I'm mostly wrong here.

Because "0" is false. In a logical world, a non-empty string being truthy is fine even if the value is "false". Javascript isn't logical.

wiseowise•1h ago
``` > if ("0") console.log("true");

true ```

Excuse me?

> In a logical world, a non-empty string being truthy is fine even if the value is "false". Javascript isn't logical.

You must hate our illogical world built on C, because it has the same behavior.

camblomquist•1h ago
I did a `"0" == false` which returned true. I may need another cup of coffee before making claims.
bapak•1h ago
Are you crazy? Which language does? I can only think of markup languages that do.

Should "0" also === 0? How about "{}" === {}? When does it stop?

petee•2h ago
I found that too painful to get further than #14
bapak•1h ago
I gave up on like 5 and I'm a JS developer. Who dreamed this API up?
wiradikusuma•2h ago
Another thing is with timezone: https://github.com/date-fns/tz/issues/57

I'm not sure if it's caused by JavaScript quirkiness under the hood or a bug in the library, but it's mindblowing.

dotnetcarpenter•2h ago
Since the website says "All questions verified using NodeJS 24.4.0" and that all string parsing made by the Date constructor is define in ECMAScript to follow ISO 8601 plus being engine specific, the sub headline should say: How well do you know V8's Date parsing?
bagol•2h ago
I'm curious how would a formal spec define those behaviors.
kevincox•2h ago
IIRC it was basically undefined, some data formats were defined. Eventually it was specified that it must correctly parse RFC 3339 and everything was browser defined. I think in the name of web compatibility they have started to carefully define the legacy behaviours of common browsers.

But the morale of this story should be if you need a date from a user user a date input and if you need to parse a computer-readable date always use UNIX timestamps or RFC 3339 (which are correctly and consistently supported).

tobyhinloopen•1h ago
10 / 28 lol, that's sad
ivanjermakov•55m ago
Lots of lessons in language design here. No explicit error return type and null bottom type create high ambiguity in such edge cases.