Live data from Hacker News

PR that converts the TypeScript repo from namespaces to modules

github.com

111–120 of 204 posts

Re: PR that converts the TypeScript repo from namespaces to modules

#111
post #63

Earlier quoted context omitted.

I can see this is probably a calm point that will definitely not escalate, programmers don't really care about tabs and spaces that much, right???

"Tabs vs spaces" is often misunderstood (and falsely reported) as a problem of preference. The real problem is that using spaces for indentation is an accessibility issue. The solution is to use tabs for indentation, and spaces for alignment.

> The real problem is that using spaces for indentation is an accessibility issue.

Not this again

https://github.com/prettier/prettier/issues/7475#issuecommen...

> Blind programmers have no problems with it.

Re: PR that converts the TypeScript repo from namespaces to modules

#112

> a change in the indentation used in our bundle files (4 spaces -> 2 spaces) I find it interesting that one of the reasons given for the reduction in package size is due to such a simple indentation change from 4 spaces to 2 spaces. Not interesting that 2 bytes are less than 4 bytes, rather, TypeScript is a large project and it would be interesting to know how much size was saved from this one specific change? Seems…

Kind of funny because one of the benefits of tabs vs spaces that people laugh off is that it saves space. I think it's probably correct to laugh this off though. Why would you care about the non-minified/gzipped size this much?

TS devs still debating this in 2022? And i thought php devs are ridiculous for still debating setters and getters.

Re: PR that converts the TypeScript repo from namespaces to modules

#113
post #23

Earlier quoted context omitted.

I'm curious about that too. From my superficial knowledge of compilers, "modularization" itself should not make code faster, if anything slower. There'll always be some overhead of loading modules and communicating between them, not? I presume, from my own experience when building software (not compilers), that modules allow for a much easier to reason about, much better isolated (cohesion, loose coupling). And there…

There are some key things here that maybe weren't clearly stated in my writeup. Firstly, the old codebase is TS namespaces, which compile down to IIFEs that push properties onto objects. Each file that declares that namespace is its own IIFE, and so every access to other files incurs the overhead of a property access. With modules, tooling like esbuild, rollup, can now actually see those dependencies (now they are st…

Maybe they could update esbuild to be aware of TS namespaces instead?

Re: PR that converts the TypeScript repo from namespaces to modules

#114
post #63

Earlier quoted context omitted.

I can see this is probably a calm point that will definitely not escalate, programmers don't really care about tabs and spaces that much, right???

"Tabs vs spaces" is often misunderstood (and falsely reported) as a problem of preference. The real problem is that using spaces for indentation is an accessibility issue. The solution is to use tabs for indentation, and spaces for alignment.

Why would you ever mix them?! Even when I started programming 15 years ago it was already accepted wisdom that that was a terrible idea.

Re: PR that converts the TypeScript repo from namespaces to modules

#115
post #48
post #8

Sucrase is proof that JS is not the problem when it comes to slow performance. JS is not slow. NodeJS is not slow. It's the code that is slow. All these people wanting to write it in Rust or Go or XYZ programming language need to acknowledge this. Yes, multithreading is awesome and really helpful but it's the cherry on top, not the whole thing. If the same amount of effort was put into optimizing the TSC codebase as…

I rewrote a card game engine, openEtG, from JS to Rust. It was a pretty 1:1 rewrite. 2x improvement even when I was using HashMap everywhere. I've since entirely removed HashMap, which has only further improved perf As a bonus, the code is now statically typed

JIT/interpreted languages (Java, JS, Python etc.) cannot compete with optimized code from compiled languages.

The tradeoff is that Rust is lower-level, so it is harder to write. If performance were the only point of comparison for a language, then we'd all be using assembly. We choose to trade performance for productivity when we're able to.

Re: PR that converts the TypeScript repo from namespaces to modules

#116

Earlier quoted context omitted.

I think tooling of one programming language should be written in the programming language. Otherwise the community will hardly be involved. All these rust tools may be slight faster, but typescript developers will not learn rust to improve the typescript compiler.

> but typescript developers will not learn rust to improve the typescript compiler. Why not? TS has much more in common with Rust than with JS, in terms of typing. Compiler engineers are not that prevalent in the community, but they are much more prevalent in the systems engineering world which Rust is a part of, so I'd assume it's actually more beneficial to have a compiler in Rust than in TS because it would mean m…

> TS has much more in common with Rust than with JS, in terms of typing.

TS has much more in common with JS than it does with Rust in every other comparison

Every TS dev will know at least a little bit of JS. Not every TS dev will know Rust at all. They're very different languages.

Re: PR that converts the TypeScript repo from namespaces to modules

#117

Quoted post unavailable.

> I don't care. I care when it's implemented in Rust.

What does this add to the discussion? This comment serves nothing except to be negative to an author who has made a great improvement.

Re: PR that converts the TypeScript repo from namespaces to modules

#118

Earlier quoted context omitted.

"Tabs vs spaces" is often misunderstood (and falsely reported) as a problem of preference. The real problem is that using spaces for indentation is an accessibility issue. The solution is to use tabs for indentation, and spaces for alignment.

> The real problem is that using spaces for indentation is an accessibility issue. Not this again https://github.com/prettier/prettier/issues/7475#issuecommen... > Blind programmers have no problems with it.

Not everyone with vision or vision processing issues is blind. Being able to configure custom tab stops is an easy way to control what level of indentation is useful and clear.

Re: PR that converts the TypeScript repo from namespaces to modules

#119

Earlier quoted context omitted.

> but typescript developers will not learn rust to improve the typescript compiler. Why not? TS has much more in common with Rust than with JS, in terms of typing. Compiler engineers are not that prevalent in the community, but they are much more prevalent in the systems engineering world which Rust is a part of, so I'd assume it's actually more beneficial to have a compiler in Rust than in TS because it would mean m…

> TS has much more in common with Rust than with JS, in terms of typing. TS has much more in common with JS than it does with Rust in every other comparison Every TS dev will know at least a little bit of JS. Not every TS dev will know Rust at all. They're very different languages.

Compiler engineers will be far more familiar with Rust, C++, C and other similar languages than with JS, so it doesn't really matter whether TS and JS are similar as long as compiler engineers can use their preferred language to build the compiler.

Re: PR that converts the TypeScript repo from namespaces to modules

#120

Earlier quoted context omitted.

Tab is ASCII 9 while space is 32. Tabs, having the lower number, are therefore obviously cheaper.

Tabs require 2 set bits. Space requires only a single set bit. Spaces therefore requires less electricity.

No post body was provided.
Post reply on HN