Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blodwen adaptation #489

Open
cfhammill opened this issue Dec 29, 2018 · 12 comments
Open

Blodwen adaptation #489

cfhammill opened this issue Dec 29, 2018 · 12 comments

Comments

@cfhammill
Copy link

Hi All,

I'm interested in playing with blodwen. Anyone have any suggestions for what needs to be modified to get idris-mode compatible with idris2?

Thanks!

Chris

@david-christiansen
Copy link
Member

david-christiansen commented Dec 29, 2018 via email

@cfhammill
Copy link
Author

Thanks so much,

So I tried pointing idris-mode at the blodwen executable:

(setq idris-interpreter-path "blodwen")

but I get Buffer *idris-repl* has no process.

From the Messages buffer:

Idris disconnected: exited abnormally with code 1
idris-send: Buffer *idris-repl* has no process
Making completion list...
Warning from Idris: Uncaught error: INTERNAL ERROR: build/--ide-mode-socket.ttc: File Not Found

Idris disconnected: exited abnormally with code 1

Not sure where to go from here.

@gyroninja
Copy link

gyroninja commented Jan 1, 2019

I'd like support for Blodwen too.

Not sure where to go from here.

I'd like to point out that Blodwen does not support the --ide-mode-socket flag yet. It only supports --ide-mode right now. Right now this package tries to use the protocol over tcp: https://github.com/idris-hackers/idris-mode/blob/master/inferior-idris.el#L134. Normal --ide-mode which Blodwen does support is pretty much the same thing but it is done througth stdin and stdout it appears. Getting this package to handle --ide-mode or porting --ide-mode-socket to Blodwen would be the next step of getting Blodwen support at least functioning. In the furure the enhancements of v2 should be added.
Also remember that Blodwen uses a build folder with two metadata files for each file it builds instead of just one (the ibc file). idris-mode offers a way for deleting IBC files, so this should be extended to handle the .ttc and .ttm files. This should just be changed to delete metadata for the file in general.
The actual language itself is still called Idris AFAIK, so I don't think much of the user facing interface needs to change. You'll want to add support for recognizing .blod files instead of .idr and you'll want to separate the histories of Idris and Blodwen.

@david-christiansen
Copy link
Member

Good points.

It wouldn't be particularly hard to let idris-mode use the stdio interface. It used to do that back in the old days, after all! But side effects in C libraries makes this pretty inconvenient in the long run, so it seems better to get the socket version up and running in Blodwen. That took about 3 hours for the Haskell implementation, and Idris 1 has reasonable socket support, so I don't expect it'd be much more.

WRT deleting IBCs, idris-mode does this to force type checking to happen even when the IBC is newer. This works around an issue where cached data would be loaded, and certain effects (like code highlighting and warnings) would not occur. If Blodwen doesn't have these issues, then there's no reason to delete the intermediate build products.

Also, for Blodwen, we probably need to add another category of compiler metadata for the highlighting code: the quantity annotations on binding forms. Those should give appropriate explanatory tooltips.

@cfhammill
Copy link
Author

Thanks @gyroninja and @david-christiansen.

Sounds like there is at least a clear first step. Get socket mode up and running for blodwen. I'll submit a small PR to add this as an open issue on ide-notes for blodwen. Then if I get a chance I can look in to porting the socket mode. Given the back compatibility, fingers crossed it will be a simple port.

cfhammill added a commit to cfhammill/Blodwen that referenced this issue Jan 2, 2019
As discussed in the [idris-mode issues](idris-hackers/idris-mode#489) socket support doesn't seem to be up and running yet.

I hope one of the discussants will be able to issue a PR porting socket-mode from Idris1 and removing this note in the near future.
@kevinboulain
Copy link

For the record, Idris 2 supports --ide-mode-socket flag so you can set idris-interpreter-path. Once https://github.com/edwinb/Idris2/pull/53 is in, idris-mode will have to either strip a bunch of commands or port them to Idris 2.

From a quick test:

  • :version doesn't exist (fixable by commenting out idris-repl-insert-banner in idris-repl-update-banner)
  • :cd doesn't exist
  • :interpret returns :ok "Done", replacing printResult "Done" with pure () seems to unbreak stuff a little
  • no :highlight-source after :load-file seems to also break stuff

Now I'm stuck with some evaluation problems in idris-dispatch-event.
So there is a little bit of work ahead :)

@bigos
Copy link

bigos commented Jul 31, 2020

Has anybody done some work towards Idris2 integration? What needs changing? To keep backwards compatibility with old Idris we need something better than idris-interpreter-path. Do you have any suggestions?

@bigos
Copy link

bigos commented Aug 1, 2020

https://github.com/bigos/idris-mode/blob/36db9f91db0e17473324b4362dcb2e00a7ac9dfe/idris-core.el#L35
with example like this where do I start in adopting existing mode to Idris 2?

@abailly
Copy link
Contributor

abailly commented Aug 1, 2020 via email

@bigos
Copy link

bigos commented Aug 1, 2020

In such case I will wait.

By the way, do you think my description of reloading mode code may be useful?

https://github.com/bigos/idris-mode/blob/wip1/development-notes.org

@abailly
Copy link
Contributor

abailly commented Aug 1, 2020 via email

@bigos
Copy link

bigos commented Aug 2, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants