Raku : Raku

flymake-rakudo - Another syntax checker for Raku on Emacs

Flymake I've been switching to Emacs packages which are lighter and use the internal Emacs system, instead of creating their own. This time I wanted to try Flymake, the syntax checker that comes with Emacs. At first it wasn't very appealing because I thought it would only show the error on mouse hover! So I tried to see what options I have for displaying the error messages when text cursor moves over them.

How to write Raku's trans routine/operator in Go

I was looking for a way to transliterate(translate) English numbers to Persian numbers in Go. Such functionality is usually found in programming languages, but I wasn't expecting too much from Go. It's very easy to do in Raku: say 567.trans: '0'..'9' => '۰'..'۹' =output ۵۶۷␤ say TR/0..9/۰..۹/ given 567 =output ۵۶۷␤ For Go I found xstrings module which has a Translate function. But the solution I came up with was using NewReplacer function from Go's internal strings module:

T - Easy way of writing test assertions which output good test descriptions and error messages in Raku

After I finished watching Daniel Sockwell's FOSDEM 2022 Raku presentation, I thought this is a good opportunity to play with Raku's slangs, something I hadn't done before. What is Daniel's talk(and upcoming module) and my module going to solve? Write less but more readable test code Get a useful test description and failure message If you use cmp-ok, you get a good error message; but without a test description it's sometimes hard to understand.

Raku, Go, Chroma, Germanium, Hugo and my blog

When I created my Raku programming language website with Hugo static site generator, I had to manually create the syntax highlighted html files for code examples shown in the front page, because Hugo used Chroma(written in Go and uses a mostly similar API to Pygments) for syntax highlighting which didn't support Raku. So I opened an issue on Chroma, the discussion showed that you cannot just convert the Raku lexer from Pygments to Chroma; You would need to create some functions manually, and Chroma needed a new Emitter interface which would take the LexerState as an argument, because Raku has some complex syntax; the Raku lexer in Pygments had functions for finding closing brackets matching the opening brackets, and for regex nesting in tokens, regexes and rules.

An improved flycheck-raku now available on melpa [Emacs]

Recently I forked the flycheck-raku (by @widefox) to the Raku GitHub organization. And did some improvements to it and published it on melpa, so others can easily install and update it. For those who don't know, flycheck is a tool for syntax checking Gnu Emacs buffers. You can install flycheck-raku using use-package: (use-package flychek-raku :ensure t) New features Project detection Previously if you used flycheck-raku on a project, it would show errors on use SomeModule;, even though the module was in the lib directory of the project.

How to type Raku unicode characters in Emacs

Raku programming language uses some unicode characters as operators, quotation marks, etc. In this post I'm going to explain how to type those characters in Emacs using input methods. First, you might want to see a list of those characters and their ASCII equivalents here. There is also a doc for entering unicode characters. You may specifically want to look at XCompose for a system-wide solution. There are at least two input methods you can use to enter the unicode characters used in Raku.