Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by Andrew Shitov
Raku: la lingua dove posso parlare italiano
(Raku: the language where I can speak Italian) There are a few interesting modules in the L10N namespace in the Raku ecosystem: L10N itself and the family of L10N::... modules written by different authors (I added three just yesterday). What these modules allow you to do is switch the built-in keyword dictionary of the language itself and thus write code in a language other than English.
Raku: a language that counts to infinity (Part 2)
In this part, let's look at infinite sequences from another angle: let's start collecting the values. First of all, Raku has a pair of built-in routines gather and take. They are useful when you need to collect data that's computed along the way. For example: my @data = gather { for ^50 { my $value = 100.rand.Int; take $value if 45 < $value < 55; } } say @data; The program prints a few random numbers between 45 and 55 (or none when unlucky).
Raku: a language that counts to infinity (Part 1)
We've already seen that Raku understands characters like ∞, and it would be logically that you can use them with ease, similar to any other constructs of the language. Take, for example, a sequence with no definite end. You define a pattern and take as many items as you need. say (1, 1, * + * ...
Raku: a Language Where 0.1 + 0.2 is 0.3
Programming languages are fascinating. Even if you think that these are the last days when you need to write code yourself, that only gives you more time to enjoy the beauty. In this article I would like to showcase some of the small but astonishing features of Raku. Even if you never had a chance to install a compiler on your machine, you can run all the examples below in the online Raku playground straight away.
Computing factorials using Raku
In this post, I am demonstrating different ways of computing factorials using the Raku programming language. In this post, I’d like to demonstrate a few ways of computing factorials using the Raku programming language.
Articles
The Trouble with Reference Counting Jan 25, 2021 by David Farrell Is tracing garbage collection a realistic alternative?
The course of Raku
I am happy to report that the first part of the Raku course is completed and published. The course is available at course.raku.org. I am happy to report that the first part of the Raku course is completed and published. The course is available at course.raku.org. The grant was approved a year and a half ago right before the PerlCon conference in Rīga. I was the organiser of the event, so I had to postpone the course due to high load.
Raku Challenge, Week 92, Issue 1
This week’s task has an interesting solution in Raku. So, here’s the task: You are given two strings $A and $B. Write a script to check if the given strings are Isomorphic. Print 1 if they are otherwise 0. This week’s task has an interesting solution in Raku. So, here’s the task: You are given two strings $A and $B. Write a script to check if the given strings are Isomorphic. Print 1 if they are otherwise 0.
Raku Challenge, Week 92, Issue 1
This week’s task has an interesting solution in Raku. So, here’s the task: You are given two strings $A and $B. Write a script to check if the given strings are Isomorphic. Print 1 if they are otherwise 0. This week’s task has an interesting solution in Raku. So, here’s the task: You are given two strings $A and $B. Write a script to check if the given strings are Isomorphic. Print 1 if they are otherwise 0.
Advent of Code 2020 Day 18/25 in the Raku programming language
Today there’s a chance to demonstrate powerful features of Raku on the solution of Day 18 of this year’s Advent of Code. The task is to print the sum of a list of expressions with +, *, and parentheses, but the precedence of the operations is equal in the first part of the problem, and is opposite to the standard precedence in the second part. In other words, 3 + 4 * 5 + 6 is (((3 + 4) * 5) + 6) in the first case and (3 + 4) * (5 + 6) in the second. Here is the solution.
The second wave of Covid.observer
In this post, I am telling a story of how updating covid.observer became a bit problematic, and how one of the developers of the Rakudo compiler helped not only to remove the errors but also to speed up the whole system by 2x. When I started covid.observer about seven months ago, I thought there would be no need to update it after about 3-4 months.
Advent of Code 2020 Day 12.1/25 in the Raku programming language
Here is my solution of the first part of Day 12 of this year’s Advent of Code. The point in this solution is that I use multi functions a lot. Well, actually, the whole logic of the program is based on the dispatching rules of the variants of a single multi function. We start with a ship at point (0, 0) on a 2D map and we’ve got a list of instructions such as: F10 N3 F7 R90 F11 The letters N, S, W, and E mean that you have to move the position the given distance North, South, West, or East.
Advent of Code 2020 Day 9/25 in the Raku programming language
Day 9 of Advent of Code is here and the task is the following. Take a list of numbers and find the first one, which is not the sum of two of the 25 preceding numbers. my $window = 25; my @data = 'input.txt'.IO.lines.map: *.Int; say @data[($window ..^ @data).first({ @data[$_] != any(@data[$_ - $window ..^ $_].combinations(2).map: *.sum) })]; The numbers are read from a text file with IO.lines, and are also mapped to integers.
Advent of Code 2020 Day 1/25 in the Raku programming language
OK, I solved a few days of the on-going this year’s Advent of Code, so maybe it is a good idea to document it a bit so that those who like Raku can look at it too. So, the problem of Day 1 is to take a long list of integers and find such two neighbouring numbers that add to to 2020. The second part of the task is to find three such numbers. I saved a list of integers in a separate text file (it is also the case for all further tasks), so I use Raku to read the data from it.
A problem solved in 22 programming languages
In this post I am demonstrating the solutions of a programming problem in 22 different languages: Raku, Python, C++, Perl, Ruby, Scala, C#, Dart, Julia, D, Lisp, C, JavaScript (Node.js), Java, Rust, Pascal, Go, Lua, Fortran, PHP, Kotlin, and Bash. This post was written for the Advent Calendar 2020 in The Weekly Challenge and was first published on 6 December at perlweeklychallenge.org/blog/advent-calendar-2020-12-04.
Show More
loading
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with Andrew
Contact Andrew, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack