今日已更新 166 条资讯 | 累计 40611 条内容
关于我们

标签:#raku

找到 5 篇相关文章

AI 资讯

Mainstreaming RakuAST

Yes, it looks like the next release of Rakudo (2026.09, tentatively planned for 26 September) will be the first Rakudo release that will use the new Raku backend (based on a new grammar producing RakuAST) as the default when compiling a writting in the Raku Programming Language . Until then one had to specify the RAKUDO_RAKUAST=1 environment variable to activate the new backend. It is a major step towards releasing the next Raku language level, tentatively still called "6.e" for historical reasons, later this year. Note that the 2026.09 Rakudo release will not remove the old backend from the core just yet: you will be able to activate the old backend by specifying the RAKUDO_LEGACY=1 environment variable. However, the old backend will be removed when the 6.e Raku language level is released. So it is very important to check what these changes will mean for you! Immediate effects So what will a user of this Rakudo release notice with their apps and libraries? Nothing In the past weeks the Raku ecosystem has been thoroughly scoured for code that would stop functioning in RakuAST. Some finds turned out to be omissions / errors in the RakuAST implementation (which then have been fixed). Others turned out to be modules doing (semi-)naughty things, for which Pull Requests were made to ensure they will continue to operate in RakuAST. Running slower It could well be that your code is running without issues, but all of a sudden runs slower than before. Years of optimizing the old backend were mostly lost in RakuAST. And had to be re-created in the RakuAST-based backend. Which may have lost a few nooks and crannies that affect the execution speed of your code. Slower execution should be reported as a bug, so that it can be fixed! Running faster One of the goals of the RakuAST projects was to be able to provide better optmizations. Some of the ideas for these optimizations have already been implemented in RakuAST. And as a part of this work, a lot of aspects of the runtime have

2026-08-31 原文 →
AI 资讯

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). You don't know upfront how many numbers it will pick, but at least there's some limit: the loop body runs only 50 times, and the random numbers are less than 100. So, it's time to introduce some infinity into the code. The next program scans the number, but does not explicitly say how many of them the user will use later. The second line, for example, demands the first five items, and that's when the real computation happens: my $data = gather for 1 .. ∞ { take $_ if 45 < $_ < 55 } say $data[^5]; # (46 47 48 49 50) Surprisingly, working with infinities makes the code clearer for the reader. You just describe what to do with data, but omit the length. The next snippet literally says “Convert the numbers to their squares”. You apply this rule to the infinite (but lazy) range 1 .. ∞ , and only then you take the first five elements. say (gather for 1 .. ∞ { take $_ × $_ }).head(5); Once again, note that you first apply the action to an infinite sequence, and only then cut it to the size you need. Not vice versa (of course you can if you know when to stop; but sometimes you need the condition on the results rather than on the source). The program prints: (1 4 9 16 25) A similar approach is demonstrated in the next two lines: say ([\+] 1 .. ∞)[^10]; say ([\*] 1 .. ∞)[^7]; Wait, how? Add up or multiply all the integer numbers, and then take the first few elements of one of the triangle metaoperator's results?! Yes, no problem. A couple of triangle metaoperators are only used to compute the values for the first few items, not for the

2026-08-31 原文 →
AI 资讯

DSCI series / Rakulang CI, part2. Cro Application

In this episode I talk about developing web application based on well known cro framework and specifically how to create CI pipeline using DSCI tool. Here is example of very simple cro application (taken from cro web site): use Cro::HTTP:: Router ; use Cro::HTTP:: Server ; my $application = route { get -> { content ' text/html ', ' Hello Cro! '; } } my Cro:: Service $service = Cro::HTTP:: Server . new : : host < localhost > , : port < 10000 > , : $application ; $service . start ; react whenever signal ( SIGINT ) { $service . stop ; exit ; } First of all let's create jobs file .dsci/jobs.yaml that would contain list of jobs, in our case this is just a single job: jobs : - id : ci path : . In this case we would have just a single job that: installs apps dependencies runs web application in background runs some end to end tests using http client .dsci/job.raku run_task " install "; run_task " end-to-end "; .dsci/tasks/install/task.bash set -e cd ../ ls -l zef install . --deps-only zef install . echo "done" nohup cro run 1>app.log 2>&1 & </dev/null The first task just installs application dependencies and runs web application in background, now we can create some end to end test. For simplicity I am going to use curl http client here, but feel free choose any languages you like, for example Raku's HTTP::Tiny client, DSCI is super flexible allowing to write tasks on different languages mixing then effectively. .dsci/tasks/end-to-end/task.bash I could have made this simple one line Bash task a part of initial install task, but for claritrty and demonstration of modularity I keep as a separate one. In the future more tests may come (rathe then this trivial one) and it reasonable separate installation and testing logic. set -e # the test should fail if HTTP response is not # successful curl 127.0.0.1 127.0.0.1:10000 -f -L Ok, let's try this out. And the very first run results in ... error: 08:47:39 :: ===> Building: Digest::SHA1::Native:ver<1.0.1>:auth<zef:bduggan> 08:47:39

2026-07-30 原文 →
AI 资讯

Linux compliance checks with Sparrow plugin

Sparrow is Raku automation framework comes with useful plugins people can use to automate infrastructure. Scc plugin allows to check Linux essential configuration files for security compliance. Here some examples: Sysctl $ sudo sysctl -a | s6 --plg-run scc@check = sysctl 12:24:07 :: [task] - run plg scc@check=sysctl 12:24:07 :: [task] - run [scc], thing: scc@check=sysctl [task run: task.bash - scc] [task stdout] 12:24:08 :: abi.cp15_barrier = 1 12:24:08 :: abi.setend = 1 12:24:08 :: abi.swp = 0 12:24:08 :: abi.tagged_addr_disabled = 0 12:24:08 :: debug.exception-trace = 0 12:24:08 :: dev.cdrom.autoclose = 1 12:24:08 :: dev.cdrom.autoeject = 0 12:24:08 :: dev.cdrom.check_media = 0 12:24:08 :: dev.cdrom.debug = 0 12:24:08 :: dev.cdrom.info = CD-ROM information, Id: cdrom.c 3.20 2003/12/17 12:24:08 :: dev.cdrom.info = 12:24:08 :: dev.cdrom.info = drive name: 12:24:08 :: dev.cdrom.info = drive speed: 12:24:08 :: dev.cdrom.info = drive # of slots: 12:24:08 :: dev.cdrom.info = Can close tray: 12:24:08 :: dev.cdrom.info = Can open tray: 12:24:08 :: dev.cdrom.info = Can lock tray: 12:24:08 :: dev.cdrom.info = Can change speed: 12:24:08 :: dev.cdrom.info = Can select disk: 12:24:08 :: dev.cdrom.info = Can read multisession: 12:24:08 :: dev.cdrom.info = Can read MCN: 12:24:08 :: dev.cdrom.info = Reports media changed: 12:24:08 :: dev.cdrom.info = Can play audio: 12:24:08 :: dev.cdrom.info = Can write CD-R: 12:24:08 :: dev.cdrom.info = Can write CD-RW: 12:24:08 :: dev.cdrom.info = Can read DVD: 12:24:08 :: dev.cdrom.info = Can write DVD-R: 12:24:08 :: dev.cdrom.info = Can write DVD-RAM: 12:24:08 :: dev.cdrom.info = Can read MRW: 12:24:08 :: dev.cdrom.info = Can write MRW: 12:24:08 :: dev.cdrom.info = Can write RAM: 12:24:08 :: dev.cdrom.info = 12:24:08 :: dev.cdrom.info = 12:24:08 :: dev.cdrom.lock = 0 12:24:08 :: dev.raid.speed_limit_max = 200000 12:24:08 :: dev.raid.speed_limit_min = 1000 12:24:08 :: dev.scsi.logging_level = 68 12:24:08 :: dev.tty.ldisc_autoload = 1 12:24:08

2026-07-09 原文 →