Live data from Hacker News

TypeScript types can run DOOM [video]

youtube.com

291–300 of 391 posts

Re: TypeScript types can run DOOM [video]

#291
post #250
post #246

Earlier quoted context omitted.

What was the argument for why it couldn't?

Because we lack an infinite tape and infinite time, not everything that is Turing complete can run DOOM

> not everything that is Turing complete can run DOOM

Beware with such blanket statements, you might inspire someone to do 18-hour days for a year to prove you wrong.

Re: TypeScript types can run DOOM [video]

#292

I'm sorry to rain on this parade, but I fail to see the merit of spending so much effort - and writing so much code, generating so much data, working 18hr days etc. - to render Doom in TypeScript type-checker. I mean, there all sorts of feats and achievements one could choose as one's goal, which would also be impressive, but would be more useful to users and/or software developers, than this. I'm just thinking of al…

Yes, but think of how much joy it brings to so many people.

Think of how much joy it would bring to people if the author would work on a piece of software which would be consistently useful beyond the one-time novelty.

Of course, it's a matter of proportion - I'm not saying that only things of utility and no "fun" stuff need ever be produced; but this is a rather extreme case.

Re: TypeScript types can run DOOM [video]

#293

Honestly every time I worked on TypeScript codebase and the type definition "any" started popping out more and more often, I felt I'm starring into the abyss.

People generally just give up after a while with the type system. I consider myself decent with TypeScript and you end up spending a good chuck of your time satisfying the compiler for something which is literally a one liner in plain JavaScript.

Re: TypeScript types can run DOOM [video]

#294
post #179

> "It was a brutal year long journey of 18 hour days" [to run doom in TypeScript types] This is some serious dedication for what at first blush may sound to many to be a completely unserious, or even useless, achievement. But I say to those people: a DOOM proof is just as worthy of praise as any other academic mathematical proof, and has the advantage of being verifiable by laymen. Congrats on this amazing achievemen…

I don't thinks statements like this are meant to be read literally in American English. IE US English speakers always fond of telling me how they work X hours in a day, or they went N days without sleep. Which used to really impress me, until I realised "wait... do they just exaggerate as matter of course"? And then I realised - of course they do; these are people for whom every purchase is an "upgrade"; where a bicy…

From experience, be careful if you ever called them out, just let them be.

Re: TypeScript types can run DOOM [video]

#295
post #219

Earlier quoted context omitted.

Those are the unicorns

society create the überman myth to keep the working class down, thinking they will never be the top of their game. the ones doing the hiring know that those putting in 18hrs a day are the unicorns, i.e. the best they can hope to find.

I was accidentally one of these once.

I fixed a long standing bug that was a companies top priority for several months and no one had been able to fix it. They were talking about re-writing an entire app to resolve it, at a cost of 100's of thousands of dollar, dragging the vendor over the coals etc.

I was relatively new and thought I'd take a look, ignoring all the mystique surrounding the problem. It turned out to be a simple one line fix, just a dumb oversight that anyone who bothered to understand and step through the code would have caught.

Things got a little weird after that haha. The director who had been responsible for that department started ignoring me, while I started to get pulled into look at all sorts of other peoples urgent issues, with zero context, often with a team of other people I didn't know on the call.

It was fun while it lasted, but man, I'm glad I'm no Doogie Howser MD, that shit would go to your head!

Re: TypeScript types can run DOOM [video]

#296
post #179

> "It was a brutal year long journey of 18 hour days" [to run doom in TypeScript types] This is some serious dedication for what at first blush may sound to many to be a completely unserious, or even useless, achievement. But I say to those people: a DOOM proof is just as worthy of praise as any other academic mathematical proof, and has the advantage of being verifiable by laymen. Congrats on this amazing achievemen…

I don't thinks statements like this are meant to be read literally in American English. IE US English speakers always fond of telling me how they work X hours in a day, or they went N days without sleep. Which used to really impress me, until I realised "wait... do they just exaggerate as matter of course"? And then I realised - of course they do; these are people for whom every purchase is an "upgrade"; where a bicy…

I work with Americans and never experienced this from any of them - are you sure you're not... exaggerating?

Re: TypeScript types can run DOOM [video]

#297
post #203

Earlier quoted context omitted.

[flagged]

what's with hn being filled with assholes lately?

It's happened in the last couple of months, a clear uptick in aggressive comments. I'd hazard a guess at people using HN as an outlet for feeling angry and helpless about the US political situation.

Re: TypeScript types can run DOOM [video]

#298
post #98

One of the top comments in the video: > If this guy goes for a big tech interview they're still going to ask him how to invert a binary tree The industry's hiring process is so messed up that this is completely believable. "We've decided to prioritize other candidates, as you are strong in the fundamentals but lack the kind of experience in Vue that we're looking for."

Has anybody ever figured out what "invert a binary tree" means? That came from Max Howell, and nobody else seems to have ever received that question. The best anyone can figure out is that it's reversing the left and right branches, which seems like it's ten lines of code, at most?

Depends on how you look at it, I guess. A binary tree has a couple of properties. Usually there is some ordering on the type. Something like: the element on the left is smaller than the element on the right. (e_L e_L. I guess this is the left and right branches exchange answer.

If you see a binary tree T e as some kind of function, it can test whether an element exists, a typical set operation. So f : e -> {0,1}, where (e,1) means the element is in the binary tree. (e,0) means it is not in the binary tree. All those (e,0) creates some sort of complement tree, which might also be seen as inverting it.

What would be really weird is seeing it as a directed acyclic graph and invert the direction of every edge.

Re: TypeScript types can run DOOM [video]

#299

Earlier quoted context omitted.

'any' has always been intended as an escape hatch, so no abuse here [1]. The type representing the set of all possible values (the top type in the type lattice) is 'unknown'. [1] https://www.typescriptlang.org/docs/handbook/2/everyday-type... [2] https://www.typescriptlang.org/docs/handbook/release-notes/t...

unknown is not equivalent to any as a type constraint: doesn't work. https://www.totaltypescript.com/any-considered-harmful#type-...

[deleted]

Re: TypeScript types can run DOOM [video]

#300

Earlier quoted context omitted.

Sure, there's many other ways to type it, but none adds any kind of additional safety or strictness over Record which was my point that `any` is the correct type in many cases, except when it widens a type. But in my case it's not widening anything, in Record , B can already be `any`thing. People tend to see it as an unsafe escape hatch (which is how it is abused), but it's just a set of all possible types.

> it's just a set of all possible types `unknown` is the set of all possible types (it's the top type[0]). `any` goes beyond that—it basically turns off the type checker[1][2]. [0]: https://en.wikipedia.org/wiki/Top_type [1]: https://tsplay.dev/mA9vXm [2]: https://www.typescriptlang.org/docs/handbook/2/everyday-type...

It's a "null" and "undefined" discussion all over, but now with transpiler.
Post reply on HN