entropyorg / p5-devel-iperl Goto Github PK
View Code? Open in Web Editor NEW:microscope::books: Perl5 language kernel for Jupyter <http://jupyter.org/>
Home Page: http://p3rl.org/Devel::IPerl
:microscope::books: Perl5 language kernel for Jupyter <http://jupyter.org/>
Home Page: http://p3rl.org/Devel::IPerl
Need to have the latest stable IPython (at least)
Create a dev
directory with provisioning scripts. Add all this to MANIFEST.SKIP
.
Compile the Perl source to find common errors as you type.
See ipython/ipython#6126 to see how live notebook switching works.
/home/zaki/sw_projects/p5-Devel-IPerl/ipython/IPython/kernel/manager.py:91: UserWarning: Setting kernel_cmd is deprecated, use kernel_spec to start different kernels.
warnings.warn("Setting kernel_cmd is deprecated, use kernel_spec to "
IPython Console 3.0.0-devIPython profile: perl
It currently does not work at all. See discussion on #perl6.
What it requires is better ZeroMQ bindings (see the zavolaj native call API).
Forked to https://github.com/zmughal/iperl6kernel
Is there a way to get some variable and function colors into the notebook?
Just installed Devel::IPerl on a 5.20 threaded perl on OS X 10.11.1. The install went through after getting Cairo to install; needed to reinstall cairo via homebrew.
Running a jupyter notebook went into a kernel death spiral until I installed B::Keywords.
It's working now! Woo!
I asked a question about execution semantics of the "single" mode here http://mail.scipy.org/pipermail/ipython-dev/2015-January/015764.html.
You can set the mode if you are using Python by setting the interactivity
parameter of run_ast_nodes():
import IPython.core.interactiveshell as intshell
intshell.InteractiveShell.ast_node_interactivity = 'last' # ‘all’, ‘last’, ‘last_expr’ or ‘none’,
I see the kernel registered now, but the colored syntax is lost when the cell is executed.
if a subroutine is saved in a cell and then recompiled, the notebook can't be saved. The redefined subroutine issue is avoidable, but it may be a common issue.
Notebook Validation failed: [u'Subroutine kgd_tp redefined at reply input line 12.\n'] is not of type u'string':
[
"Subroutine kgd_tp redefined at reply input line 12.\n"
]
Compilation errors need to caught and returned on stderr
There is now a tool to test the message spec: see ipython/ipython#7646. https://github.com/jupyter/jupyter_kernel_test.
for (0..2) {
say "test";
sleep 2;
}
will take 6 seconds to run before it prints out "test" 3 times. I am assuming the best way
to do this is to spawn a child process with redirected output handles and monitor its output.
Perhaps by using IO::Pty. It is important to keep in mind how portable that
may be.
using the command line from a cell with back ticks worked for me before (e.g. perldoc Foo::Bar
), but not with the most recent changes.
See http://irclog.perlgeek.de/pdl/2015-06-21#i_10781748 (will add more details later, execute_reply, text/plain MIME output (via IPerl->display( "a string" ), quick MIME output ( IPerl->display_mime( "text/plain" => "hi!" ) )
@jberger++
The readlink line in the iperl script is causing the kernel to crash on my os x machine. I commented out the line and it works well for me.
use Modern::Perl;
say 'something'; #works
new cell
say 'something'; #error
I am using ipython 2.20, and with recent release like 0.005, iperl does not work. It seems that earlier ipython does not support "ipython console --kernel xxx".
See the following from IPython documentation:
Since warnings can be emitted with a stacktrace, figure out how to best fit them into the IPython messaging spec.
See ML message: http://mail.scipy.org/pipermail/ipython-dev/2015-February/015960.html
Should not use IO::Async
's spawn_child
function since Windows does not support POSIX fork()
.
IPython extension: http://ipython.org/ipython-doc/stable/config/extensions/autoreload.html
package Experiment {
use Moo;
has [ qw( param1 param2 param3 ) ] => ( is => 'rw' );
has data => ( is => 'rw' );
};
I should be able to come back later and add another attribute to the Moo class and not have it give me the error: You cannot overwrite a locally defined method (attribute_name) with an accessor at...
I know in IPerl we can use DDP or Data::Dumper and explicitly call p() or Dumper() to pretty-print variables. But can we make it behave like the reply or re.pl in that it automatically does pretty-print on entering a variable or evaluating an expression?
use v5.16;
use utf8::all;
say "\x{2019}";
use v5.16;
use Statistics::NiceR;
$r = Statistics::NiceR->new;
say $r->eval_parse( 'summary( lm( Sepal.Width ~ Sepal.Length, iris ) )' );
nbconvert
(and thus the nbviewer service) uses the pygments lexer to highlight code when generating static HTML files.
See #24.
Probably use the Ruby lexer as a base as it is most similar to Perl.
Both ZMQ::LibZMQ3 and ZMQ::LibZMQ4 should be supported.
See also issue with deprecated functions in https://rt.cpan.org/Ticket/Display.html?id=105652 and https://github.com/EntropyOrg/p5-Devel-IPerl/tree/fix/zmq-ctx-api.
bin/iperl
) needs to be converted to Perl for portability.ipython
command except that it will alsoUpon shutdown of the language kernel, ZeroMQ gives the following error:
Bad file descriptor (epoll.cpp:67)
I have a feeling this is because a part of the kernel is trying to read from a socket after
the frontend has closed it.
Some of my students use windows
I'm having difficulty opening old iperl notebooks jupyter notebook after installing ipython4. I can load and reload a new iperl notebook.
A Perl Back End
The IPython Notebook doesn't have to use Python as the back-end process:
they've defined a JSON-based protocol for communicating with arbitrary processes,
and people have already built a replacement back-end in Julia (and are working on one in R).
There are lots of Perl programmers in science;
a Perl back-end would probably get a lot of love.
Needs more work:
Now that both Devel::REPL
and Reply
are both supported, there needs to be a way of configuring how those are started up.
Easier to install and faster to load.
Enhance the setup script to register IPerl as plugin in the normal ipython notebook
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.