Hacker News new | ask | show | jobs
by W4ldi 2253 days ago
typescript is just a language, how is that a dependency? by that logic, nothing is dependency free.
3 comments

But the end users can't run the typescript, whereas they can run javascript directly. So, an external tool is required by the developer.

A similar comparison would be shipping a program to end users, saying that 'no dependencies required', but instead of giving them a binary to run, you hand them a c++ file. I think everyone would agree that a C++ compiler is clearly a required dependency in that case.

Building Rome does require typescript. It's a devDependency. Using Rome (ie, the `rome` command that gets built) does not.

"No dependencies" seems accurate to me, since it refers to use of the built product, which is what will presumably be used in the future when you can `npm install rome`.

> an external tool is required by the developer

Yes, that tool is Rome. They are re-implementing the TypeScript compiler, just like everything else

Nobody says a C file has a "dependency" because you have to compile it.
Like that point is fair, but almost no C code has no dependencies. Like just a basic application that returns 0 and nothing else from main will need to link to crt0. https://en.wikipedia.org/wiki/Crt0

However, you can compile C code as a bin file (just instructions). More common in the embedded world or you need to bootstrap an OS ect...

Static binaries do not have any dependency, and those that are not static typically depend on libc etc., regardless of the language being C, JavaScript (the browser) or anything else. So we don't count them as "dependencies".

But my point above was to counter the "C compiler is a dependency" claim. Nobody counts that way when discussing running programs, and that was my point.

There are dependencies to build a program, and dependencies to run it. Sure a static binary can run without any run time dependencies if written to run on bare metal (without an OS). Although, you could go further down that rabbit hole and say the hardware is a dependency. (better start writing stuff in VHDL and Verilog /s)

Both types of dependencies do come up. However, most people don't consider language dependencies. However, if you for instances need to port your code to a lot systems such dependencies can suddenly be very important. Especially if you have to do the porting. So to say: "Nobody says a C file has a "dependency" because you have to compile it." is a bit disingenuous. There is a lot of C code that require features only available in certain compilers. At which point that code now depends on that compiler.

However, JS seems to have problem with too many dependencies, at times these dependencies can be trivial that is makes someone ask why...

Would you say the same about a single-header library for C++?
I'm comparing it to JavaScript, which you can simply run in the browser or in NodeJS without requiring anything else but your code. You can't just use TypeScript, you have to compile it to JavaScript before, as the runtime is still either the browser or NodeJS.
The TypeScript compiler and the various @types NPM packages are dependencies. Node and NPM are also dependencies since this project will not execute without them.

What this project means by no dependencies is that there is nothing external pulled into the compiled JavaScript.