r/node • • May 13 '20

Deno 1.0 is released!

https://deno.land/v1
364 Upvotes

133 comments sorted by

8

u/kszyh_pl May 14 '20

Everybody admires the safety flags most. But I don't see a big problem to introduce it to NodeJS in the future too.

3

u/Nullberri May 14 '20

Not sure you get anything from the safety flags. Same concept on andriod and it hasn't slowed malware one bit.

1

u/lcasdev Jun 10 '20

And iOS had it from the start and it works great. This is nothing you can just add after the fact.

1

u/Nullberri Jun 10 '20

There is a pretty big difference between "I can only write to my app space" and "I can write to entire phone drive".

Apple apps cannot ask for the latter, but deno apps will mostly be asking for that "your entire harddrive" style of access. Which is why its not really "Access" control as both legitimate and malicious apps both want that.

1

u/lcasdev Jun 11 '20

The read, write and net flags have allow-lists that you can use to restrict permissions. The permissions are not binary. https://deno.land/manual/getting_started/permissions

86

u/nasgunner May 14 '20

the number of articles with 'deno is nodeJs killer' as a title is just mind blowing

34

u/Potato-9 May 14 '20

Mate this is our next 2 or 3 years at least.

I think it looks like solid progress, the security flags are a gimmick imo but it's definitely got it's niche. I wouldn't be surprised to see deno canibalize nodes build system and npm before applications.

34

u/190n May 14 '20

the security flags are a gimmick imo

Really? To me those are one of its best features. I don't want any random package to be able to steal my ssh keys.

23

u/Potato-9 May 14 '20 edited May 14 '20

Me either but it's specified at run time for the whole process and any complex app is just going to grow many permissions. I don't see any improvement from just mounting your code in a node container.

Edit* with WSL2.0 coming to Windows home, nix has many container options npm could roll out a new npx like command that mounts your code in a container and do this seemlessly for you. It would replace nvm as a side effect.

1

u/cannotbecensored May 14 '20

not true at all, almost all apps, no matter how big, only require reading and writing to a single folder or accessing a few port/hosts

14

u/EarlMarshal May 14 '20

I think you two guys just have completely different use cases in mind.

6

u/throwawayzeo May 14 '20 edited May 14 '20

Or not: https://github.com/denoland/deno/issues/2318

The "security" from the permissions is bypassed by a simple symlink ...

0

u/jfnxNbNUwSUfv28ASpDp May 14 '20

Ok, so there is a bug. What system doesn't have and has never had bugs? Should we just abolish all security mechanisms because they might contain bugs and thus not be 100% bulletproof?

0

u/throwawayzeo May 15 '20

That's not a bug it's a major oversight. There is no security if that's the types of issues that still exist in the permission model.

1

u/jfnxNbNUwSUfv28ASpDp May 15 '20

Per definition, it's a bug. It may be a severe one, but a bug nonetheless. If you'd rather have no security at all, then fine - noone will stop you.

Btw I hope you're browsing Reddit via HTTP and not HTTPS, because there was a [major security vulnerability in OpenSSL six years ago] and clearly by your standards it should thus not be used.

1

u/throwawayzeo May 15 '20

That's like saying that building a "secure" house without a door is just a little bug.

If you are building something that you call secure, you have to be informed enough to actually implement protections to common threats.

If the bar that we are at now is symlinks, I don't even want to think about the amount of vulnerabilities that still exist in this supposedly "secure" programming framework.

Calling something secure while it is way, way too young and vulnerable to be anything like secure is simply false advertisement and comforting your users in a false sense fo security. Period.

4

u/FormerGameDev May 14 '20

As Potato-9 says, it seems to be not granular enough to really allow that, and making it moreso is probably something that will just end up with people adding every permission asked for until the thing starts working.

It looks like if you allow a deno process to have disk and net capability, you're allowing that for the entire process -- not at a package level, per process -- and you're allowing it for everything that the process would have access to as the user it is running as. So, you're really not gaining a whole hell of a lot of anything. Any process that can access disk and net could steal your stuff.

-6

u/draganov11 May 14 '20

Because it will be. Node is outdated and many people are moving away from it to SPA's like ract/angular deno is more modern and can go much better with react/angular.

3

u/[deleted] May 14 '20

Just like Node was going to kill PHP, Deno will do about the same.

20

u/r0ck0 May 14 '20

So I get the "packages are URLs" thing... but what I'm still not sure about is... is there an efficient way to find out what packages exist (in one place), and get their URLs?

NPM workflow is:

  1. Search on https://www.npmjs.com/

  2. Paste the npm i <packagename> command into a terminal.

What about Deno?...

  1. ???

  2. Paste the URL into deps.ts/deps.js as an export, and in the rest of your code, import from there.

I see there's https://deno.land/x ... but the list is small enough it just fit them on all one web page immediately. I guess it's still early days, but I'm not sure if setting up a competing registry system is going to help adoption.

Maybe there should be some kind of flag that package devs can put in package.json or something that marks as "works with deno". And then maybe NPM can modify their website to:

  1. Tell you if a package works in Deno or not

  2. If it does, somewhere near the npm i text you can copy already, also add a version for the Deno import

I think if there isn't an easy thing like this, it's gunna be tedious having to look for packages in 2+ different places.

Also if a lot of the packages available on NPM aren't going to work, and I want to switch to something other than Node, it'll probably be Rust. Although I do see some talk in the Deno github issues about compiling to binary, so that's a pretty cool thing to keep an eye on.

10

u/MyHarvestLife May 14 '20

I get what the author is going for regarding packages, but I don't really think it'll catch on. NPM, for all it's faults, is INCREDIBLY useful and honestly I think it's a big reason why node is as big as it is.

There are some very valid things that deno is trying to address, but I just don't know how well it's going to catch on compared to node's incredibly friendly ecosystem.

1

u/30thnight May 14 '20

Works well enough for Golang.

I don't see why it wouldn't work

3

u/robotmayo May 14 '20 edited May 14 '20

Works well enough for Golang.

Golang has been on fire for the past few years because of this decision.

2

u/Glowreus May 14 '20

I haven’t touched go after URL imports. What’s the biggest complaint of this system ?

4

u/Potato-9 May 14 '20

Have you actually written rust? I want to learn it and like what its about. Its absolutely not a "just use rust" step from "I know JS"

That package thing is a bunch of problems. Discover-ability is different from a registry or tooling to get the things. NPM because kingmaker over time but it's not a given that where you find info is the same as the install location or the tool you link them up with. I mean look at `git clone`. That's the tool, where you find the project is anything and the actual clone url is different again.

Very purposely not trying to solve that problem is a good idea IMO.

1

u/r0ck0 May 14 '20

Have you actually written rust? I want to learn it and like what its about. Its absolutely not a "just use rust" step from "I know JS"

Yeah, that's a fair comment.

I've only just started learning it. So I haven't done much aside from some tinkering and going through this guide: rust-for-node-developers

Really liking it so far though. And yeah I know that sometimes it doesn't make sense to compare, seeing it's more of a low-level + systems language. But it seems there is a decent chuck of people using it for higher-level stuff like website APIs etc.

I really like the compile-time safety guarantees. For me it seems worth the extra effort, for my own projects at least. I doubt I'd be recommending it for any of my clients' projects though.

And the idea of just having small binaries I can distribute is really appealing.

Basically my project is a big monolith, which does a lot of CLI stuff to process data and stuff like that, but also will be the backend for most of my websites. Being able to break some of it up into separate binaries (but all from same codebase) would be really nice. Especially when it's generating some of its own code, which really gets screwy when I've got a bug in my code-generation code. Not really feasible to split up as easily with a bigass folder of .ts + .js + node_modules files.

That package thing is a bunch of problems. Discover-ability is different from a registry or tooling to get the things. NPM because kingmaker over time but it's not a given that where you find info is the same as the install location or the tool you link them up with. I mean look at git clone. That's the tool, where you find the project is anything and the actual clone url is different again.

Well I don't really care if it's on the deno.land website or elsewhere/by somebody else. Just as long as there's something central which has everything in one place. And I'm not saying I know the solution, just that it seems like it would be annoying to me otherwise. Having it all on https://www.npmjs.com/ seems like the easiest thing to me though.

Very purposely not trying to solve that problem is a good idea IMO.

Yeah maybe. I dunno. I do really like the Rust community's approach though of rustc/rustup/cargo/crates.io all have close/official ties. I'm not even really sure what the relationships are exactly, but it feels pretty cohesive, and I think it's helped the language become so popular in such a short time, with devs from both ends of the low-level/high-level code spectrum.

Don't know much about Golang - but I've heard that the situation for publishing/finding packages there isn't as easy as it is with crates.io and npmjs.com

2

u/auto-xkcd37 May 14 '20

big ass-folder


Bleep-bloop, I'm a bot. This comment was inspired by xkcd#37

1

u/Potato-9 May 14 '20

Yeh I don't know anything about go, if I'm going to learn any systems language it seemed like rust should be it. I want it to be better in the embedded space because I like using js n microcontrollers, rust would be a nice level down without using C

55

u/[deleted] May 14 '20

Oh node you didn’t!

27

u/MrPancholi May 14 '20

I deno it was coming out today!

11

u/esthor May 14 '20

You’re done.

9

u/samagl94 May 14 '20

Node, node yet.

21

u/robotmayo May 14 '20

I want to give it a shot but the package management situation is bad. Go tried the URL thing and it failed pretty miserably. Not sure why they decided to head down that same currently still on fire route.

2

u/recycled_ideas May 14 '20

Because package management is hard, and like all hard things all implementations will have their own issues.

When all implementations have their issues people will constantly feel compelled to reinvent the wheel to create a new and perfect solution.

The problem is misunderstanding the problem.

From a technical point of view, npm actually works pretty well. It handles the hard bits fairly well and delivers what you want and expect.

The problem with npm has always been process based, and those are a lot harder to fix, particularly in any new organisation that might replace it.

22

u/franleplant May 14 '20

TSC must be ported to Rust. If you're interested in collaborating on this problem, please get in touch.

Hype! This is what js ecosystem needs, system level tools made in system level programming, doing a perf critical tool like babel and typescript in js makes no sense except for adding more js contributors

7

u/ancharm May 14 '20

This project already looks to have a solid head start in that area:

https://swc-project.github.io/

-13

u/cannotbecensored May 14 '20

is typescript slow as fuck because it's written in JS? That's my #1 complaint against TS. It's so slow on big projects that it's not even worth using, you're not saving any time.

9

u/r0ck0 May 14 '20

you're not saving any time.

Yes I am. Fucktons of it.

2

u/franleplant May 14 '20

Che swc project to see how it compares to babel. AFAIK there is no beating an optimizing ahead of time compiler when dealing with trees, traversing them and running operations on them (like the thing that parsers and type checkers do)

1

u/franleplant May 14 '20

Also AFAIK these operations are always proportional to the program’s length, so the bigger the program the longer the time it takes to parse, typecheck, optimize etc. I.e. the rust compiler takes more than a few minutes to compile, don’t remember exactly

37

u/Randolpho May 14 '20

I hadn't heard about Deno before today.

So, based on my read, this is a redesign of Node using modern concepts that didn't exist when Node was first created?

Could be potentially useful.

But as I read further... I see a glaring issue that will keep me from ever using it: importing directly from urls.

Horrible, horrible idea. Even their suggested fix is absolutely horrible for production level code.

My take: Deno appears to be a fine for sysadmins to build scripts that are more complex than a shell script can handle, but I sincerely do not see it ever being used for major applications such as web or even CLI applications.

29

u/GrandMasterPuba May 14 '20

My take: Deno appears to be a fine for sysadmins to build scripts that are more complex than a shell script can handle, but I sincerely do not see it ever being used for major applications such as web or even CLI applications.

I feel like I traveled back in time a decade to when people were writing commentary on Node. Yet here we sit in a Node subreddit.

5

u/Randolpho May 14 '20

I adopted node relatively early, about 2011ish, and I don’t remember that sort of talk at all.

If anything, the primary talk about node that I recall was how single-threading affected using it as a web server and other general sorts of bitching about lack of a thread-per-request model.

35

u/queen-adreena May 14 '20

Deno: "Free yourselves from package.json and lock files"

Also Deno: "How do you protect your imports from URL changes? Use a lockfile!"

19

u/ewouldblock May 14 '20

"If go is doing it it must be good!"

24

u/deadidentity May 14 '20

I still can’t believe go doesn’t get more grief for this. It’s my primary obstacle to adoption.

3

u/_ante May 14 '20

You can do vendoring which is first class citizen feature in GO, or use a module proxy which intercepts and caches modules - Once your resolve a module, it will be cached forever by the proxy, and your dependencies will become immutable and won't break if an URL becomes dead or changed. Module proxies are also first class citizen in GO :-)

10

u/AnAge_OldProb May 14 '20

Ya but those are all bolt-ons to the existing module system that took years of begging from the community to get. Those features are still technically pre-release despite existing for 2 years and library dependencies being a solved problem in nearly every other language for at least a decade at this point.

Why make the same mistakes twice when you need to reintroduce the same features you sought to initially ignore (vendoring - node_modules, proxies - central registries and alternate registries, and lockfiles).

Go also doesn’t have the duplicate library problem because it only allows a single import of a library whereas JavaScript is the Wild West and let’s you import the same lib at all of the versions in your app.

1

u/[deleted] May 15 '20

But with Deno, you are in control.

31

u/Potato-9 May 14 '20

It's as reliable as you trust npm to be

5

u/Randolpho May 14 '20

Except that it’s done at runtime rather than at build time, and I have to embed the urls in my code as string literals.

24

u/Potato-9 May 14 '20

No it's cached so it's only the first run time, which is conceptually the same as a build. That deps.ts suggestion would solve littering URLs around the code.

What's more that cache is on your system so other projects can hit it, if it run once it'll run offline again.

8

u/Randolpho May 14 '20

No it's cached so it's only the first run time, which is conceptually the same as a build.

Um, no.

Hell no.

First run is not the same thing as build. It's not even close to the same thing as build.

0

u/[deleted] May 14 '20

[deleted]

2

u/jfnxNbNUwSUfv28ASpDp May 14 '20

The comment you replied to has the solution you're hoping for in its second sentence...

0

u/[deleted] May 14 '20

[deleted]

4

u/Randolpho May 14 '20

That's exactly the case. It's not a solution, it's a code structure approach suggestion.

Don't use package.json files, roll your own. Don't use package-lock.json files, use the --lock command line switch.

This whole thing smells like somebody got mad they couldn't get their pet project's name in npm because somebody else had already claimed it so they said fuck it, no package managers at all!

2

u/jfnxNbNUwSUfv28ASpDp May 14 '20

Well no, it's not the case. It's their suggestion, yes, but it's already part of Deno. You can right now use Deno and create a central file like deps.ts to manage your dependencies. The problem with package*.json is that it is inherently tied to npmjs.com. It just hides the fact that you always implicitly prepend that to whatever package you're importing. With a URL-based approach, the ecosystem is more open and pretty much everyone can host their own package repository if they choose so.

There are also import maps, which as of yet are only available in an unstable version. They will utilize a concept similar to package*.json but without vendor lock-in.

2

u/Randolpho May 14 '20

So... it's package.json with extra steps?

→ More replies (0)

0

u/[deleted] May 14 '20

[deleted]

8

u/daniels0xff May 14 '20

Keep your cache inside the container as well? Cache basically equals node_modules.

0

u/[deleted] May 14 '20

[deleted]

2

u/ematipico May 14 '20

One clarification about the downloading part. Deno has a command that downloads all the scripts imported with URL. It can be run before running the code.

-5

u/cannotbecensored May 14 '20

literally has nothing to do with deno. you just dont know how containers work. just bind mount the deno cache folder and then this folder keeps its state even if the container is removed. that's containers 101.

Or just preinstall the deno cache in your actual dockerfile.

1

u/Randolpho May 14 '20

Or just preinstall the deno cache in your actual dockerfile.

How do you go about doing that?

You have to run the application to get the cache in the first place, right?

1

u/lcasdev May 14 '20

Take a look at the ‘deno cache’ subcommand.

2

u/Potato-9 May 14 '20

Yeh you run the application with the output path for the cache as you build the container. Then you've a working app container.

Are people seriously just going `npm install` and pushing the container to production? no testing or anything?

Think of it this way, deno removes the install step, just get the code then run it. If you need it to never change, cache what runs. That's still everything node does.

→ More replies (0)

1

u/FormerGameDev May 14 '20

they literally said "unless you're doing volume-mapping or something for durable persistence", why are you saying they don't know how containers work, then explaining to them exactly what they said?

Preinstalling the deno cache in the dockerfile leads to exactly the same thing, every time you start a new container, you have to also do the installation.

Neither of this are particularly good answers to a situation where given what we use currently, we can just straight up copy the built code into the container, and run it.

0

u/fzammetti May 14 '20

Your first suggestion is retarded and wouldn't fly in any decent containerized environment. Your second is basically what I said in the end. Try reading better next time and not being a dick.

6

u/cannotbecensored May 14 '20 edited May 14 '20

embed the urls in my code as string literals.

No you don't, you can do it once, exactly like a package.json. The whole point of allowing URLs is not to get rid of package managers, or package.json, or lock files. It's to allow anyone to make a package manager and win marketshare based on merit. No one can compete with NPM in node, it's too embedded in the system.

It's also to allow more flexibility. I like a package manager, but I also like the option to seamlessly not use one when I feel like it.

1

u/queen-adreena May 15 '20

No one can compete with NPM in node, it's too embedded in the system.

Have you met Yarn?

1

u/NoLanSym May 14 '20

Tbh the future is runtime

1

u/Randolpho May 14 '20

how do you figure that?

1

u/NoLanSym May 14 '20

Scaling around asynchrony, federated modules, and edge compute is a future being written right now :) https://github.com/Jordan-Gilliam/module-federation-ssr

-1

u/dawar_r May 14 '20

Don’t understand why more people don’t get this. Honestly do you think npm packages just fall out of the sky?

4

u/dzkn May 14 '20

importing directly from urls.

The question is whether you trust the repository or not, which isn't any different from how any package manager works. They all fetch code from a URL.

12

u/Ashtefere May 14 '20

It's the same as doing an npm install. It loads one time and is saved as a dependancy with the project.

-11

u/Randolpho May 14 '20

It happens at execution time not during the build process, and there no remediation between.

12

u/Ashtefere May 14 '20

Incorrect. You can precache them before execution.

2

u/Randolpho May 14 '20

I only glanced through the documentation, so I must have missed that part.

How do you do that, when there is no install/compile step? Do you call your program with a special flag to tell it “only analyze and install dependencies”?

0

u/[deleted] May 14 '20

[deleted]

4

u/Randolpho May 14 '20

That didn’t answer my question and directly contradicted the previous comment.

0

u/[deleted] May 14 '20

[deleted]

4

u/Randolpho May 14 '20

That conforms with my original understanding. But /u/Ashtefere explicitly stated that you can precache before execution.

So, which is correct?

0

u/[deleted] May 14 '20

[deleted]

→ More replies (0)

-1

u/newTwiffy May 14 '20

True! But hey I am glad people are doing something to get out of this dependency hell, maybe this is not the right way, but it's one step, its first step to something better. Point is everything is evolving and we should be happy about that! 😜

2

u/ecares May 14 '20

Well, there is a massive vulnerability in it already :D https://github.com/denoland/deno/issues/1063

1

u/kszyh_pl May 14 '20

And as you can see, the devs didn't really care about it.

1

u/lcasdev May 14 '20

This is such a stupid issue though. I can also say ‘what if npmjs.org’ has a MITM attack? It the exact same problem. You guys are forgetting that every ‘npm install’ downloads all dependencies via URLs from npmjs.org too.

1

u/zokker13 May 14 '20

What has that to do with the linked issue?

2

u/ecares May 14 '20

Wait, Denos was supposed to be about security right?

3

u/budapestgame May 14 '20 edited May 14 '20

“Deno comes from regrets in creating Nodejs” : NodeJS is my bastard child with my ex-. Deno is the newborn with my new girlfriend.

Permission flags: to enlighten those who haven’t seen that Rust is more “secure” than C++, let’s introduce “security” flags. I know they’ll be using —allow-all anyways.

Importing from URL: package.lock is a disaster. Why trust npm when you can decentralize and trust the power of people. Oops... they are all using Github to host their code! The next logical step is package-at-github.lock.

5

u/[deleted] May 14 '20

The only compelling thing for me is typescript. Rest I don't care. Nodejs is a proven tech and I will continue to use node in every project in production.

2

u/jfnxNbNUwSUfv28ASpDp May 14 '20

By that logic you could've stuck to Assembler, C, COBOL, Java or whatever. They're all proven tech, so why ever try something new?

3

u/zokker13 May 14 '20

What's the argument for Deno? From the blog post I can find:

Furthermore the mechanism for linking to external libraries is fundamentally centralized through the NPM repository

You can use a git repository in nodejs, similar to Deno's approach.

involving managing build systems and other heavy handed tooling

Node doesn't have tooling you have to use so I don't really get that point..

I'll grant that the sandbox idea is neat. But I question the usefulness of it. I need to think of using it to make it work. With more overhead I could use docker which many people use anyway. I'm sure node will add support for WASI which then implements sandbox behavior, too.

The other things, like

  • Typescript

  • Promises

  • Stability

are things I can achieve with nodejs.

Deno is lacking what nodejs already has: A huge community with trillion of packages. So why should one bother?

1

u/FormerGameDev May 14 '20

i didn't really pay too much attention at the time, but the Node/Io.js split was also characterized by a lot of people on one side going "but what we have already works" and the other side going "but this is a step to the future".

Of course, a major difference here, is that one is not a fork of the other, but a completely different implementation, so one won't be completely absorbing the other anytime... but one might absorb features similar to each other over time.

Deno is moving forward in a vastly different way. As to whether that way is better, or more useful, or will be better, or more useful, I couldn't really say, my crystal ball is at the shop, and they are closed for quarantine.

1

u/zokker13 May 15 '20

Deno is moving forward in a vastly different way.

Is it moving in such a different way though? I mean, you don't even have to use npm or rely on node_modules for nodejs. It's just convenience. Going native means using rust which I think is a plus for deno. Everything else just seems very similar.

1

u/roundgeese77 May 15 '20

I'm not really sold on the idea of Deno, yet. I think now that it has reached 1.0 and start getting a bit more widespread we'll start to see a lot more what it's capable of and what kind of tool it can be used as.

But I really don't like this line of argumentation. Picking 2 things from Deno that Node can do/does better in no way invalidates Deno. They are alike but not the same. As someone else in the thread said in response to "this will fill the same place as rust, just use rust", do you have any idea how hard it would be for a team of js developers to just learn rust to use in projects. This is a huge + in my book, familiarity matters.

One obvious thing your totally ignoring is the safety aspect. Even though it might not be for you it's a big difference to Node's approach. I also really like the root-async (can't remember what it's called more technically right now), I think that adds a lot to readybility and can untangle some nasty code.

1

u/zokker13 May 15 '20

familiarity matters.

It's true but Deno doesnt really have something that's unknown to the nodejs world. The major drivers for Deno seems to be Typescript and rust which can both be used within node.

One obvious thing your totally ignoring is the safety aspect.

You mean the --allow-network flags? I didn't ignore those. I just question their usefulness. Don't get me wrong, that direction is the right way. But I don't see how that's Deno's thing to do. That's why I said it's a gimmick at best. You can limit your local scripts that way which is nice. But something like a service is wrapped in container structures anyway. Going proprietary here seems like a poor choice.

root-async

You mean that's it's promise based? Or does it wrap modules in an async function automatically?

0

u/jfnxNbNUwSUfv28ASpDp May 14 '20

One major improvement Deno gives IMO is a new and improved standard library, modeled after Go's (which I happen to like).

Besides, Node has had more than a decade to build its ecosystem while Deno has had a mere two years sincs its very first prototype. I'm not saying you should use Deno right now in production, I'm saying it has potential and I'm interested in seeing it develop further.

My original comment was regarding "Node is a proven tech so I will continue to use it" though, which I don't find to be a very smart statement.

1

u/zokker13 May 14 '20

Could you elaborate on the standard library or some key take-aways? I'm not familiar with the way go does things. But from a quick look at it, it doesn't look much different from the libraries node ships - but it sounds like I'm missing something obvious :s

My original comment was regarding "Node is a proven tech so I will continue to use it" though, which I don't find to be a very smart statement.

I agree, that's kind of a bogus statement to make.

2

u/[deleted] May 14 '20

I'm talking about Javascript ecosystem here. I have always liked Javascript and recently I have started working in typescript which is really great. So the only benefit of Deno for me is that it supports typescript out of the box. I don't see any other benefits to learn it tbh. Also docs aren't that detailed, I know its a start, deno will evolve nd so will its docs, then maybe I can see how this can be useful for me.

2

u/jfnxNbNUwSUfv28ASpDp May 14 '20

That I can agree with. I'm also not really using Deno at the moment because it still has some quirks and deficiencies that will hopefully be ironed out over time. IMO it's just too early ATM.

2

u/FormerGameDev May 14 '20

Rather than be in either the "this is awesome" or "this is terrible" camp, I'd like to pose a question that will hopefully be useful:

So, we know that "most" node packages aren't going to run in Deno straight out of the box (well, out of the npm repo) .. so.. what do authors need to do, to make their projects compatible with Deno?

Particularly, I am maintaining a library that I'm trying to make sure that it runs on anything that's possible to run it. It runs well in node, it runs well in browsers, i'm trying to figure out how to also make it compatible with ES6 imports both in node and browser, I might as well throw in "making sure it runs in deno" as well, right?

1

u/FormerGameDev May 15 '20

I'm curious why i'm getting downvoted.

0

u/forsubbingonly May 14 '20

It doesn’t require me to compile my typescript but does compile the typescript, taking exactly as long as it would take me to compile it. Installing typescript and having a call to tsc as a pre step to running things isn’t enough of a win for me to care about this yet. Given it can’t handle npm packages it might as well not be released at all. JavaScript is bad enough without taking away the only redeeming part of this ecosystem. 1.0 is when you figure that out and this is a beta until you do.

5

u/[deleted] May 14 '20

I dont see how Javascript is bad.

-2

u/cannotbecensored May 14 '20

javascript has literally become one of the best language in the last few years, only retards still think "it's bad"

-1

u/draganov11 May 14 '20

Its not that it cant handle npm they didnt want it to. npm requires you to have big node_modules folder one npm package might be dependent on 10 others its outdated.

4

u/Randolpho May 14 '20

I can't see how deno solves that, though?

If you import some foreign module and it imports some other foreign module, you're still in the same dependency hell.

1

u/draganov11 May 14 '20

Solves it by not having large node_modules folder. Modules are cached in your hard disk

2

u/Randolpho May 14 '20

That sounds a lot like a node_modules folder.

1

u/jfnxNbNUwSUfv28ASpDp May 14 '20

Yes, but it's one node_modules folder for the whole system. You can get rid of duplicated dependencies per project, which can be especially valuable when using service-oriented architectures.

2

u/Randolpho May 14 '20

That seems counter-intuitive. If I'm using a service-oriented architecture, the last thing I want is unused dependencies polluting my service's filesystem

1

u/jfnxNbNUwSUfv28ASpDp May 14 '20

That isn't happening. Your machine has a central cache which is like a unified node_modules folder for all projects you run on that machine. In the case of a VM or container, all you run on that "machine" is one single service, so no shared dependencies with other services.

2

u/Randolpho May 14 '20

So you're stuck always using npm install -g

1

u/jfnxNbNUwSUfv28ASpDp May 14 '20

No, not in the slightest. The two are not the same. A global NPM install doesn't add a project dependency, which means installing dependencies on another system will result in your global dependencies being missing.

→ More replies (0)

1

u/jfnxNbNUwSUfv28ASpDp May 14 '20

But the dependency hell is shared among all projects on a particular machine. In addition, Deno provides a vastly improved standard library, which (hopefully) will make a lot of one-liner packages obsolete, reducing the amount of dependencies.

1

u/Randolpho May 14 '20

That's not a solve.

An improved standard library is good, but that's not enough.

1

u/jfnxNbNUwSUfv28ASpDp May 14 '20

It might not be a solve, but I'm going to take Deno's "good" standard library over Node's outdated one any day.

-4

u/Realistic_Comment May 14 '20

This is even worse than npm, I didn't think that was possible

-3

u/jfnxNbNUwSUfv28ASpDp May 14 '20

You're comparing apples to oranges.

-9

u/[deleted] May 14 '20

So NodeJS for typescript hipsters? Big Deal.

-2

u/NoInkling May 14 '20

Is the "Deno dino" mascot new? I haven't noticed it before.

-1

u/EEvonzz May 14 '20

Node too shabby

-6

u/draganov11 May 14 '20

I see a lot of potential when support for angular/react get added.