Live data from Hacker News

Code-GUI bidirectional editing via LSP

jamesbvaughan.com

41–50 of 71 posts

Re: Code-GUI bidirectional editing via LSP

#41
post #40

It's concerning to me that the LSP idea is .. a thing. Casey Muratori observed years ago that it's just a way worse way of doing libraries. Like, you're introducing HTTP where there could just be a function call into a DLL/SO. What's the benefit there? Just make vim/emacs/$editor speak some native protocol and be done with it. Then you GUI is just welded directly into the running editor process.. right?? There's no s…

You're going to love MCP.

Re: Code-GUI bidirectional editing via LSP

#42
post #40

It's concerning to me that the LSP idea is .. a thing. Casey Muratori observed years ago that it's just a way worse way of doing libraries. Like, you're introducing HTTP where there could just be a function call into a DLL/SO. What's the benefit there? Just make vim/emacs/$editor speak some native protocol and be done with it. Then you GUI is just welded directly into the running editor process.. right?? There's no s…

I’ve definitely wondered about this. Like why does the language-understanding standard have to be a server specifically? Just cause it’s a good architecture to build around?

I think I’ve heard that vscode has benefitted hugely from it starting out with a client-server architecture from the start, since it started as a browser based editor. Things like editing code directly on servers via ssh or in containers is easy for vscode cause its client-server all the way down.

Vscode and LSP are both Microsoft products, maybe Microsoft has been pushing the client server thing?

Re: Code-GUI bidirectional editing via LSP

#43
post #41
post #40

It's concerning to me that the LSP idea is .. a thing. Casey Muratori observed years ago that it's just a way worse way of doing libraries. Like, you're introducing HTTP where there could just be a function call into a DLL/SO. What's the benefit there? Just make vim/emacs/$editor speak some native protocol and be done with it. Then you GUI is just welded directly into the running editor process.. right?? There's no s…

You're going to love MCP.

What is up with mcp... feels like CORBA

Re: Code-GUI bidirectional editing via LSP

#44

This is close to the functionality that Borland Delphi had back in the 1990s. The pascal language and the design of their GUI toolkit were a really good impedance match, so you could freely switch between GUI design and editing the text version of it. Doing so for languages like C++, was a sea of boilerplate that you couldn't touch, which is why I never moved away from Pascal. Similar fragility was evident in WxPytho…

Delphi's form files weren't pascal. The gui-sync was in my memory just editing the class definition when adding components / event handlers.

Re: Code-GUI bidirectional editing via LSP

#45
post #41

Earlier quoted context omitted.

You're going to love MCP.

What is up with mcp... feels like CORBA

It's like if CORBA and COBOL had a baby :P

Seriously though, it does combine the "RPC IDL" aspect of the former, with the "Use English" aspect of the latter.

Re: Code-GUI bidirectional editing via LSP

#46
post #39
post #30

Earlier quoted context omitted.

I think we’re a lot of developers who are frustrated by constantly needing to choose between code or GUI… both have their use case, but I feel like there must be a system that combines both.

How about a visual programming language? Plenty of 3D and CAD software uses a VPL for procedural design, which helps a ton to bring out the benefits of both

Any examples?

Re: Code-GUI bidirectional editing via LSP

#47
post #30
post #3

This is a great idea: I'd never think of using LSP for this! As a software developer, I always get frustrated when I am doing some graphical work and struggle to neatly parametrize whatever I am drawing (wooden cabinets and furniture, room layouts, installation plans...) and switch between coding where that makes most sense and GUI where it doesn't. The best I've gotten was FreeCAD with Python bindings (I've got a co…

I think we’re a lot of developers who are frustrated by constantly needing to choose between code or GUI… both have their use case, but I feel like there must be a system that combines both.

Let's lobby for adding UI semantics to MCP. Generating ad-hoc GUIs seems like a major and common enough feature to warrant it.

Re: Code-GUI bidirectional editing via LSP

#48
post #40

It's concerning to me that the LSP idea is .. a thing. Casey Muratori observed years ago that it's just a way worse way of doing libraries. Like, you're introducing HTTP where there could just be a function call into a DLL/SO. What's the benefit there? Just make vim/emacs/$editor speak some native protocol and be done with it. Then you GUI is just welded directly into the running editor process.. right?? There's no s…

there are many practical benefits:

1. naturally async

2. each server and the editor itself can be written in its own language and runtime easily

3. servers can just crash or be killed because of oom errors and your editor won't be affected

4. in a lot of languages it is easier to write a server then to call/export c abi

5. the editor can run in a browser and connect to a remote server

6. you can have a remote central server

all of those things are done in practice

Re: Code-GUI bidirectional editing via LSP

#49

For Slint [ https://slint.dev ], a (native) GUI Toolkit, I've also developed a LSP server that do live preview and editing. You can try it online at https://slintpad.com : if you click on the toolbar button to enable the right panel, you can edit the properties from the UI, and this is all done through the LSP and can be integrated in any editor that supports it.

cool! how does this work? e.g. how do you know which UI element matches which text element, do you track it while rendering? How do you propagate changes in the UI? do you update the text and then re-render the whole UI?

Re: Code-GUI bidirectional editing via LSP

#50

This is close to the functionality that Borland Delphi had back in the 1990s. The pascal language and the design of their GUI toolkit were a really good impedance match, so you could freely switch between GUI design and editing the text version of it. Doing so for languages like C++, was a sea of boilerplate that you couldn't touch, which is why I never moved away from Pascal. Similar fragility was evident in WxPytho…

Borland C++ Builder did the same thing as Delphi, used the Delphi VCL class library, worked great.
Post reply on HN