News for hackers. Stuff that matters.
Re:Kotlin for JavaScript by Aeolun on Sunday March 27, 2022 @03:09AM (#30818359)
> There are just dependencies, you don't "install" them

Pray tell me where the dependency comes from then? When I add a ‘This package requires dependency x at version y’ to my gradle/maven file, it doesn’t magically appear on my system.

Or rather, I think it does magically appear on my system, which is incredibly confusing.

Re:Kotlin for JavaScript by jeroenhd on Sunday March 27, 2022 @08:15AM (#30819670)
The dependency comes from the list of repositories you provide. Even in nodejs you don't manually enter the full URL to an NPM package. You just yarn add node-ipc==10.1 and your tooling will figure it out on its own.

If you enable the general maven repository (the maven() you see at the top of many gradle build scripts), you'll get the code from maven. If you also add your personal repositories (which most people probably don't have), you'll get packages from there as well. I'm not sure how you add a second repository to node package managers, but I assume it's possible in some way without specifying the http download url.

The biggest difference between the two ways of package management in my opinion is that node packages are just a word or two and Java packages are a full com.example.product.service.package name. That's a lot better in my opinion as it distinguishes between projects much more easily. I thought node-ipc was related to the nodejs project, for example. Some nodejs packages use namespaces, but most don't.

Another difference is that nodejs has tons of tiny packages (I'll never get over how silly it is that is-odd and is-even appeared in my node folder by transitive dependencies) whereas the Java world generally uses huge packages almost exclusively. This leads to more boilerplate code (actually having to write simple functions like that yourself), but also to less dependencies that can break.

Re:Kotlin for JavaScript by kaba0 on Sunday March 27, 2022 @05:12AM (#30818864)
It downloads it into cache for the first time and uses it at compile time at every subsequent build? How is it magical?

Should it display ads instead and put random executables to my path? Or create a 1000000 file directory everywhere on which windows god damn chokes to open?