News for hackers. Stuff that matters.
Re:The Deno Company by sublimefire on Monday March 29, 2021 @09:30AM (#26621236)
Deno makes sense in a variety of situations. The build pipelines of Typescript are excessively complicated and Deno hides that complication away (less dev effort).

Furthermore Node has its own maintenance/risk issues in production systems (think permissions), and Deno reduces those with custom built runtimes.

I cannot see it replacing Node though. Node has created a vast ecosystem that includes modules (npmjs), client side bundlers (eg webpack), serverside frameworks (eg express), etc. But because Deno is solving some of the issues for those who run sensitive code in production (eg Lambda functions) it'll most likely gonna become another VM on the public cloud providers' list.

All in all Javascript interpreter is becoming something like a JVM. Everyone wants to use it but without writing vanilla Javascript.

Re:The Deno Company by tomxor on Monday March 29, 2021 @09:51AM (#26621510)
This probably either sounds nuts or over opinionated but I don't think the NPM ecosystem is as valuable as people think it is... stuff is deprecated continuously anyway - when you find a way to move away from 10k dependencies (because your shortsighted previous self decided to depend on a single package without looking closer), it's a damn relief. I hate how needlessly complicated the NPM ecosystem is, I would actually like it if no one built bridges to Deno, it could be a clean start with lessons learned.

Most of the packages on NPM are complete garbage - most not all - (and I say this as a full time JS dev who actually likes JS), liking the technology does not have to mean liking what people do with it, and JS is the worst, both in terms of the crap on NPM and the web.

Re:The Deno Company by sublimefire on Monday March 29, 2021 @10:35AM (#26622261)
Your thoughts and experience resonate with me.

Although I would look for similar examples elsewhere to understand where it is all headed. And one of those could be the rise and adoption of the JVM. There are a bunch of old dependencies, multiple repositories (compared to just one popular npmjs), a couple of build tools (ant, maven, gradle) compared to npm, yarn, then multiple languages (invented for somewhat similar reasons as Typescript). One thing is sure that the dependencies stay somewhere for-almost-ever, and all else kind of evolves around it.

It seems that the main problem at the moment is the developer (me, you, everyone) who instead of writing 20 lines of code uses a dependency that has 10 other transient ones. You cannot fix it but rather challenge those situations at work and reduce the tech debt for good. Maybe there should be a build tool that throws errors depending on the amount of dependencies. Maybe there should be a frontend framework which will only need 10 dependencies for the helloworld instead of 1500; otherwise we kind of think that if a boilerplate template has 1500 deps then surely adding another 100 will not make much harm.

Re:The Deno Company by TimTheTinker on Monday March 29, 2021 @10:05AM (#26621723)
> I don't think the NPM ecosystem is as valuable as people think it is

Its value is less about the existing dependency tree of libraries and more about how many apps directly depend on libraries that are npm-hosted.

There are many 200+ kloc apps out there making millions/yr each that deeply depend on libraries and frameworks hosted in npm.

Re:The Deno Company by cloverich on Monday March 29, 2021 @11:52AM (#26623670)
I mostly agree with this, after using Node the last several years. IMHO the primary valuable components are making it free to implement the commenest kinds of concurrency correctly. I.e. most programmers don't even know they are doing it, other than "Oh I have to use `await` here". Even in something as simple as Go, you still have to intentionally set it up. And in Java, I run into very slow very low volume apps all the time because programmers don't realize they added a blocking call somewhere.
Re:The Deno Company by kybernetikos on Tuesday March 30, 2021 @04:48AM (#26632393)
> I don't think the NPM ecosystem is as valuable as people think it is

I generally think the NPM ecosystem is pretty cool, but I have noticed that even simple stuff like creating a RESTful service doesn't seem to have stablised in the ways I would have expected given node's target audience, and you end up writing a lot of the boilerplate yourself. Hopefully this will result in hundreds of replies telling me how I should be doing it, but even the fact that it's not trivial to find that out is a sign of a fragmented ecosystem.

Re:The Deno Company by notJim on Monday March 29, 2021 @01:07PM (#26624916)
> Most of the packages on NPM are complete garbage

And don't do anything. I'm amazed by how often I read the source for a package I'm interested in, only to find it's about 10 or 20 lines of code.

The convenience of adding a package means that if you're not sure how to do something, you can easily just add a package to do it rather than figuring out how to do it yourself. A lot of the time, you can just read the source and adapt it rather than installing the package.

Re:The Deno Company by ggregoire on Monday March 29, 2021 @02:46PM (#26626426)
So if you need that package in your 10 projects, do you copy those 20 lines of code in your 10 projects? Yikes. Then what happens when it requires a change? Do you make the change in all your projects? Double yikes. When it becomes 30 lines, do you still copy/paste those 30 lines in all your projects? Do you also copy/paste the tests related to those 30 lines in all your projects? ...

Having reusable code wrapped into packages is basic software engineering.

Re:The Deno Company by nightski on Monday March 29, 2021 @10:21PM (#26630672)
Or you create a library which contains a collection of 10-20 line of code modules and share it among your projects.
Re:The Deno Company by ggregoire on Monday March 29, 2021 @11:27PM (#26630995)
Yes I agree it's better to have one library with 20 helper functions than 20 libraries with 1 function each. Think Lodash.

Although some people will then complain about the size of the library...

Re:The Deno Company by speedgoose on Tuesday March 30, 2021 @12:37AM (#26631302)
Yes. Every Lodash function is available in its own npm package too. I use it like this, I rather have 4 lodash packages than the big whole lodash library in one package with almost everything left unused.
Re:The Deno Company by Master_Odin on Tuesday March 30, 2021 @09:31AM (#26634394)
These will go away in v5 (if a v5 is ever released) and is not recommended if using a bundler as it'll end up wasting space rather than saving as it'll include duplicate code that each individual function could share.

https://lodash.com/per-method-packages

Re:The Deno Company by speedgoose on Wednesday March 31, 2021 @01:43AM (#26643900)
Thanks for the information. I think it will be about time to completely remove lodash from my code bases.
Re:The Deno Company by runawaybottle on Tuesday March 30, 2021 @02:38AM (#26631753)
JS libraries only did that to reduce bundle size being sent to the browser. It’s done out of necessity, not because it makes any sense.

Exporting out one method at a time is pretty absurd.

Re:The Deno Company by speedgoose on Tuesday March 30, 2021 @02:58AM (#26631851)
Lodash has a lot of features that are not needed anymore or even dangerous sometimes. If you don't need them, why would you install them?
Re:The Deno Company by runawaybottle on Tuesday March 30, 2021 @03:18AM (#26631968)
Because it’s simply not a big deal on the server.
Re:The Deno Company by tomxor on Monday March 29, 2021 @07:24PM (#26629582)
I'm not afraid to say I agree with you, i'm not sure why you are being down voted... This is one of the attributes that is part of my argument against NPM, packages which are at the extreme end of too small, delivering almost no value at the cost of a lot of risk.

This is also an opinionated subject, and as with most things in life there is a balance somewhere in between the two extremes. However the NPM packages you refer to (and yes I have seen the <10 line offenders you refer to) are clearly at a stupid end of extremely useless shared code that amount to the most trivial stackoverflow JS examples.

In response to the sibling comment on duplication: all I can say is that it cuts both ways, deduplication to the extreme also has downsides: when someone changes that code you don't control, it now affects a large number of dependencies that the author may not care about. But even ignoring those issues and assuming you package-lock everything and never look back, extreme de-duplication in general can result in highly illegible code due to a lack of holistic view: whether it's achieved with thousands of tiny external packages or thousands of tiny 3 line functions in the same file - many have covered this topic in detail before, deduplication for deduplication sake never ends well, abstractions always have a cost.

Re:The Deno Company by brundolf on Monday March 29, 2021 @10:46AM (#26622466)
I think the JS ecosystem has such a huge amount of raw developer-attention that even if Deno only gets 10% of the market, that's probably enough to bootstrap all those foundational packages/frameworks.

Also: if you're porting from Node, the only things that really have to change are the system/IO API calls. The import style is a bit different but that could pretty much be automated. It's still just TypeScript at the end of the day; your core logic will be the same.

Re:The Deno Company by Freknf on Monday March 29, 2021 @10:17AM (#26621940)
>All in all Javascript interpreter is becoming something like a JVM. Everyone wants to use it but without writing vanilla Javascript.

Except not because lots of people prefer to write JavaScript and those other JVM languages are usually less verbose rather than more verbose.

Re:The Deno Company by sublimefire on Monday March 29, 2021 @10:47AM (#26622490)
But why people create Coffescript, Typescript, Kotlin (which compiles to JS), and many more? Why are we compiling ES7,ES8,ES9 to compatible version of basic javascript then? Why do we use wasm?

I think this shows the lack of willingness to write a vanilla, all-compatible javascript. Also it seems people use new features without understanding how those get compiled to a lower version.

Sorry when I meant vanilla I did not mean ES9.

Re:The Deno Company by oblio on Monday March 29, 2021 @09:41AM (#26621366)
I think raw (framework-less), modern (no J2EE, Spring) Java is most likely a much better language than raw, modern Javascript.

Plus, aren't Deno libs compatible with Node libs?

Re:The Deno Company by sublimefire on Monday March 29, 2021 @10:07AM (#26621759)
> much better language

Maybe but who cares when your code does not execute instantly on Lambda and requires you to use GaalVM to convert bytecode to binary. Besides you have a lot of people who would say Kotlin is better.

Javascript, like Python wins here. Well Javascript kind of wins because it is interpreted but devs do not use it directly but rather with a bundler/compiler.

> Plus, aren't Deno libs compatible with Node libs

Not really, if your dependency relies on say `https` module then it'll not work on Deno as it does not have it. And in the case of Deno modules, they are not on `npm` to begin with but even if you import them then they are written in Typescript.

Re:The Deno Company by murukesh_s on Monday March 29, 2021 @10:36AM (#26622285)
Better language or not Java is reigning king in enterprise companies. We have built our platform on top of Node.js assuming it would gain popularity but Node.js is nowhere near production use in large enterprises. Somehow the enterprise adoption has been miniscule. JVM performance is top notch. Many features like distributed transactions, messaging support, official libraries for enterprise applications like SAP is severely lacking in Node.js and hindering its adoption in enterprises.