REPL support for Julia
Check for existing issues
- [X] Completed
Describe the feature
I would love it if we can use REPL functionalities of zed for Julia languange as well. The website mentions that it supports IJulia but is still working on installation instruction. So my question is that does anyone able to make REPL work for Julia, if yes how did you do it in your case?
If applicable, add mockups / screenshots to help present your vision of the feature
No response
@maxdeviant has started looking into this, fixing some amount of protocol divergence in the upstream lib. More to come!
Any updates on that? I would really love to use this feature :)
@maxdeviant have you been able to isolate the root cause. Is this issue caused by “zed” or the julia plugin?
Also looking forward to this.
Zed 0.166.1 still has this problem. I can confirm this does not work on Linux either. Zed gets stuck trying to connect to the Julia kernel.
I've discovered that this issue has already been fixed in IJulia's master branch about two months ago. The problem wasn't with Zed itself, but rather with IJulia not fully complying with the Jupyter Kernel Transmission Protocol - specifically, the timestamp in header files was missing the timezone appendix, causing Zed's REPL loop to quit silently (without any traces in the logs).
The fix is in this commit
Until a new IJulia release is published, you can use the current master version with:
Enter Pkg Mode by pressing ] after opening Julia in the shell
add IJulia#master
build IJulia
Return to Julia REPL with backspace
# In Julia REPL
using IJulia
installkernel("Julia", "--project=@.")
@maxdeviant This should resolve the issue. I recommend closing this ticket as the underlying problem has been identified and fixed upstream.
As initial bug request. Can someone provide all steps required to make this working ? Out of curiosity, also why upstream patches are needed when this works in vscode, Jupiter and iirc Emacs ?
The issue occurs because Zed implements a stricter validation of the Jupyter protocol than some other editors. Specifically, Zed (chrono - serde_json implementation) expects timestamp headers in the Jupyter messages to include timezone information, exactly as specified in the protocol. VS Code, Jupyter, and Emacs either implement more lenient parsing of these messages or handle the missing timezone information differently.
@mashu As for all required steps: Just follow the REPL install instructions here and continue afterwards with the instructions I wrote above. As soon as IJulia makes a new release those steps are obsolete.
Works for me now, however, the IJulia based REPL is much slower than what i was used to in vscode, also there just running a file in the integrated terminal and then being able to run some lines in the terminal is really nice. Its pretty much the only reason I havent switched full time to Zed yet. Is this something that is being planned, or is this something that would need to be done by the Julia plugin?
Seems to work to me too for script-as-notebook style usage. Being able to switch to a terminal-like REPL like view on the same Julia process would be nice. I think this is the relevant discussion: https://github.com/zed-industries/zed/discussions/23370