Live data from Hacker News

Deno 1.20

deno.com

21–30 of 60 posts

Re: Deno 1.20

#21
post #16

I love working with JS/TS (front, back, tooling), but find Node more and more annoying (especially bothered with packaging a release for production, lately). So naturally I tried Deno lately. Some things mentioned in other comments were really nice, but the lack of retrofit with the Node ecosystem is a shame. So many years and efforts and community growth are sitting right next door only to be ignored... I can't unde…

I haven't used Deno myself yet but I'm very interested. Deno has a whole section about Node interoperability in their manual that makes it seem like you can use Node packages, but I have yet to test that out myself. Curious if anyone else has

https://deno.land/manual@v1.20.1/node

Re: Deno 1.20

#22

What is the reality of Deno now? I remember when Deno was being developed it was promoted like how Web3 is being promoted right now. But browsing through hundreds of job posts I have not seen anyone having Deno as a requirement. Everyone wants Typescript+Node and that's about it. Size of community, enterprise use and approachability as the first framework to learn. I think these 3 factors determine the success of any…

[deleted]

Re: Deno 1.20

#23
post #2

Has anyone tried switching from Node to Deno in an existing project? I'm personally very interested in Deno but it's hard to find a greenfield project to try it out and writing toy programs is not giving me enough insights of how much better/faster Deno is.

I'm an existing typescript user but I just can't see a reason to use Deno. Depending on the NPM repository CDN is less worrisome than depending n different CDNs. Including all my dependencies unilaterally (aka deps.ts) seems like a patch upon a bad decision. Making the server side runtime environment pretend to be or adopt aspects of the web browser client environment seems like a misguided direction in my wisdom, be…

> I sense that Deno is primarily being pushed by developers who cut their teeth in React-based code camps who are looking for (understandably) a wave to ride into "full stack" software development.

This is a really strange take. Deno isn't significantly easier to work with than Node, so it shouldn't matter much for a React code camp graduate which of those two to ride into full stack.

Deno is more appealing to seasoned web developers, who appreciate its conformity to modern web standards, the absence of Node quirks, and a better security.

Example: discussion of Deno by two Google developer relations engineers: https://www.youtube.com/watch?v=SYkzk_j3yb0

Re: Deno 1.20

#24

What is the reality of Deno now? I remember when Deno was being developed it was promoted like how Web3 is being promoted right now. But browsing through hundreds of job posts I have not seen anyone having Deno as a requirement. Everyone wants Typescript+Node and that's about it. Size of community, enterprise use and approachability as the first framework to learn. I think these 3 factors determine the success of any…

It won’t take long to get it popping. You just need a few tech blog posts from well known startup with a headline that reads ‘How we switched from Node to Deno’, and voila, the snowball just got rolling.

Copy cat culture will do the rest.

Re: Deno 1.20

#25

Looks promising and I find the Deno project very exciting! What is the recommended way of running Deno in production on a multi core machine? In node there is the cluster module that allows one process to run a cpu intensive task while the other processes to continue answering web requests. This is good for stuff like excel exports as an example on larger datasets. Obviously you could run some kind of cronjob in the…

Deno does expose the "Web Workers" standard as a way to utilize multiple cores, where communication between them is handled by postMessage(...).

However, afaik, things like sockets can't be passed through (something node can do iirc). There is a mechanism for this in the web workers spec; Transerables, that's part of the web API spec and is used to allow passing things like a large ArrayBuffer from one worker to another without needing to copy it by removing access from the sender and giving it to the receiver.

So you would have to plumb the socket into postMessage for a worker, or, for the excel example, make use of promises/async+await to spin up a worker, feed through the min. data needed to kick off the export, let it process in the worker and then send the response back to the main thread.

Re: Deno 1.20

#26

Looks promising and I find the Deno project very exciting! What is the recommended way of running Deno in production on a multi core machine? In node there is the cluster module that allows one process to run a cpu intensive task while the other processes to continue answering web requests. This is good for stuff like excel exports as an example on larger datasets. Obviously you could run some kind of cronjob in the…

[deleted]

Re: Deno 1.20

#27
post #2

Has anyone tried switching from Node to Deno in an existing project? I'm personally very interested in Deno but it's hard to find a greenfield project to try it out and writing toy programs is not giving me enough insights of how much better/faster Deno is.

I haven't done an existing project yet, but based on some experiments it seems like I'd mostly be deleting configuration files and making an import map. A simple SPA is crazy easy in deno: https://github.com/baetheus/deno-spa-example/

Re: Deno 1.20

#29
post #23

Earlier quoted context omitted.

I'm an existing typescript user but I just can't see a reason to use Deno. Depending on the NPM repository CDN is less worrisome than depending n different CDNs. Including all my dependencies unilaterally (aka deps.ts) seems like a patch upon a bad decision. Making the server side runtime environment pretend to be or adopt aspects of the web browser client environment seems like a misguided direction in my wisdom, be…

> I sense that Deno is primarily being pushed by developers who cut their teeth in React-based code camps who are looking for (understandably) a wave to ride into "full stack" software development. This is a really strange take. Deno isn't significantly easier to work with than Node, so it shouldn't matter much for a React code camp graduate which of those two to ride into full stack. Deno is more appealing to season…

"This is a really strange take."

No, this is the gatekeeping mentality of many people software development.

It's also wrong, since Deno removes many idiosyncrasies about server-side JavaScript.

Re: Deno 1.20

#30

Looks promising and I find the Deno project very exciting! What is the recommended way of running Deno in production on a multi core machine? In node there is the cluster module that allows one process to run a cpu intensive task while the other processes to continue answering web requests. This is good for stuff like excel exports as an example on larger datasets. Obviously you could run some kind of cronjob in the…

Deno does expose the "Web Workers" standard as a way to utilize multiple cores, where communication between them is handled by postMessage(...). However, afaik, things like sockets can't be passed through (something node can do iirc). There is a mechanism for this in the web workers spec; Transerables, that's part of the web API spec and is used to allow passing things like a large ArrayBuffer from one worker to anot…

Yes I am aware of that and sure it can be used for export/import like I described. But it won't answer the second part of my question, about Deno not utilizing all cpu cores on a multicore machine?

If I use a web worker it will be for one specific thing and that thing only, not for the entire web request? Thus, if there is anything slowing down the request in form of CPU intensity, it will "kill" the application at least until the cpu intensive request completes.

Sometimes it's hard to know beforehand what users do for example and surprising things can happen. I have had the same issues with Meteor for example where users killed the app because they tried to upload something unexpected that crashed the app and them spamming the upload button kept it crashing after restarts. It was of course an error from my part but it could be avoided if Meteor did support the cluster module. I have also had the exact same issue when unexpected large datasets occurred by user input (not file uploads), the app got so slow it stopped answering requests from other sources. It was after that I discovered that pm2 can run any node app in a clustered mode, which was very nice.

But with that experience in my baggage, it am very hesitant to use Deno because of this reason. I can't host my app on a serverless platform because reasons and I am not sure I even want to even if I could.

Post reply on HN