News for hackers. Stuff that matters.
Re:Lapce – Fast open-source code editor by dzhou121 on Thursday March 17, 2022 @05:01AM (#30709039)
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 submit a feature request or bug report in Github Issues or leave your feedback here.

Re:Lapce – Fast open-source code editor by brainwipe on Thursday March 17, 2022 @05:24AM (#30709195)
Extremely impressive for a personal project! Great job, if it were mine, I'd be exceptionally proud of it.

I think the heat you're getting here is from the very slick website that makes Lapce look more finished than it is. It might be a good idea to adjust the text to manage people's expectations.

Great job!

Re:Lapce – Fast open-source code editor by sjmm1989 on Thursday March 17, 2022 @02:35PM (#30714426)
I think you're right on the heat front. It's probably causing a form of dissonance with some people.
Re:Lapce – Fast open-source code editor by unfocussed_mike on Thursday March 17, 2022 @07:03AM (#30709739)
I haven't had a chance to test this yet but this is fantastic to see.

Anything like this that progresses the cross-platform remote model that we now have with VSC, particularly if the endpoint is fast and memory-efficient, is really important, because of the variety of dev environments.

What I would _really_ like, of course, is an iPad editor that could do the same.

If you could make an iPad editor that has VSC-style remoting, that is genuinely a killer app right now for a lot of people.

That would be "just enough" editor for me so I could travel for a few days and still do a couple of hours of work here and there, without the laptop commitment.

I am not big on iOS subscription apps and I'm budget-constrained, but I'd pay $50 per year (probably more, and I figure I wouldn't be alone), without hesitation, for a fast remoting iOS editor that had 80% of the functionality of VSCode Remote and had a viable built in browser to avoid the process switch.

The code-server project definitely works for this, but something a bit more native would be amazing.

https://github.com/coder/code-server

Re:Lapce – Fast open-source code editor by radiKal07 on Thursday March 17, 2022 @07:39AM (#30709972)
Why don't you install VS Code as PWA from https://vscode.dev/ ?
Re:Lapce – Fast open-source code editor by unfocussed_mike on Thursday March 17, 2022 @08:09AM (#30710235)
From the iPad perspective this is not actually that different to running code-server.

(code-server is basically the open source parts of this from what I understand, and the back-end impact is really no different at all, except needing to open a port for the web interface.)

I'm not sure whether vscode.dev will be able to connect to my own remotes yet; need to test that!

The main problem is as far as I am aware the same; the browser-side connection can drop quite easily because of the limits of iOS (you can't switch away without losing it).

That is obviously not something even a native version of Lapce would be able to totally avoid, but an iOS native app might have a few more strategies for maintaining background remote connections for a little while (SSH apps do for example).

Re:Lapce – Fast open-source code editor by avidal on Thursday March 17, 2022 @11:50AM (#30712475)
vscode.dev is still for local development, not remote. It uses browser filesystem APIs to access your local filesystem. Whereas code-server runs on the remote and exposes a web server for you to connect to which serves up the filesystem on the remote.
Re:Lapce – Fast open-source code editor by radiKal07 on Friday March 18, 2022 @10:06AM (#30722409)
You can connect to remote git repository
Re:Lapce – Fast open-source code editor by unfocussed_mike on Friday March 18, 2022 @06:37PM (#30728474)
Yeah. But is that just for editing/committing? Can it remote into a server via SSH, run extensions there? I'm guessing not.
Re:Lapce – Fast open-source code editor by lucidphreak on Thursday March 17, 2022 @07:45AM (#30710034)
Not sure if it includes everything you've mentioned - but for iPad I found GoCoEdit to be about as "killer app" as it could get for an ipad code editor. I mean it blew me away. Not the developer, not associated with the dev or company - I just truly think its a wonderful editor.
Re:Lapce – Fast open-source code editor by unfocussed_mike on Thursday March 17, 2022 @08:01AM (#30710176)
Yes -- I've been using GoCoEdit for a long time! I love it. It's a really heroic effort.

But Visual Studio Code's remote thing really is on another level -- you can do things like run the git session remotely but with the GUI-side tools, do find and replace on the remote side; all the extensions (PHP syntax stuff etc.) install and run on the remote side as well as they do locally etc.; it's almost completely seamless.

Re:Lapce – Fast open-source code editor by chrisweekly on Thursday March 17, 2022 @10:06AM (#30711289)
Are in-browser editors ruled out?

EDIT: aha, just saw this, downthread:

> "The main problem is as far as I am aware the same; the browser-side connection can drop quite easily because of the limits of iOS (you can't switch away without losing it)."

Re:Lapce – Fast open-source code editor by unfocussed_mike on Thursday March 17, 2022 @10:50AM (#30711797)
In-browser editors are OK, if you can test your work without disrupting the connection, yeah. So sometimes if e.g. the website you're building is in another browser tab that has been enough.

The other way round -- an in-editor browser -- could be the better way to work. GoCoEdit does this (and it really is rather good!) as does Panic's Code Editor (formerly Coda for iOS), which is good, but not as good. And you arguably get a terminal more easily this way too, particularly where SSH keys are involved.

Re:Lapce – Fast open-source code editor by reacharavindh on Thursday March 17, 2022 @05:14AM (#30709135)
It is refreshing to see a new code editor, even with minimal set of features that feels fresh and fast. Thanks for putting it out there. Please please please keep that responsive experience and don't trade it off for a full set of features that will make this tool lose its charm and become just the same as the rest of the powerful tools.
Re:Lapce – Fast open-source code editor by dzhou121 on Thursday March 17, 2022 @05:20AM (#30709180)
Thanks for your kind words.

It will, it's in the DNA. L comes before P.

Re:Lapce – Fast open-source code editor by chrisweekly on Thursday March 17, 2022 @10:05AM (#30711276)
Awesome.

> " L comes before P."

?

Re:Lapce – Fast open-source code editor by HereBeBeasties on Thursday March 17, 2022 @10:11AM (#30711350)
LAPCE == Lightning-fast and Powerful Code Editor

I.e. Lightning-fast comes before Powerful.

Re:Lapce – Fast open-source code editor by chrisweekly on Thursday March 17, 2022 @01:00PM (#30713344)
ty (much kinder res than "rtfa" which I clearly didn't)

slainte!

Re:Lapce – Fast open-source code editor by mkeedlinger on Thursday March 17, 2022 @01:59PM (#30714065)
This looks awesome!! The code editor space may seem saturated, but it's not! I've been looking for an alternative to VS Code for some time.

Some things I'm really excited for: - Remote development as a first-class citizen! I use code-server a ton now, but getting away from browser jank would be nice. - In the future I wonder if something besides SSH would work for the connection. SSH doesn't handle bad connections or closing a laptop and moving very well. I use wireguard to connect to my code-server instance right now and it's pretty close to feeling like I develop locally. - Lighter and faster. Why does my laptop always have to be burning... - A more FOSS ecosystem. VS Code is "open source" but not really in practice. Some important extensions (from Microsoft) have non-foss licenses and the standard distribution is built with non-foss tidbits. There are projects like Codium that rectify these issues to some degree.

Re:Lapce – Fast open-source code editor by AllanLRH on Saturday March 19, 2022 @02:47AM (#30731732)
I think Microsoft replaced SSH in vscode remote, part of the motivation being that the default SSH port (22?) is often blocked on corporate networks. I believe they use websockets instead, and I wonder if that might help with the problems associated with putting your computer to sleep and resuming your work (and connection)?
Re:Lapce – Fast open-source code editor by bogeholm on Thursday March 17, 2022 @03:01PM (#30714691)
MOSH is not likely to be a supported protocol it seems, that would probably have been a good fit for your needs: https://github.com/microsoft/vscode-remote-release/issues/33...
Re:Lapce – Fast open-source code editor by AlchemistCamp on Thursday March 17, 2022 @09:19AM (#30710828)
For me, the most important feature is VIM bindings. I used to suffer from severe RSI and VIM was a big part of what helped my wrists recover.
Re:Lapce – Fast open-source code editor by honkycat on Thursday March 17, 2022 @11:11AM (#30711997)
Seriously.

I don't know how people text edit without the vim keybindings. I'll never go back!

Re:Lapce – Fast open-source code editor by iimblack on Thursday March 17, 2022 @11:24AM (#30712149)
In emacs there are a few alternative modal editing modes I've been wanting to try.

https://github.com/Kungsgeten/ryo-modal

https://github.com/jyp/boon

https://github.com/emacsorphanage/god-mode

Re:Lapce – Fast open-source code editor by mekster on Thursday March 17, 2022 @04:29PM (#30715539)
Only if I rebind keys from the very unintuitive default vim binding. It's like it's trying to twist your brain.
Re:Lapce – Fast open-source code editor by greyhair on Thursday March 17, 2022 @01:48PM (#30713928)
You an me both. I used emacs until I developed persistent tendonitis down the outside of my left hand.

Switched to vim, and the tendonitis resolved itself in about two months. That was back around 1990.

Re:Lapce – Fast open-source code editor by kybernetikos on Thursday March 17, 2022 @04:25PM (#30715505)
The speed on this is phenomenal and I'm really looking forward to you filling out a few more of the missing pieces. Really impressive achievement.

I wonder if you've considered kakoune style modal editing rather than vim? If you've not come across it, it might be worth looking at, as I think it's a better paradigm and one that I expect will go nicely with the multiple cursors you're working on.

Re:Lapce – Fast open-source code editor by GekkePrutser on Thursday March 17, 2022 @03:55PM (#30715229)
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.

Re:Lapce – Fast open-source code editor by dzhou121 on Thursday March 17, 2022 @04:11PM (#30715391)
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.

Re:Lapce – Fast open-source code editor by GekkePrutser on Thursday March 17, 2022 @10:16PM (#30718072)
Interesting, I'll definitely give it a try. Thanks for building it.
Re:Lapce – Fast open-source code editor by mekster on Thursday March 17, 2022 @04:27PM (#30715527)
I thought atom was ditched. Competitors would be VSC, Sublime and JetBrains.
Re:Lapce – Fast open-source code editor by danielvaughn on Thursday March 17, 2022 @09:47AM (#30711095)
I love that you're using Treesitter. I haven't followed the editor space much, but afaik, this is one of the first to implement it. The demos I'd seen were very impressive - definitely going to give it a shot!
Re:Lapce – Fast open-source code editor by NotEvil on Thursday March 17, 2022 @03:43PM (#30715119)
Every editor supports it now
Re:Lapce – Fast open-source code editor by mekster on Thursday March 17, 2022 @04:31PM (#30715561)
What do you specifically mean by every?
Re:Lapce – Fast open-source code editor by pdenton on Thursday March 17, 2022 @10:57AM (#30711855)
I believe an open source editor should be built from source and I couldn't find links to sources or how to build from source on the website. The getting started documentation points to the download section. It would be cool if one of the downloads would be marked as source (for any OS).
Re:Lapce – Fast open-source code editor by randonee on Thursday March 17, 2022 @11:24AM (#30712142)
There is a GitHub link on the top of the website. Build instructions are in the readme. https://github.com/lapce/lapce
Re:Lapce – Fast open-source code editor by andrewshadura on Thursday March 17, 2022 @04:16PM (#30715428)
I don't see it on the phone.
Re:Lapce – Fast open-source code editor by qwertox on Thursday March 17, 2022 @05:27AM (#30709214)
Off Topic: https://www.lapce.dev has a certificate issue. Also, the editor does not seem to run on Windows 7 ("createpseudoconsole could not be located" in KERNEL32.dll)
Re:Lapce – Fast open-source code editor by mccorrinall on Thursday March 17, 2022 @05:47AM (#30709316)
> Windows 7

is EOL and should be treated as such.

Re:Lapce – Fast open-source code editor by bobajeff on Thursday March 17, 2022 @08:48AM (#30710550)
True. But it shouldn't be. It's like tearing down a perfectly good neighborhood to make way for a hotel that doesn't really benefit the town.
Re:Lapce – Fast open-source code editor by gorjusborg on Thursday March 17, 2022 @09:29AM (#30710932)
In my opinion, that's a main reason developers should favor open source tools, they never truly 'go away'. The code is out there, so keeping it going then comes down to whether someone cares enough to maintain it. Not saying that path is all roses...
Re:Lapce – Fast open-source code editor by mekster on Thursday March 17, 2022 @04:25PM (#30715500)
It's same. Surrounding environments will change and just because the source of a previous version is there doesn't mean you can stably run it years on.
Re:Lapce – Fast open-source code editor by littlestymaar on Thursday March 17, 2022 @05:53AM (#30709346)
> Also, the editor does not seem to run on Windows 7 ("createpseudoconsole could not be located" in KERNEL32.dll)

Windows 7 EOL was 2 years ago though. (I know it's the last version of Windows that isn't an add-bloated spyware but still)

https://www.microsoft.com/en-US/windows/windows-7-end-of-lif...

Re:Lapce – Fast open-source code editor by cyber_kinetist on Thursday March 17, 2022 @10:32AM (#30711608)
Note that Windows 10 has some really nice OS API additions that may make devs consider ditching Windows 7 support (such as the createpseudoconsole function you’ve mentioned: https://docs.microsoft.com/en-us/windows/console/createpseud...)
Re:Lapce – Fast open-source code editor by tapoxi on Thursday March 17, 2022 @06:07PM (#30716386)
Pseudoconsole/ConPTY is a big deal and this would need a complex fallback for Windows 7 and 8. Probably not worthwhile.
Re:Lapce – Fast open-source code editor by ihateolives on Thursday March 17, 2022 @05:12AM (#30709119)
Valiant effort and impressive personal project!

> 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.

Website claims "Native GUI" but this is not native GUI. I'd rather have basic UX before multi cursor or anything else nice to have but totally optional things. On Windows open dialog is broken, you can't select drives, you have to enter the drive letter manually, but in input field delete key is not working. That's as far as I got trying it out.

Re:Lapce – Fast open-source code editor by cyber_kinetist on Thursday March 17, 2022 @10:29AM (#30711578)
Maybe the author should use a library like native-dialog (https://crates.io/crates/native-dialog) for these rather than making a file picker from scratch in Druid (the current Rust UI framework).
Re:Lapce – Fast open-source code editor by greyhair on Thursday March 17, 2022 @01:50PM (#30713962)
I am kind of curious. Which came first? The editor or Rust?

I was wondering if you were learning Rust and decided that you needed a project to reinforce your learning? Or you were designing and editor and decided you should do it in Rust?

Re:Lapce – Fast open-source code editor by dzhou121 on Thursday March 17, 2022 @02:02PM (#30714101)
I always wanted a "perfect" editor https://github.com/lapce/lapce/blob/master/docs/why-lapce.md

And my recent professional work was writing Rust, and I felt Rust would be really suitable for my editor.

Re:Lapce – Fast open-source code editor by michaelcampbell on Thursday March 17, 2022 @12:46PM (#30713177)
> It's a personal project so the initial set of features and key bindings are tight to my personal preferences.

As it should be. Well done.

Re:Lapce – Fast open-source code editor by bikamonki on Thursday March 17, 2022 @04:08PM (#30715345)
Do you use Lapce to edit Lapce's source code?
Re:Lapce – Fast open-source code editor by dzhou121 on Thursday March 17, 2022 @04:09PM (#30715363)
Yes, for more than one year now.
Re:Lapce – Fast open-source code editor by klaussilveira on Thursday March 17, 2022 @10:09AM (#30711326)
How are you rendering fonts? FreeType to render the glyph texture map and then quads for each character? Or SDF?
Re:Lapce – Fast open-source code editor by dzhou121 on Thursday March 17, 2022 @10:12AM (#30711368)
render the glyph texture map and then quads for each character
Re:Lapce – Fast open-source code editor by jonkoops on Thursday March 17, 2022 @06:44AM (#30709620)
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).
Re:Lapce – Fast open-source code editor by jpetso on Thursday March 17, 2022 @10:05AM (#30711281)
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 chance of incompatible repository formats.

Re:Lapce – Fast open-source code editor by follower on Thursday March 17, 2022 @11:58PM (#30718608)
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 by ciupicri on Thursday March 17, 2022 @01:14PM (#30713504)
I'm having the same issue with the Visual Studio Code (Flatpak). I want to use the compilers, interpreters and tools from the host, not whatever it's provided by the Flatpak or the runtimes from flathub/gnome, if it's provided at all.
Re:Lapce – Fast open-source code editor by sitkack on Thursday March 17, 2022 @07:37AM (#30709964)
meta comment. Often people working on a big system like this aren't the same people who would know about flatpak or flathub and nor do they have to be the same people to implement that packaging. I find if I include a link to said recommendations that it increases the likelihood that someone will takeup the recommendation. Esp if the link espouses why it is great.

https://docs.flatpak.org/en/latest/introduction.html#reasons...

https://flathub.org/home

> Flathub only hosts stable application releases, and not development snapshots.

from https://github.com/flathub/flathub/wiki/App-Submission

> If there’s an app that you'd like to be distributed on Flathub, the best first course of action is to approach the app’s developers and ask them to submit it. Remember that for some projects or communities, this may be the first that they have heard of the Flatpak technology or interacted with somebody who advocates it.

Also from the above link.

Re:Lapce – Fast open-source code editor by tormeh on Thursday March 17, 2022 @05:25AM (#30709206)
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!

Re:Lapce – Fast open-source code editor by follower on Friday March 18, 2022 @12:04AM (#30718638)
> 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