7 ms·
I installed rakudo and played with it a little. However, the repl was horrible. Is there a repl that accepts multiline subroutines and if possible readline supp
by scriptdevil 11y ago
I installed rakudo and played with it a little. However, the repl was horrible. Is there a repl that accepts multiline subroutines and if possible readline support?
- zoffix222 11y agoI think you may want to install the module called Linenoise. If you have panda (Perl 6 module installer), just type panda install Linenoise and you should be all set. https://github.com/hoelzro/p6-linenoise https://github.com/hoelzro/p6-linenoise
- scriptdevil 11y agoYeah, that fixes the readline situation. Still, if has to type everything in one line for it to evaluate, the REPL isn't of much use is it?
- b2gills 11y agoI use rlwrap instead. The REPL is one of the features that hasn't gotten as much attention as it should. It was much more important to spend the time getting the rest of the language into shape. That said I use the REPL for 90% of my coding. Including temporarily replacing parts of the runtime while trying to fix them.
- zoffix222 11y agoNo idea :) In my 16-year programming career I never used a REPL of any sort. Just pop up a temp file and edit it with $editor-of-choice? XD
- SwellJoe 11y agoI thought that way until I worked with iPython for a while (back when it was primarily a clever REPL, and didn't really have the "notebooks" feature at all, yet, I don't think...this was back when it was new). Having a really strong REPL when debugging is like having a rocket, when you're used to having a hot air balloon. I've always been bothered by the weakness of Perl REPLs. It's only recently started to improve (in the past five years or so) for Perl 5, but there are some decent ones, though nothing even in the same league as iPython.
- Ultimatt 11y agoWell there's also a debugger for Rakudo. One that will even step through grammar/regex as they parse which is really nice. https://github.com/jnthn/rakudo-debugger https://github.com/jnthn/rakudo-debugger and https://github.com/jnthn/grammar-debugger https://github.com/jnthn/grammar-debugger
- SwellJoe 11y agoThat looks really nice. And I like that it defaults to doing the right thing. I always have to read the docs when using gdb, as it happens so rarely that I forget the commands for doing things...and it definitely does not default to useful behaviors, certainly not just hitting "enter" to do the next obvious thing. A debugger doesn't take the place of a good REPL, but it's a useful component of a good REPL.
- collyw 11y agoReally? I always see a debugger > REPL. In what ways do you see a REPL as being more powerful?
- SwellJoe 11y agoNot necessarily just from a debugging perspective (though I did mention debugging, specifically, above), but from an exploratory programming perspective. The ability to start with a snippet of something, and then trying new things. I often don't know how to solve something until I've tried several ways of doing it. A REPL (a really functional one like iPython, or, I imagine the better Lisp or Smalltalk REPLs, though I've rarely used either language) is a really nice way of doing that. A debugger, in my mind, is for running the program as it exists on disk and then inspecting it. A REPL is for interactively writing a new program. It is a different way of thinking about programming. On one hand it's something you do first in your editor and then you fix the bugs in the debugger. On the other hand, it's something you tinker with until you're happy and then you commit it to disk. Even when I worked in Python, I would mostly write the code in vim, but when I was trying to understand a new library or sort out the right data structure or algorithm for something I'd use the REPL. I guess the lines are blurry. iPython is called a Python shell, or was when I was using it. So, saying "REPL" may be misleading, if your vision of a REPL is merely "it executes a statement". You can build up quite complex functions in iPython and execute them on arbitrary data. It doesn't restrict you to one-liners. If the Perl 6 debugger allows defining new functions (and other stuff beyond merely tweaking data), then it's probably in a similar category, if still immature.