239 points · by todsacerdoti · 2y ago · 160 comments
So they are taking the exact opposite approach of Electron (VS Code).
In my mind, if you're someone who types in HN comments in a rage because your text editor (VS Code) eats up 200+ MB ram, you don't get to cry about Zed not being supported on Linux from day one, because you can't have your cake and eat it too - if you want it on your platform, you gotta wait for the shaders to be written.
This is certainly one takeaway. On the other hand, this very blog post points out that a community member, Dzmitry Malyshau, did the work to get the program working on the OS he uses. Malyshau does not work for Zed, which is a for-profit company; as far as I can see, he gets nothing out of working on Zed, except that he and other Linux users get to use it. Perhaps, rather than characterizing Linux users as whiny, we could take away the idea that many Linux users are willing to put in quite a lot of work to make things better for each other.
That's more an "Open Source" thing rather than Linux specific. A personal case in point was when I got Mellanox adapter support officially added to FreeNAS (now TrueNAS) because that's the adapter brand I had and needed it to work.
Not a super huge effort as the FreeBSD driver worked (so just needed porting), but the integration process and follow up testing/advocacy/etc work wasn't exactly trivial either.
... and that even if it means signing away their rights in a CLA to a for profit company. This is on another level than contributing to the Linux kernel that is GPL2 plus practically not relicensable because of the multitude of copyright holders.
(honest question - I've never looked into it myself)
I presume what is meant is that it can handle a redraw fast enough to be in the next frame. In which case the answer is: all of them. Drawing text is not the bottleneck for a GUI program, unless you have a god awful browser stack as your rendering engine.
I can't think or type that fast and I can't read scroll back that fast either so I can't wrap my head around needing something like that.
It also seems like you can configure VSCode to go faster: https://stackoverflow.com/questions/52230196/vs-code-is-visi...
But honestly, 'responsiveness' should come from not blocking the main/UI threads, and rendering in the right order of importance.
Emacs is looking at you
Probably you can squeeze a bit of optimization out of using Metal directly, but I think it's a more than viable approach to start with Vulkan/MoltenVK as a target, and add a Metal branch to the renderer when capacity allows (although you might never feel the need)
I love working with technical people who ask why and think about more optimal paths.
On the other hand I'll listen to the same folks complain about some random app being stinky (I don't disagree) and wonder "Yeah but you going to pay more for that burrito so that company can hire folks to write it natively on every platform?" No you're not ...
I know our customers at times aren't willing to pay / wait for the optimal path, and their customers aren't, so I get it.
However if they did, the games would sell because the mac people wanted games and there were so few available they would buy anything.
problems of a closed ecosystem.
WebGPU exists. It works with Metal. Vulkan could have also worked and MoltenVK would have bridged it to Apple. No, this is just like every other project that only works on MacOS: a mentality I really can't comprehend or explain.
This is my problem with Electron applications. I'd be fine with them gobbling up a few GB if they were stable.
Unless I missed it, the video doesn't actually answer the question. They talk 38:50 onwards about how they don't want to pull in GTK / Qt as dependencies, rather they just want to be able to read the toolkits' config and render a mimicking UI themselves. Then they show the editor opening a "native" file dialog, but don't actually say how exactly they did it.
Anyway, I assumed they would use xdg-desktop-portal, and based on searching the repo that does seem to be the case.
Backends can implement a subset of the interfaces, and xdp can be configured to try multiple backends in sequence until it finds one that provides the interface that the application wants. Eg xdp-wlr for wlroots-based Wayland compositors only implements compositor-specific interfaces like screencast, so users would chain it with something like xdp-gtk for other interfaces like file picker.
Native applications usually use their toolkits' API for showing file picker dialogs etc, and xdp's file picker interface is primarily used by flatpak applications since that is a way for sandboxed applications to read/write outside their sandbox. But it's not impossible for native applications to also use it, as zed is doing.
https://flatpak.github.io/xdg-desktop-portal/docs/api-refere...
I'm kind of tired of this contention cropping up again and again. Technically true but insufficient & obfuscating more than revealing.
Had Apple adopted Mantle then where would they be now? Apple did what they do, took ownership of their own stack.
There's a bit of detail here: https://github.com/zed-industries/zed/issues/7015
But I'd be curious to read a longer writeup on the tradeoffs and how they came to their decision.
i heard somewhere this nice example: only big actors like AAA game engines would really benefit from the extra development effort it would take to use an even lower level api like vulkan/dx12 to squeeze the last 10% of performance that wgpu can't get you
so if i understand correctly, zed, just like a AAA game engine, wants to squeeze every last bit of performance from the gpu, and so wgpu is "too high level" for it? and blade is "like wgpu, but no design tradeoffs and lower level" so its a better fit? does that mean someday zed might reach for vulkan directly one day? im assuming dx12 is gonna be used on windows anyway?
i love kvark's work btw, we need more kvarks
The "design of WebGPU" is a problem. It's designed for the web to be secure and sandboxed so the API design reflects that. This is not a good thing on desktop.
The page you linked clearly states that wgpu-hal's API is extremely unsafe and skips many checks in order to reduce overhead. So while "secure and sandboxed" explains why wgpu wasn't chosen, it doesn't explain why wgpu-hal wasn't chosen.
I thought this was some component. Lol, yeah if your IDE doesnt work on Linux, the problem is your IDE, not linux.
it was used back with a popular website which opened a text document and anyone viewing could type, but I can't remember the name. That became a thing in Google Docs, Microsoft Office, Floobits, and lots of self-hosted and cloned sites.
https://en.wikipedia.org/wiki/Etherpad
https://en.wikipedia.org/wiki/Collaborative_real-time_editor...
A term coined Casey Muratori for this is immediate-mode GUIs or else IMGUI programming[1]. Hence the name for the very popular Dear ImGui project. GPUI used for Zed is mentioned as hybrid immediate and retained mode UI framework[2].
[1]: https://caseymuratori.com/blog_0001 (fist post on his blog!) [2]: https://github.com/zed-industries/zed/tree/main/crates/gpui
Seriously, what do people think when designing headers like this? Like wow we should totally link to every other part of our site except the homepage.
Because who would want to go there after they found out about a project through a blog post?
This is not always great for accessibility (they don't have alt=, title=, or aria-*= attributes on the <a> or <img> tags) but seems to be a common pattern.
I would not have found it or even thought to try to click on it except after reading this claim that it's there somewhere.
I found a few issues, but overall it already works quite well and is very fast. It might even get me to give up on Neovim!
One thing that scares me with it though is the lock in of the multiplayer features. I can see it forcing me to use it and not my preferred editor, because other people use Zed.
Would love it if we were not only platform independent but also editor independent regardless of social pressure.
I recognize that that attitude makes marketing and selling a product to developers difficult, though. If they changed from a CLA to a DCO I'd feel less uneasy about it, but but is that something their investors and business can permit?
I'd happily pay a fixed one-time fee for them though.
$ grep -A 999 Disable .config/zed/settings.json
// Disable all genAI crap.
"features": {
"copilot": false,
},
"show_copilot_suggestions": false,
"assistant": {
"version": 1,
"enabled": false,
"button": false,
},
// Disable all "social coding" features.
"calls": {
"share_on_join": false,
},
"collaboration_panel": {
"button": false,
},
"chat_panel": {
"button": false,
},
"notification_panel": {
"button": false,
},
}I'm becoming a true convert, though I occasionally must drop down to a termianl for advanced vim features. That's high praise coming from me, as I have a high bar for adopting new tools.
I don't get this. There are so many things that Zed does better than VS Code, but typing latency is the least noticeable and interesting.
[1] https://discord.com/channels/869392257814519848/120467985020...
People who care about those details and who optimize for fast are my kind of people.
However, our accessibility to screen readers is non-existent. I have ambitions to incorporate AccessKit but it's a bit of a project due to the lack of a clear guide on how to implement it. That said, I already made some progress based on the old egui PR and we should have all the pieces we need once I have time to actually do it.
We also lack any way to tab through our UI elements to select each piece in turn. This one I have yet to do any thinking on, particularly as the tab key already does a lot of work in a code editor. I'm sure there's prior art here, I just haven't looked at it yet.
So, piecemeal and insufficient for many cases, usable for some others. I'm very interested in improving this but we still have a lot to do.
A note, the tab key is not all that important. f6 for jumping the different parts of the screen and the arrow keys for neighbouring elements could be a good substitute for most cases. Add a few key bindings and tabless is not an issue any more.
I hope they survive as a company!
If its ultimately a text editor with dead plain UI, why not simply stick to retained mode GUI and chill?
I don't know how much of disk space and ram this written in Rust® text editor project demands to just build it but since its Rust™, achieving cross-platform will probably be several-folds more work than it would be in C, I applaud the devs for their work.
I never tried Zed(yet) and keeping the support for vast programming languages aside, I would like to check out how this editor handles multiple workspaces and provide text editing features. I'm an Emacs guy and I have a feeling that this is not for me because even if its fast, it doesn't make me productive if I'm not using my emacs/vim key bindings. I might be wrong.
Why would you think that? Rust is a more expressive and powerful language than C. If anything, I'd say it would be easier. Platform APIs are not all in C either.
FFI? I don't recall stating Rust is less expressive than C, the language looses its notorious "memory safe" feature as unsafe is called often when performing low level sys calls.
> Platform APIs are not all in C either.
unless you are absolutely talking about web development, this is not true at all.
> please use the original title, unless it is misleading or linkbait; don't editorialize.
> If the title includes the name of the site, please take it out, because the site name will be displayed after the link.
> Please don't do things to make titles stand out, like using uppercase or exclamation points, or saying how great an article is. It's implicit in submitting something that you think it's important.
I'll just stick to Sublime Text.