News for hackers. Stuff that matters.
Re:TypeScripting the Technical Interview by hnfong on Sunday March 12, 2023 @01:02PM (#35122711)
I'd say it's "inspired" rather than "translated".

The part about using the typescript language server to compute the solution, and the protagonist claiming the code is "concise" because only 4 lines of javascript were generated, was absolutely brilliant. Cracked me up at least.

Glancing at the actual code, I admit I'm with Criss in my ability to follow the logic, but it doesn't look like a direct translation from Haskel types to Typescript types either.

At any rate, very well done.

Re:TypeScripting the Technical Interview by the_gipsy on Sunday March 12, 2023 @04:01PM (#35125447)
I am not well versed in Haskell, but wasn't the original also computing the solution with just the type system?
Re:TypeScripting the Technical Interview by tome on Sunday March 12, 2023 @06:09PM (#35126949)
Yup
Re:TypeScripting the Technical Interview by girvo on Sunday March 12, 2023 @06:05PM (#35126916)
I know my mind is decidedly poisoned when I could follow the type definitions perfectly, and they reminded me of certain types I have written myself… ah, TypeScript, what have you done to me…
Re:TypeScripting the Technical Interview by aw9f70gae on Monday March 13, 2023 @09:17AM (#35135286)
How does one even come close to such wizardry
Re:TypeScripting the Technical Interview by girvo on Monday March 13, 2023 @09:20PM (#35146006)
Going deep into conditional types, and trying to contort Typescript into a dependent type system despite the fact it is not one!
Re:TypeScripting the Technical Interview by WorldMaker on Tuesday March 14, 2023 @03:21PM (#35157001)
Deep diving into lib.d.ts and DefinitelyTyped dealing with the weird boundary space between poorly typed JS and strongly typed TS can teach a lot these days.

Also, being able to recognize the Peano S-function on sight (and thus uses of Church-Peano numbers) is a fun part of that wizardry. (Maybe not necessary to remind the usefulness of the Lambda Calculus canon on a site named after one of the most famous combinators.)

Re:TypeScripting the Technical Interview by blauditore on Sunday March 12, 2023 @06:44PM (#35127367)
The final punch line is that types vanish and the compiled code is effectively useless.