Live data from Hacker News

TypeScript types can run DOOM [video]

youtube.com

341–350 of 391 posts

Re: TypeScript types can run DOOM [video]

#341
post #129

Earlier quoted context omitted.

Also the best answer to "how do you reverse an array". You don't. You just read it in the opposite order. Especially in any iterator-based language it should be trivial. In a pure ASCII world, this doubles as "how do you reverse a string". In a Unicode world, the answer to "how do you reverse a string" is "you should never want to do that".

Right, but sometimes you actually do have to reverse the array.

I can't remember the last time I reversed an array. Honestly it's at least a code smell. Why can't your code just read it in the other direction? Or have it in the correct order in the first place (e.g., sort it correctly instead of sorting it backwards and then reversing it). It's not that hard, even in a C-style for loop language.

Re: TypeScript types can run DOOM [video]

#342

Earlier quoted context omitted.

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 don't thinks statements like this are meant to be read literally in American English. I don't know, when I got hyperfocused on a side-project a few years ago, I was dedicating almost all my awake time to it. 12+ hours a day, every day, including weekends, for months. Surprisingly, I didn't burn out. I was just so interested in it, I couldn't stop, and even started neglecting other things to work more on it. I nev…

I think both of you are correct:

1. I've also been it a hyper-focused state where I was so intent on what I was working on I would spend basically all my time on that project without burning out. Like you, I haven't hit that focus state for a long time.

2. "18+ hour days", consecutively, is almost certainly an exaggeration, and this is where I agree with the parent commenter. For some reasons Americans (I am American) love talking about how much time they work and how little sleep they get. Realistically, very few people (except a small percentage of genetic outliers) can get by on sub-6 hours of sleep for long.

Re: TypeScript types can run DOOM [video]

#343

Earlier quoted context omitted.

But that's all CPU -- he doesn't have to emulate the rest of the computer (video card, IO systems, etc). You provide WASM with your own interface to the outside world.

(not arguing, really just want to hear your thoughts to this!) so re: video card - but I did write what I don't know what else to call other than "a graphics driver" (i.e. it takes Doom palette pixel values and converts them to something the user sees on their screen with ASCII art). what else would you call that? or are you saying video card would have to be at the level of VSCode or my operating system that actuall…

If instead of WASM you decided to emulate a different DOOM target like a PC then you'd have to emulate the actual VGA graphics hardware and enough of the other PC hardware to run the game. That level of emulation is a difficult project on it's own.

Re: TypeScript types can run DOOM [video]

#344

This is top bloat and reminds me of the fever-dreams as a child with walls and walls of senseless work… impressive but also sad somehow.

I can’t agree enough. It’s sort of like those massive paintings recreated in CSS. They are a neat achievement, yet sort of reveals a vast emptiness that exists within the author.

Re: TypeScript types can run DOOM [video]

#345

Earlier quoted context omitted.

> "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." I have a nuanced view of your particular example. I've been in this industry for almost 30 years. I cut my teeth writing C/C++, had an interest in language theory and frameworks and was brought up to care about portability. I always wanted to be able to easily transiti…

> When you enter a new company with a large codebase that you have to ramp up on, you're not only required to learn the language or 3rd party frameworks and libraries that they use ... you need to ramp up on THEIR "framework." I think you could turn the responsibility the other way around quite as easily, and I think you're mistaken grown complexity, one that is inherent in a company's system (accidental or not), whe…

> I think you could turn the responsibility the other way around quite as easily, and I think you're mistaken grown complexity, one that is inherent in a company's system (accidental or not), when you outline what you mean as "framework" here.

No I'm not. I'm not reading the rest of your reply because you completely misunderstood me here and then proceeded to give me an insulting definition of what a framework means while completely ignoring the broader point I was trying to make.

In fact, I did the following to add clarity:

1. I put the word "framework" in quotes to make it clear that I was using the term colloquially

2. I elaborated that I was talking about custom supporting code and other tooling that was developed by the company in order to solve domain-specific problems.

I have built frameworks. I continue to build frameworks for my employer on a Platform team. We work with 3rd party frameworks and we need to build on our own. This is just normal encapsulation, building higher level APIs on top of lower level ones.

So when I say "the company's framework" I'm referring to the stuff that was buit in house in order order to develop highly domain specific functionality with a higher level API than what the 3rd party frameworks are providing out of the box.

A framework's super-power is that it applies the Holly Principle: don't call us, we'll call you. That's what distinguishes a framework from a library. Libraries sit there passively waiting for you to consume them. But in our industry, like the word "hacker" and "troll"... people start using the term colloquially. And in this case we're talking about the specific APIs that the company has developed which you need to ramp up on even if you are highly experienced in the specific 3rd party frameworks that they use.

And even if we take the word framework absolutely literally as you did in your comment, companies still build "literal frameworks" internally in order to try and simplify. But you gotta ramp up on those.

At my existing employer, we have even taken 3rd party frameworks and libraries, and forked them and developed our existing custom tooling with them because our domain specific requirements brought us to that level. So now you're coming in to our shop not only needing to ramp up on those 3rd party frameworks, but you gotta learn and understand how we changed them too for our purposes.

Re: TypeScript types can run DOOM [video]

#346
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…

> year long journey of 18 hour days I couldn't do it, even if I had the talent. I have to work to get money!

the low(er) cost of living here in Michigan is absolutely a factor of the story! haha.

Re: TypeScript types can run DOOM [video]

#347

Earlier quoted context omitted.

(not arguing, really just want to hear your thoughts to this!) so re: video card - but I did write what I don't know what else to call other than "a graphics driver" (i.e. it takes Doom palette pixel values and converts them to something the user sees on their screen with ASCII art). what else would you call that? or are you saying video card would have to be at the level of VSCode or my operating system that actuall…

If instead of WASM you decided to emulate a different DOOM target like a PC then you'd have to emulate the actual VGA graphics hardware and enough of the other PC hardware to run the game. That level of emulation is a difficult project on it's own.

got it, ok sweet. thank you so much for explaining. I don't know a ton about these programming circles, so I don't want to say the wrong thing if I can avoid it. Sounds like you're saying that no WASM runtime is, in this sense, qualifying - which makes sense!

Re: TypeScript types can run DOOM [video]

#348

Earlier quoted context omitted.

Your 1 isn't equivalent to my example, line 11 is not constraining the type.

I know it's not equivalent, it was just an example to show what `any` does (and that it's more than "just a set of all possible types"). The `T extends Record ` on line 11 is a type parameter constraint though. Are you referring to something else when you say "constraining the type"?

It works differently based on where those anys are and what that Record refers to due to type variance.

Re: TypeScript types can run DOOM [video]

#349
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…

We already new that TS types are Turing complete so it's more of demonstration than a proof.

Re: TypeScript types can run DOOM [video]

#350
post #157

Earlier quoted context omitted.

I do think shipping a product that has real users (and everything it entails, like writing the docs) is 100x more important than having leetcode and common interview tactics fresh on your mind. Without context, I suppose I can see the Homebrew guy's case possibly signaling a sort of hubris since it was just a fizzbuzzy-level question. In his defense, I would find it ridiculous if we just had a technical convo about h…

Never mind that a lot of the jobs that ask you to do this will mostly involve the conversion of database data to JSON or HTML with a few steps of business logic in between. And the harder computational challenges you’d likely learn as you need it. In which case, simply knowing what a binary tree is means you’ll know it’s available to you, even if you can’t invert one from the top of your head. And even then, start go…

Your last bullet is a good point.

When you gain experience and responsibility as a software developer and take on broader roles, the main values you've accumulated are higher level skills, like the ability to bring a project to completion (and everything that entails).

There's always a place for algorithmic hacking. But it feels like the easiest thing to hire for when you need it because it's so concrete. That's prob why it's so dominant in hiring practices: it's the only easy thing to measure.

Post reply on HN