Live data from Hacker News

Lapce – Fast open-source code editor

lapce.dev

201–210 of 231 posts

Re: Lapce – Fast open-source code editor

#201

Earlier quoted context omitted.

What prompted you to develop it? The market for this is quite crowded with Atom and VS Code. Where you that dissatisfied with them? Just wondering. I like that this is native though. VS Code is one of the rare good electron apps but native is still nicer IMO. Will give it a try.

It's mainly speed. I don't know if it's fixed now. Previously when I was using VSCode, sometimes the "go to definition" hangs and it will freeze the whole editor, which was unacceptable. So in Lapce, nothing blocks the main thread other than your key press.

Interesting, I'll definitely give it a try. Thanks for building it.

Re: Lapce – Fast open-source code editor

#202
post #123
post #28

Earlier quoted context omitted.

I think that's a perfectly valid appeal to altruism in a tech-savvy audience. It makes sense to take a hit on your individual needs and wants as a user in the short term, if it helps with keeping the tech ecosystem which we collectively inhabit healthy in the long term. Free market forces based on individual self-interest have proven to be really bad at doing that, so altruism is needed to fill the gap. ...by that lo…

I'd prefer it written in Zig compared to Rust, C++, JavaScript, or Cobol ;)

What is zig?

Re: Lapce – Fast open-source code editor

#203

Complaining about bugs in an alpha software makes no sens so I won't. But one thing makes me uncomfortable regardless of its early state: It's gigantic! It's a 55 MB executable. You could fit at least one hundred full blow almost self contained (CLI) text-editors with the feature-set of Lapce in that size… What is going on there? Does it bundle an operating system, or even a whole EMACS distribution in that binary? B…

> It's a 55 MB executable. You could fit at least one hundred full blow almost self contained (CLI) text-editors with the feature-set of Lapce in that size…

Sure, why not, I've got time to waste on endless bikeshedding... :D

IMO 55MB isn't "gigantic"--a 450MB binary could rightly be called "gigantic": https://github.com/lapce/lapce/issues/24#issuecomment-100122... (But, ya know, ya don't get this here debugging info for free.)

FWIW the Linux binary I downloaded can be immediately shrunk from 57413256 bytes to 44604432 bytes (~43MB) by running `strip` on it.

I imagine further size reductions can be found by following the, by now, "standard", list of steps at https://github.com/johnthagen/min-sized-rust but for a pre-pre-alpha personal project I imagine doing so is not a high priority.

Also FWIW comparing a "self contained (CLI)" to a self-contained GUI editor seems pretty apples to oranges as comparisons go...

I will accept though a 3x multiplier on the "bloated" `emacs25-nox` (~15MB) and a 50x on the svelte `vim.tiny` (~11MB) I found installed locally. (Apparently `emacs25-x` on another machine weighs in at ~17MB so I guess that's the eventual target. :D )

My primary interest in Lapce is for editing Rust code with LSP/Rust-Analyzer support (the latter being where there's actually issues with regard to constrained development environments), I recently almost got there with the KDE Kate editor but a Rust built editor with WASM/WASI as a target for plugins seems more attractive to me going forward.

Re: Lapce – Fast open-source code editor

#204

> Vim like modal editing Can I disable it? Because honestly, I don't want to tell my text editor to let me enter text every time I open a file.

Yes, it can be disabled. (via opening screen and/or preferences.)

I'm not a fan of modal editing either so I appreciate that while the Lapce developer is a fan they at least support non-modal as an option--unlike many other recent Rust-based text editor projects.

Re: Lapce – Fast open-source code editor

#205
post #125

Earlier quoted context omitted.

Are there any plans to release the app as a Flatpak, they are a great way to package your application cross-distro with a central way of updating (such as Flathub).

No relation to this project. Just wanted to chime in to say that KDE's Kate editor pulled its Flatpak because the sandboxing makes much of the system integration (terminal, git, language servers) hard or impossible. A Flatpak may have to ship with an independent copy of a lot of basic developer tools, and even then I don't know whether I want two different versions of git access the same local repository with a chanc…

Yeah, I've run into this issue with Flatpak & Kate. (I think it was specifically the Flathub Kate Flatpak that was pulled?)

FWIW I was recently able to get a "passable" but not ideal Rust/LSP/Rust-Analyzer/Cargo setup mostly functional via use of the kate build plugin and e.g `flatpak-spawn --host cargo build`...

...and... `flatpak-spawn --host cargo run | sed --unbuffered 's/\x1b\[[0-9;]*m//g'`.

Excuse the cough. :D (It was necessary to remove the ANSI colour codes produced by some logging library the project used.)

(My preference would be to use AppImage but unfortunately recent Kate AppImage versions have a hang-on exit bug.)

Re: Lapce – Fast open-source code editor

#206
post #61

Author here. Thanks for all the feedback. I'm aware that Lapce lacks lots of basic stuff. It's a personal project so the initial set of features and key bindings are tight to my personal preferences. I'm currently working on the missing pieces, like multi cursor support(in master but not released yet), mouse support, sane default key bindings(probably I'll stick to an existing editor), basic UX etc. Feel free to subm…

First thing I tried was ctrl+shift+f to grep through a project, which didn't work. I see the functionality is there, though. Both Intellij and vscode uses this shortcut, so harmonizing with them would be nice. Also the code completions are not clickable with a mouse, and using the "down" key also doesn't do anything. Anyway, development-wise these are minor issues in a project of this size. Nice work!

> Also the code completions are not clickable with a mouse, and using the "down" key also doesn't do anything.

Yeah, unfortunately it seems like there's a (possibly recently introduced?) bug that appears to break arrow-key/list interactions.

I was able to get code completion & command palettes to work by supplying a custom keymap I posted here: https://github.com/lapce/lapce/issues/133#issuecomment-10715...

My impression is that the non-modal keymap isn't as regularly updated given the developer's preference for modal interaction. I'm happy enough I can at least still edit the keymap to workaround the issue. :D

Re: Lapce – Fast open-source code editor

#207
post #196

Earlier quoted context omitted.

> we are really proud to have got it working at all On the contrary, the rust crate ecosystem and tooling means a lone developer can compose specialised libraries to produce a working artefact that scratches her own itch. Such productivity is the opposite of getting something working at all. Trying to build an OSS cpp project or even worse, use an OSS Cpp library in your own project is more along the lines of "gettin…

Correct use, documentation, and other concerns are imporant for all libraries, whether got via cargo or otherwise, so this amounts to special pleading again. More importantly, though: how hard is it to use a library coded in C++ from your Rust program? You have to make and maintain some sort of shim layer. Even a C library needs some such effort. For any given need, you are much less likely to find an existing and su…

> Correct use, documentation, and other concerns are important for all libraries, whether got via cargo or otherwise

This is true.

However the Cargo/Rust ecosystem has one standard answer, read the associated crate docs, e.g.:

https://docs.rs/libloading

Coincidentally, the above linked crate `libloading` also shows how to access functionality in a shared library that exposes a C ABI compatible interface whatever the implementation language.

Re: Lapce – Fast open-source code editor

#209

Just tried it, on Linux. Pro: - a single binary you can drop in ~/bin - native Linux version - really, really fast - git branches in the top bar by default Cons (beside being super new and lacking ecosystem): - Use a custom window border, which is also pretty ugly IMO - cannot use arrow keys in the command palette (or any file dialog). I guess it's a bug? - default key bindings are... weird? ctrl+f doesn't prompt a f…

It's funny how people can disagree on pros / cons. For me it's: > - a single binary you can drop in ~/bin Well, a binary larger than quite some operating systems. (And not even talking about the security issues with such an approach). > - native Linux version Well, it's as "native" as an Electron app as it'll execute native machine code at some point. ;-) Besides that it feels as "native" as an Electron app… The UX i…

> Only that Kate is usable right now, and has in fact quite some features.

There's dozen of us! :)

As a matter of interest, have you managed to get a satisfactory Rust/LSP/Rust-Analyzer/Cargo setup running with your Kate install?

(Also, Kate as an AppImage seems to be ~150-185MB as a data point for comparisons. (`libKF5TextEditor.so.5` is ~3.5MB.))

The whole "native UI" aspect is a reasonable discussion point but given I seem to be running GTK/Flatpak-based distros I despair of ever having something "native" that I also think is good. :D (Elementary OS at least got me close enough to finally mostly move away from Mac.)

I do think native file dialog boxes are generally a nice addition as a halfway point.

Re: Lapce – Fast open-source code editor

#210
post #27

I was super excited and took it for a spin, but this is not usable (macOS 12, arm). Not "rough around the edges", but "pre-alpha unusable". The command pallet didn't respond to arrow keys. I couldn't figure out how to search for an extension. There's no menu bar items, and it follows very few macOS platform conventions (eg, Cmd+T opens a new tab with its own workspace, but Cmd+W doesn't close it.) For some reason, th…

> The command pallet didn't respond to arrow keys.

Yeah, this seems to be an unfortunate bug. FWIW I linked to a workaround that enabled me to try the app's functionality more here: https://news.ycombinator.com/item?id=30718638

> I couldn't figure out how to search for an extension.

AFAICT there is only one extension/plugin currently (for Rust Analyzer) which is installable via the "puzzle piece" icon on the left side of the editor window.

In general it seems like non-modal people currently need to setup keybindings to get a usable editor.

Post reply on HN