406 points · by spiros · 2y ago · 228 comments
With Slint [1] we're working on a framework which allow to make a desktop GUI in Javascript/Typescript, without bringing a browser/webview. Currently, we do it by using binaries through napi-rs so we can bring in a window using the platform native API. And then we do some hack to merge the event loops.
But if Deno supports bringing up a window directly, this means we can just ship wasm instead of native binary for all platform. And also I hope event loop integration will be simplified.
Although we'd also need more API than just showing a window (mouse and keyboard input, accessibility, popup window, system tray, ...)
Edit: I got excited a bit too early. The WebGPU feature doesn't include the API to launch a Window. One still need to rely on an extra library binary.
I apologize for this being so besides the point of your post, but I hate this trend so much.
Also why would you want to make a GUI even more bloated by integrating a browser to get webgpu and webasm (and why webgpu instead of just webGL?). That might be easy for library makers but why would someone want a giant library to make a GUI when they already have electron if they don't care about 350MB binaries to pop up a window.
Webgpu and wasm without a web browser would be a nice way to distribute portable sandboxed code.
The reason for Webgpu is that it it has semantics closer to modern modern apis like Metal or Direct X.
People doing hardware accelerated GUIs have been using openGL for almost as long. This doesn't need to be a science project or a rabbit hole, drawing a GUI quickly is well worn territory.
They're working on a project called Dioxus Blitz; from what I'm told, they're trying to implement a minimal browser target, that provides some basic DOM-like features and renders with wgpu.
It's not exactly what you're hoping for, but you might find common ground.
https://github.com/DioxusLabs/blitz
(Also, the Linebender project is working on Masonry, with FFI as a medium-term goal.)
The exe output grew from from ~50MB to plus ~90MB from 2021 to 2024: https://github.com/denoland/deno/discussions/9811 which mean Deno is worse than Node.js's pkg solution by a decent margin.
In my view, deno compile is more about shipping command line tools to people with all sorts of personal environments (which may not have deno at all)
I do wish there was support for Linux distributions based on musl (Alpine) directly for smaller containers.
In general I like the Deno approach better than Node. Would be cool to see the UI tooling flushed out. A material or fluent based component library where Deno can be used like Flutter would be very cool indeed.
If you really are pressed for space, you could use upx, or store 7z compressed code and embed the 7z library to decompress before passing it along to QuickJS.
Here's a proof of concept: https://github.com/ijustlovemath/jescx
While I agree with you that it's not optimal and should get fixed, 90MB doesn't sounds like it can stop you from deploying it either.
If reach one of my scripts was a separate build output from Deno that would be several GB of space.
I find it pretty ridicolous since I go to a website today and it's at least 15MB each time I refresh but 100MB on the server is a problem? Dude cmon.
Updates for games are large because they aren't "just updated files", but a giant blob that can't be rearranged since it's optimized for loading order later.
Giant self-contained deploys like that are bad because their use case is CLI/GUI tools shipped to the end user. To give you context: my /usr/bin is ~900 binaries and total size is 109mb.
That and that's likely 100MB that's going to be competing for memory now* , in FaaS environments especially that's a ton of resources and you increase latency to load that especially over network storage. This also inflates container sizes and just becomes a pain in general.
*Server environments you often don't want to be using swap, and the OS will likely consider it high priority anyway.
I could only agree with you if you have a single monolithic server, don't use containers, don't need to distribute it to others, and don't frequently need to run a CI/CD pipeline. Only then are there not a ton of downsides to a 10mb vs 100mb executable.
> When I download a modern game it's like 700GB so I donno why people complain about 100mb self contained deploys for javascript.
People have been complaining about game sizes for years. "You complain about a 100GB game, I don't know why you also complain about a 100mb self-executable for a javascript runtime" doesn't really make sense.
If size is such a big deal, then don't use Deno, Node or Bun.
My issue is that most people that are working in restricted environments would never touch javascript since it's not well suited for those kinds of environments. People that complain tend to be haters that just want something to hate upon.
It used to be about php, now it's about javascript.
I was forced to start coding again in JS some weeks ago and I wanted to try Deno. I must say it's been a very smooth and fast experience so far. Very well done!
TypeScript and esm/cjs usage without crazy syntax (writing modules, consuming cjs at least).
Lintinng and formatting in the box.
Can do shell scripts without package.json and nom install, just a shebang line at the top.
These are some of the things I like better.
I am not sure if I'll have the chance to exploit other features it has (besides the built-in dotenv support).
Not so many years ago, even installing npm wasn't straight forward.
It has mostly been sorted out by all package managers. The node_modules debacle is still a hotly contested topic, it creates a lot of problems, but it also solves a lot of them compared to alternative approaches.
Then you have install performance which is mostly fine by now in all package managers, but if you really have problems with it you can use pnpm or yarn2.
As the python ecosystem grows and dependency trees move away from "django only" you can see they having the same types of problems that JS used to have.
Anyway you're certainly not alone in your opinion, but I think that a lot of the bad reputation with Node and NPM comes from the amount of "change management" you need to do to "limit" the vast amount of freedom the tools give you into something that will be workable for your team. Once you get there, however, I've found it to be a much to work with than things like Nuget and dotnet, requirements.txt and python, Cargo and Rust and a lot of others. I do have a personal preference for yarn, but I guess that's mostly for nostalgic reasons. I also very much appreciate that things like PiPy are going down what is similar to the NPM route.
Alternatively, like in my ~/bin, I'll put a shell script without a file extension to make it easier on myself.
I'm curious on what the Deno team is building here.
I thought their whole thing was to maintain backwards compatibility, not introduce new, redundant standards?
Why Choose JSR? A True TypeScript-First Environment: Efficient type checking and no transpilation hassles—write in TypeScript and deploy directly.
Performance and Usability at the Forefront: With integrated workspaces and seamless NPM integration, JSR puts usability first.
Secured and Accessible Modules: All modules in JSR are exposed over HTTPS, ensuring your code is always secure.
Open Source, Community-Driven: Built by developers, for developers, JSR is shaped by the real-world needs and contributions of the JavaScript community.
Hopefully it will be closer to how Go does it.
I love this! At the same time, who would want to do this, given Python's excellent support for numbers and mathematics? And what about Haskell?
I'm writing a JavaScript bundler and need a Node.js runtime to execute plugins. Deno's executable has fantastic Node support (at least, good enough for my use case) however the deno-core crate is super barebones and difficult to embed.
At this stage I can't simply add the deno runtime into my Rust application, I need to copy/paste internal crates from the Deno executable and wire them up myself (without documentation on how).
I'd love to see expansion for my use case - Deno could become the "plugin runtime" for the JS tooling world if it had a nice embed story.
Right now I am just going with a Nodejs child process that I talk to from the Rust host process using stdio. In my tests, the stdio approach has 10x the communication latency when compared to an embedded Deno runtime (that adds ~1 second per round trip message in a project with 100k assets)
Though they’re also selling a developer ecosystem. A lock-in. Are you willing to bet your company’s own software tools on a vendor that could go bankrupt from their other (hosting) business? The question is if Deno hosting dies, will Deno as a platform still thrive?
(It's a bit trickier than that since the SQLite database holding the KV store would need to be backed up, but it seems doable with Litestream?)
that I am unsure about, a large part of the appeal at least for me is the deno deploy.
URL imports are a bit of a hassle when you are trying to get them from say a private github repo.
It's be tough, but going the other way to Node as a transition is entirely possible with relatively minor effort.
If it's a startup looking for growth then definitely. Future prospects may no longer signup because the needed region isn't available.
The fact that for the next iteration they are prioritizing view transitions and not CSS bundling is baffling.
If node.js decided to include functionality similar to what is available on Bun/Deno, both projects would probably lose traction quickly.
They create some riff, make the key incumbent improve itself, and then the world moves on as if nothing happened.
I believe this too. The big appeal for me is not having to install typescript, eslint, jest AND then set up all the configs.
deno has nice defaults, though the importing via URLS and browser compatible API do make deno very tempting
Deno Deploy just works, albeit the cold start can be slow but I'm now using an hybrid setup with Fresh routes backed by a CDN.
The dev experience is great. I've used a couple of other solutions similar (Next, Nuxt and vite-ssr-plugin) and I sometimes I need to do somethings manually that would already exist on other platforms but in the end my projects stay simpler.
I love saaskit [1] and Netzo [2]
[1] https://deno.com/saaskit [2] https://github.com/netzo/netzo
The NextJS team should be working on making NextJS run better with Deno, not the other way around. If the NextJS team doesn't want to do the heavy lifting with that support, thats on them. I think its perfectly reasonable that the Deno folks have an approximate alternative to NextJS. After all, NextJS won't use native Deno idioms for example, it'll always be tied to Vercels' proprietary cloud infrastructure.
Why should I choose Bun over Deno or vice versa?
Deno has members in Ecma TC39, so they take part in the development and standardization of JS.
Deno brings a new mentality to development focused on simplifying things, whereas Bun aims to be an improved Node.
Deno aligns with web APIs: you can use the same APIs in the browser and in Deno. Many packages work in both platforms. Deno is even in the compatibility tables in MDN.
Deno simplifies DX greatly. It's very easy to work with Deno. Easy to install things and set up a project, easy to deploy, no config files etc.
Deno is written in Rust, which allows them to move faster and more safely. Contributing to and extending Deno is a breeze. You can add Rust crates to the runtime and use them from JS.
I feel like the Bun team has been too pressured by executives and marketing. They announced 1.0 when Bun was clearly not stable enough, giving lots of segfaults. Even their readme had a huge statement right in the beginning saying that Bun was not production ready yet, despite 1.0 being hyped all over the place.
Most of Deno's code is actually V8 in C++
They also kinda have different goals. Bun seeks to be more of a drop-in replacement from Node whereas Deno, being spearheaded by the same person who made Node, seeks to move the industry forward and fix mistakes Deno made. However Deno, out of necessity, has also highly valued backwards compatibility with the Node ecosystem
If they aren't able to evolve Node.js to overcome the mistakes (e.g. because they're technical in nature, or momentum of install base, or they don't have the leadership ability), I am worried that they might repeat the same pattern with Deno, since it isn't possible to NOT make any mistakes.
OTOH, having a clean slate that's learned from mistakes and you can bring a lot of your code along doesn't seem like a major impediment.
Is code written for any of the 3 runtimes generally transferrable? I realize some won't (e.g. Deno has WebGPU support, which is attractive to me), but generally?
If you don't, focus on pointless things like Bun vs Node vs Deno, get some dopamine hits and fool yourself into thinking you are being productive.
Is it just a side-effect of using V8 engine for the heavy lifting, or is it some part of the ECMAScript specification which forbids multithreaded implementations of the language?
Cons: All your async code becomes full of data races.
I suppose adding multithreading to the Node ecosystem would be as hard (if not harder) than removing GIL from Python. At least Python has locking primitives. Node, as far as I know, has none.
Atomics are probably the closest. https://v8.dev/features/atomics
I feel like most performance intensive nodejs modules drop down to c++ where real concurrency already exists. (e.g. sharp - https://sharp.pixelplumbing.com/api-utility#concurrency)
In all of them - JavaScript is mostly used for asynchronous programs, which are easily parallelizable. There's no reason not to want multi-threading.
It's a bit low-level compared to a SQL database; you're building your own indexes and need to write transactions to update them atomically along with the main record. (But it does have transactions, so it's reasonable.) It reminds me of App Engine datastore, back in the day.
There are some fairly tight limits. (64k for records.) I wouldn't use it for storing images or larger files.
Not sure what I'm going to do for full-text search. But I've built simple search engines from scratch before.
I would love for this year to see the runtime support for either Google Cloud Functions or AWS Lambdas
It would have been nice if I had realized this aspect of technological evolution earlier in my career. I might have spent more time learning about marketing than about the actual technology.
The ultimate killer argument is always "does it improve my CV?"
CV driven development is usually the reason for questionable technology choices
So the old-timers remind us, "Choose boring technology." Reliable and boring is a good thing.
On the other hand, I recently started learning Bun, and oh what a breath of fresh air, it makes things fun again. I love that its codebase is so readable and small still, and everything is freshly designed with the insights of experience and hindsight. It doesn't have the accumulated cruft, years of decisions and compromises.
So, sometimes it's great to shed the old and grow with the new generation.
Brand reflects a project's philosphy. Deno is thought to be easy and simple, and the "childish" branding reflects that.
So you may not be wrong at all in your criteria. Subjective human communication can be more effective than objective communication sometimes ;). It just works at a different level.
It's amazing to see Deno mature so fast while staying well-thought-out, and I'm excited to use it in as many projects as I can now.
I like to run my shit on the metal and without Docker and it feels like Deno was designed to run on Docker or some other kind of virtual containerized environment.
However, you can run it on node thanks to pm2, but I guess why even run on Deno in the first place?
> Stability: 1 - Experimental: This feature is being designed and will change.
— https://nodejs.org/api/single-executable-applications.html
Deno, on the other hand, has it as a supported, complete feature that’s very easy to use:
Shout out to all my fellow hang gliders.
so we know::
- it is not about a discussion of deno being new, relevant or modern in 2023, and
- avoid thinking that the article is from 2023?
Why did he feel the need to build a competitor to his own product? Whatever features are supposed to make Deno "better" than Node...why didn't he just work on integrating them into Node?
I understand that sometimes changes to software can be infeasible, especially if they are large fundamental/foundational changes, but this is still a bit of a head scratcher to me.
Sometimes you do need to reset the foundations, then build compatibility on top.
He also can't unilaterally change them in NodeJS because at that point it wasn't a solo project of his anymore.
You can do this using containerization technology, no need to invent this per language runtime.
Not sure what's available on Windows.