Elsa icon indicating copy to clipboard operation
Elsa copied to clipboard

[Epic] Provide API for querying the reader and analyser internal representations

Open Fuco1 opened this issue 5 years ago • 11 comments

We can also try to support LSP and enable a whole bunch of refactorings. With the proper source code analysis everything will be so simple.

We should also be able to query types of things under cursor (or anywhere for that matter), find references, sources, definitions...

Fuco1 avatar Aug 01 '18 14:08 Fuco1

I've started work on this, see the tweets for some teasers https://twitter.com/Fuco1337/status/1134550177967157248

/cc @DamienCassou @alphapapa

Fuco1 avatar May 31 '19 20:05 Fuco1

Uh... node.js? D:

alphapapa avatar May 31 '19 21:05 alphapapa

@alphapapa It's the best platform for prototyping this. Microsoft provides complete SDK for the server so the whole thing just amounts to couple lines of code.

Once we have the Elsa functionality somewhat stable we can rewrite the server using elnode or httpd or something in Emacs. But I don't see that happening any time soon as the complexites of the server are quite extensive.

Easiest way I can see of distributing this would be with a docker image or something in the future.

Fuco1 avatar Jun 01 '19 08:06 Fuco1

It's the best platform for prototyping this. Microsoft provides complete SDK for the server so the whole thing just amounts to couple lines of code.

Understandable. :) Does that mean that a new Emacs process is run every time an Elsa scan is done, or is there one continuous Emacs process for Elsa that interfaces with Node?

Easiest way I can see of distributing this would be with a docker image or something in the future.

D: again! Please, not Docker!

:)

alphapapa avatar Jun 01 '19 13:06 alphapapa

Elsa is designed to run and die, there is no persistence. Every request will spawn a new fresh elsa process. The workspace state is handled by the LSP server.

Why not docker? TBH I don't care how this is done but with docker I can package it in 10 minutes and it will work for me everywhere /shrug

Fuco1 avatar Jun 01 '19 14:06 Fuco1

Elsa is designed to run and die, there is no persistence. Every request will spawn a new fresh elsa process.

How well does that perform? This isn't a criticism, of course, but I'm just curious, because in my limited experiences using Emacs for scripting, the startup time is very slow compared with other interpreters, and I would imagine that being a problem when using it to execute many small requests.

Why not docker? TBH I don't care how this is done but with docker I can package it in 10 minutes and it will work for me everywhere /shrug

I don't want to have to install Docker and run a Docker container just to use Elsa. I'm guessing that many other users would feel the same way. I'm not much of a Node user, but I've installed the Node package from my Linux distro (Ubuntu on this system), and it works fine with, e.g. Stylus (the CSS preprocessor).

alphapapa avatar Jun 01 '19 15:06 alphapapa

Actually, the startup time is less than 50ms... what makes it really slow is wrapping it in cask which increases it 20 fold to about a second. I will need to find a way to either make cask faster or remove the dependency.

Fuco1 avatar Jun 01 '19 15:06 Fuco1

Matus Goljer [email protected] writes:

Easiest way I can see of distributing this would be with a docker image or something in the future.

Indium is partly implemented in Emacs Lisp and partly in Node. This works great and Docker is not necessary. Here are the installation instructions :

https://indium.readthedocs.io/en/latest/installation.html

-- Damien Cassou http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill

DamienCassou avatar Jun 02 '19 05:06 DamienCassou

Matus Goljer [email protected] writes:

Actually, the startup time is less than 50ms... what makes it really slow is wrapping it in cask which increases it 20 fold to about a second. I will need to find a way to either make cask faster or remove the dependency.

We already talked about it, but I still think Elsa shouldn't force Cask on users.

-- Damien Cassou http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill

DamienCassou avatar Jun 02 '19 05:06 DamienCassou

Matus Goljer [email protected] writes:

I've started work on this, see the tweets for some teasers https://twitter.com/Fuco1337/status/1134550177967157248

This looks really great, good job!

-- Damien Cassou http://damiencassou.seasidehosting.st

"Success is the ability to go from one failure to another without losing enthusiasm." --Winston Churchill

DamienCassou avatar Jun 02 '19 05:06 DamienCassou

My main pain now is that I want to get this out to possibly tens of people, not thousands. To me the easy of packaging this with docker and cask far outweights the tens of hours I'd spend on another setup. That can be refined later.

I think we will need to abandon cask because of the poor performance though.

Fuco1 avatar Jun 02 '19 08:06 Fuco1