Day 19: Typed Raku, Part 2: Taming Behaviour

In the previous part, I claimed that types can allow for more fluid, robust code, then wrote a bunch of restrictive types for chess that won’t allow for this to occur: Branching with Multiple Dispatch There’s a key concept we need to understand before we can fix the types we wrote, but we can’t useContinue reading “Day 19: Typed Raku, Part 2: Taming Behaviour”

Day 18: Typed Raku, Part 1: Taming State

When I started learning Raku a couple years back, one of the first features that stuck out to me was its type system. This is one I feel gets overlooked at times. I found this to be rather difficult to wrap my head around at first, but I found that relying on strict typing canContinue reading “Day 18: Typed Raku, Part 1: Taming State”

Day 17: Becoming a Time Lord in Raku

I’ve lived within a few minutes of a time zone border for most of my life. The way we distinguished time wasn’t with the official monickers of “Eastern” and “Central” time. No, we used the much more folksy (and yet, also much cooler) terms “fast time” and “slow time”. Knowing which zone you were talkingContinue reading “Day 17: Becoming a Time Lord in Raku”

Day 16: Writing faster Raku code, Part II

By Wim Vanderbauwhede This is the follow-on article about writing an expression parser in Raku. In the previous article, I explained the background looked at some basic performance comparisons relating to data structures for parsing and ways to process them: lists, parse trees, recursive descent and iteration. In this article, we’ll have a look atContinue reading “Day 16: Writing faster Raku code, Part II”

Day 14: Writing Faster Raku code, Part I

By Wim Vanderbauwhede Last year, in Perl land, I discussed the result of my attempts to optimize the performance of an expression parser which is part of my Perl-based Fortran source-to-source compiler. An expression parser takes strings representing expressions in a programming language (in my case Fortran) and turns it into a data structure calledContinue reading “Day 14: Writing Faster Raku code, Part I”

Day 11: Santa Claus TWEAKs with a Class

Prologue Santa [1][2] was browsing the eTrade magazines on his iPad one morning and came across an article referenced in the latest O’Reilly Programming Newsletter about how ancient COBOL is the programming language still used for the bulk of the world’s business software. He had been aware of that since his huge operations with millionsContinue reading “Day 11: Santa Claus TWEAKs with a Class”

Day 9: Getting Windows Memory Usage with NativeCall

Raku NativeCalls provide a way to interact with dynamic libraries that follow the C calling convention and are very useful for obtaining information from the operating system, such as memory usage. In this article we will see how to get the memory usage from a Windows system. The MEMORYSTATUSEX C++ structure Win32 API provides theContinue reading “Day 9: Getting Windows Memory Usage with NativeCall”

Day 8: Raku web templating engines: boost up the parsing performance

Modern Raku web templating engines A templating engine basically provides tools for effective metadata interpolation inside static files (templates). At web application runtime, the engine parses and replaces variables with actual content values. Finally client gets a HTML page generated from the template, where all metadata (variables, statements, expressions) has been processed. Raku ecosystem hasContinue reading “Day 8: Raku web templating engines: boost up the parsing performance”

Day 6: Declarative APIs, easy peasy with Raku

Raku APIs tend to be easy to read, with named arguments alleviating the need to remember argument order in method calls, for example. But sometimes a library author goes above and beyond to produce extra nice, declarative APIs. One example is Cro, a framework for writing HTTP-based services, which allows you to write things likeContinue reading “Day 6: Declarative APIs, easy peasy with Raku”

Day 3: Literate Programming with Raku

Literate Programming with Raku Different programming language communities have differing cultures. Some are more pragmatic, others more idealistic. Some place great emphasis on having code be thoroughly readable and understandable for anyone who joins an existing project, and some prefer writing out clear and in-depth documentation. Raku, inheriting one of the best parts of Perl,Continue reading “Day 3: Literate Programming with Raku”