Zulip Chat Archive

Stream: new members

Topic: How do you set the Lean exec?


Daniel Donnelly (Aug 28 2019 at 05:36):

I'm working on BananaCats and figured I would reverse engineer the protocol for talking to Lean that VSCode uses. I will do this by replacing the lean.exe with my own, and forwarding commands to the real lean. So where does "elan" install Lean, and how do I specify a custom exe path?

EDIT: found the Executable path in settings. Would it be best if my app installed VSCode for the user too, so that I don't have to make any sort of Lean editor? I think so... It will have one lean file per app instance maybe, or should it be per diagram? I think per app instance, so you can have many BanCats open, and one VSCode / Lean. VSCode / Lean is much more processor intensive than my GUI code.

Daniel Donnelly (Aug 28 2019 at 05:44):

Thinks will be drag / droppable, so maybe if I'm dragging to the application lean.exe I can convert the objects in question into Lean data statements

Andrew Ashworth (Aug 28 2019 at 05:47):

you do not need to reverse engineer it

Andrew Ashworth (Aug 28 2019 at 05:48):

the base protocol is documented at https://github.com/Microsoft/language-server-protocol

Mario Carneiro (Aug 28 2019 at 05:48):

I don't think lean is based on LSP

Mario Carneiro (Aug 28 2019 at 05:49):

I would suggest modifying the vscode extension to log all JSON packets

Andrew Ashworth (Aug 28 2019 at 05:49):

ahh, there is a dummy lsp implementation then at https://github.com/leanprover/lean-client-js/tree/master/lean-language-server

Andrew Ashworth (Aug 28 2019 at 05:50):

which i guess is nonfunctional? idk

Daniel Donnelly (Aug 28 2019 at 05:50):

Thx

Mario Carneiro (Aug 28 2019 at 05:52):

actually it probably is pretty easy to modify the extension to call lean --server | tee lean.log instead of lean --server

Daniel Donnelly (Aug 28 2019 at 05:52):

Yes, I don't mean rev engineering. If I just hooked up an EXE between them, I could even maybe do the final version that way (a middle man). Well doing the EXE between and you just print the JSON...

Daniel Donnelly (Aug 28 2019 at 05:54):

In fact, a Lean EXE can only connect to one thing at a time, so I'd have to be the middle man anyway. There's logically no other way to do it

Daniel Donnelly (Aug 28 2019 at 05:54):

Lean <-> BanCats <-> VSCode

Mario Carneiro (Aug 28 2019 at 05:54):

Presumably there is no need for vscode in the "final version" though?

Daniel Donnelly (Aug 28 2019 at 05:54):

Lean <--> VSCode -> LogFile, BanCats -> ?

Daniel Donnelly (Aug 28 2019 at 05:55):

There's no way I'm writing an IDE as good as VSCode

Mario Carneiro (Aug 28 2019 at 05:55):

but that's not the goal, right? You just need lean to act as backend for your theorem goals

Daniel Donnelly (Aug 28 2019 at 05:55):

I'm going to use it in version 1.0 so that I will create a VSCode + Lean installer for us too. On OSX / Linux, I will need help on getting the VSCode equivalents (to Windows 10)

Mario Carneiro (Aug 28 2019 at 05:56):

unless you are doing the text editor whole nine yards

Daniel Donnelly (Aug 28 2019 at 05:56):

@Mario Carneiro I want the user to be able to extend the system and be part of the Lean community as well

Mario Carneiro (Aug 28 2019 at 05:56):

I'm not sure I follow. How do you envision the interaction?

Daniel Donnelly (Aug 28 2019 at 05:57):

So if there's something missing, like some new math area, then my system can support it by adding Lean support

Mario Carneiro (Aug 28 2019 at 05:57):

Is the user using your tool to edit lean files? Or are they using VSCode?

Daniel Donnelly (Aug 28 2019 at 05:58):

They're using my tool 100% graphically (2D graphics) to create lean code on-the-fly. This gets sent to Lean, and somehow I'd have to make VSCode update, not sure how.

Daniel Donnelly (Aug 28 2019 at 05:58):

But optionally they can go into VSCode to add in their custom "perfectoid spaces of the future"

Mario Carneiro (Aug 28 2019 at 05:59):

I would guess that the easiest way to intervene is to make VSCode interact with your program by writing your own extension extending vscode-lean

Mario Carneiro (Aug 28 2019 at 05:59):

i.e. Lean <-> VSCode <-> BanCats

Daniel Donnelly (Aug 28 2019 at 05:59):

The language of categories won't change, so there's less to extend with BanCats, and more so with Lean

Mario Carneiro (Aug 28 2019 at 05:59):

that way you can set the protocol on the BanCats side

Daniel Donnelly (Aug 28 2019 at 05:59):

Interesting!

Daniel Donnelly (Aug 28 2019 at 06:00):

So I'll look at that plugin. Thank you!

Mario Carneiro (Aug 28 2019 at 06:00):

and vscode-lean has already done the messy work of parsing the lean protocol

Daniel Donnelly (Aug 28 2019 at 06:00):

Right right right

Daniel Donnelly (Aug 28 2019 at 06:00):

:D

Daniel Donnelly (Aug 28 2019 at 06:01):

In about 7 months, people can start to use BananCats as an alternative way to install and use Lean.

Daniel Donnelly (Aug 28 2019 at 06:02):

Maybe in 1 year it will be useable

Daniel Donnelly (Aug 28 2019 at 06:02):

But the first release will have a proof of Yoneda's Lemma. Since that's one of my design tests of the UX.


Last updated: Dec 20 2023 at 11:08 UTC