ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Stanislav Sokolenko <stanislav@sokolenko.net>
To: ntg-context@ntg.nl
Subject: Re: Can anyone connect context to R or python?
Date: Mon, 8 Oct 2018 15:58:25 -0300	[thread overview]
Message-ID: <42548927-709c-1387-4786-02aab88a7c17@sokolenko.net> (raw)
In-Reply-To: <alpine.OSX.2.20.1810061247530.87501@nqv-znpobbx>

On 2018-10-06 02:06 PM, Aditya Mahajan wrote:

>
> I also want to take this opportunity to express my views on intefacing 
> with external programs. The file based interaction provided by the 
> filter module is okay for small projects but it is not ideal. Slightly 
> better is to use pipes (popen to a REPL) or use FFI (e.g 
> https://adityam.github.io/context-blog/post/interfacing-with-julia), 
> but neither of these is easy to implement and needs to be done on a 
> per-language basis. Henri Menke had a Tugboat article on this as well.
>
> In my opinion, a better long-term option is to write a jupyter client 
> in lua that can be called by context. Then we can easily interface 
> with all languages that provide a jupyter kernel 
> (https://github.com/jupyter/jupyter/wiki/Jupyter-kernels).
>
> The interface of a jupter-client is available here
> https://jupyter-client.readthedocs.io/en/stable/index.html. It seems 
> relatively straight forward (send a JSON message and receive a JSON 
> message). Translating the JSON messages to ConTeXt should also be 
> easy. Is there anyone who wants to play around trying to implement this?
>

I have recently come across the SciLua project 
(http://scilua.org/index.html) which has a built-in LuaJIT client for 
Rserve (http://scilua.org/rclient.html) and may be relevant to the 
discussion. Although it certainly isn't as general as something like 
jupyter, leaning on SciLua may be an easier means of getting access to 
scientific computation with R and basic numerical methods. I am 
personally planning to look into switching from filter to SciLua if it 
means that I can get more efficient data transfer between R and ConTeXt. 
But I'm a ConTeXt and Lua neophyte so I doubt my personal efforts will 
be translatable into something more general like a module.

Stan

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2018-10-08 18:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 14:55 Kelley, Claire
2018-10-05 17:48 ` Henning Hraban Ramm
2018-10-05 17:48 ` Pablo Rodriguez
2018-10-05 18:00   ` Kelley, Claire
2018-10-05 18:07     ` Hans Hagen
2018-10-05 18:24       ` Alan Braslau
2018-10-06 16:41       ` Kelley, Claire
2018-10-06 17:06         ` Aditya Mahajan
2018-10-06 17:08           ` Kelley, Claire
2018-10-06 17:17           ` Wolfgang Schuster
2018-10-06 17:24           ` Alan Braslau
2018-10-06 20:19             ` Aditya Mahajan
2018-10-06 20:42               ` Hans Hagen
2018-10-08 18:58           ` Stanislav Sokolenko [this message]
2018-10-08 20:57             ` Alan Braslau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42548927-709c-1387-4786-02aab88a7c17@sokolenko.net \
    --to=stanislav@sokolenko.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).