Dear Volker,

Le dimanche 3 janvier 2016 16:33:36 UTC+1, Volker Braun a écrit :
>
> On Sunday, January 3, 2016 at 2:41:51 PM UTC+1, Emmanuel Charpentier wrote:
>>
>>
>>    - "other language" cells : %maxima and %r (possibly other 
>>    interpreters such as %octave) do not work as expected. Both %maxima and 
>> %r 
>>    open new instances of their respective interpreters and enter an REPL 
>> that 
>>    cannot be exited (even with an explicit "quit();" or "q('no')". In other 
>>    words, they never return
>>
>> Interactive line magics obviously can't work in the browser like on the 
> command line 
>

> The lack of appropriate cell magics (%%maxima)  is just an existing bug on 
> the commandline.
>

Indeed. We should have %%maxima, %%r , %%pari, etc...

[ BTW : that's not really a bug, but rather a design conflict : the 
original %mode functions were designed to switch (for an indefinite scope) 
the behaviour of the REPL.This was transposed in the Sage notebook as what 
amounts to the equivalent of Jupyter's cell magics (scope defined as the 
current cell). Whereas line magics are, as far as I understand, 
Jupyter-specific... We can't be consistent across notebooks without 
redefining our "mode switch" magics as "cell magics", and rename them with 
"%%"...  ]

>
> Of course if you care about it then send in a patch.
>

I do and I plan to. Therefore, I'm trying to understand how to add such 
magics to Jupyter. I'm currently swimming (drowning...) on my source tree 
in order to understand how this should be done. The difficulty is not the 
code itself, but how to package it as a magic.

Same question about %cython (which should become %%cython ?), with another 
difficulty : how to define the function in the global namespace as in the 
command line or Sage notebook... The relevant compile_and_load() function 
returns a module (from which one can of course import *, which would mimic 
the current Sage notebook behavior) ; the point is to do this automatically 
from the magic function). 

>
> On the plus side, the jupyter notebook comes with an official R kernel 
> available as Sage optional package: sage -r r_jupyter.
>

Indeed ! And that's appreciable (and apprecied). The same could be done for 
various  Sage-inclu(ded-dable) languages (pari, octave) for which a Jupyter 
kernel exists (see this list 
<https://github.com/ipython/ipython/wiki/IPython-kernels-for-other-languages>). 
Maxima is a special case : the existing Maxima-Jupyter kernel wont't adapt 
to our ECL-compiled implementation (I asked)...

BTW, your r_jupyter package doesn't appear in the output of sage -installed, 
nor in the output of sage -optional...

--
Emmanuel Charpentier

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to