Difference between revisions of "Raku"

From NixOS Wiki
Jump to: navigation, search
(Create page, so far containing installation instructions an a common error message)
 
m (language)
Line 3: Line 3:
 
== Installing Rakudo and Zef ==
 
== Installing Rakudo and Zef ==
  
''Rakudo'' is the preferred implementation of Raku, and the ''zef'' the preferred module manager. Install them both temporarily in a nix shell via
+
''Rakudo'' is the preferred implementation of Raku, and the ''zef'' the preferred module manager. Install them in a nix shell via
  
 
<syntaxHighlight lang=shell>
 
<syntaxHighlight lang=shell>
Line 15: Line 15:
 
=== Making the Readline library available ===
 
=== Making the Readline library available ===
  
When starting the interactive environment (via <code>rakudo</code> or the symlink <code>raku</code>), you may get an error message like this:
+
When opening an interactive environment (by running <code>rakudo</code>, or its symlink <code>raku</code>, without arguments), you may get an error message like this:
  
 
<syntaxHighlight>
 
<syntaxHighlight>

Revision as of 09:42, 28 September 2025

Warning: This article is in a very early stage.

Installing Rakudo and Zef

Rakudo is the preferred implementation of Raku, and the zef the preferred module manager. Install them in a nix shell via

nix-shell -p rakudo zef

or install them permanently by adding the lines rakudo and zef to your NixOS configuration file.

To get the Rakudo Star distribution (which bundles Rakudo with a collection of modules the language documentation), you need to download and compile it. This way, you'll also always get the latest Rakudo version.

Making the Readline library available

When opening an interactive environment (by running rakudo, or its symlink raku, without arguments), you may get an error message like this:

I ran into a problem while trying to set up Readline: Could not instantiate role 'ReadlineBehavior'; exception details:

  Cannot locate native library 'libreadline.so.7': libreadline.so.7: cannot open shared object file: No such file or directory
  in method setup at [...]

Falling back to Linenoise (if present)
No line editor found.

You may want to exit first and `zef install Readline`, `zef install
Linenoise`, or `zef install Terminal::LineEditor` or install `rlwrap`
for a line editor before entering the REPL again.

And indeed, keyboard commands like Arrow-up to go through history won't work.