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

Improve Jupyter kernel support #108

Open
1 task
sigmaSd opened this issue Nov 30, 2022 Discussed in #107 · 7 comments
Open
1 task

Improve Jupyter kernel support #108

sigmaSd opened this issue Nov 30, 2022 Discussed in #107 · 7 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@sigmaSd
Copy link
Owner

sigmaSd commented Nov 30, 2022

Discussed in #107

Originally posted by baiguoname November 30, 2022
Jupyter is amazing, can I use Irust in Jupyter, especially in vscode-jupyter.

@sigmaSd sigmaSd changed the title Add Jupyter kernel support Add full Jupyter kernel support Nov 30, 2022
@sigmaSd sigmaSd added enhancement New feature or request help wanted Extra attention is needed labels Nov 30, 2022
@baiguoname
Copy link

Any updating in this feature? I believe there are many people like me is waiting for this.

@sigmaSd
Copy link
Owner Author

sigmaSd commented Mar 19, 2023

I just want to reiterate that tere is already evcxr which have jupyter support, I'm sure they would accept feature requests for missing features

The problem with jupyterr and rust, is we don't have a real repl yet as in the code needs to be recompiled each time, so it's really slow, compare that to the instantaneous experience of Python and Julia for example

To answer your question, unfortunately I don't have time to work on it now, I'll try to get to it when I can or maybe someone can send a pr

@sigmaSd sigmaSd changed the title Add full Jupyter kernel support Improve Jupyter kernel support Apr 20, 2023
@sigmaSd
Copy link
Owner Author

sigmaSd commented Apr 20, 2023

I reread the jupyter docs and the implementation here https://github.com/sigmaSd/IRust/tree/master/crates/irust_repl#jupyter-kernel

what I see is:

  • The current implementation works but is bear-bone
  • I have a couple of ideas on how to improve it :
    • Instead of waiting on irust to be more ipc friendly, we can just have a new binary irust_jupyter that executes the commands it receives from the python kernel (like the current re example but with more on the rust side)
    • I'm not sure though if the parsing of the input should be on the python or the rust side

But I don't want to go through the effort of adding this, without knowing how people use it, so my plan for now is to wait for feedback on the current implementations:

  • whats is being used for
  • what are the obvious limitations and things to improve
  • are there particular features ppl want

And I'll try to keep fixing low hanging fruits, until the picture is more clear and I can start on the rework

@baiguoname
Copy link

I put the re.exe in the same directory of irust.py, and change the absolute absolute_path/re path in irust.py to relative path re. And then run jupyter from the directory. Then everything works fine, the jupyter just run magically as fast as like running the python on jupyter.
But I have an uncertainty:
Liking using irust_repl in terminal, each time I executing an input, the already inserted code to the Repl object will run again. I am using irust_repl in an website server, which accept input codes at once and run the all input codes then return output. So the behavior of rerunning the inserted codes have no effect on my website server. But I thought it may have effects when running irust_repl in jupyter. As I know, the common process of using jupyter is running the cells over and over again without restarting the kernel. So if the inserted codes have some heavy task of computing, it will take some unnecessary time to rerun these codes.

@sigmaSd
Copy link
Owner Author

sigmaSd commented Apr 20, 2023

Yes unfortunately that's a core limitation to this project, it's just how it works

@sigmaSd
Copy link
Owner Author

sigmaSd commented Apr 21, 2023

I improved the installation experience https://github.com/sigmaSd/IRust/blob/master/crates/irust_repl/README.md#jupyter-kernel

Now to use the kernel you just need:

pip install irust_kernel
python -m irust_kernel.install

@sigmaSd
Copy link
Owner Author

sigmaSd commented Apr 21, 2023

I added support for evcxr protocol, so now you can use programs that targets it, example: https://github.com/sigmaSd/IRust/blob/master/crates/irust_repl/irust_kernel/evcxr.ipynb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants