PageSourceSearch

https://raku.org/learn

html raku.org collected 2026-10-02 02:56:28 UTC 15,125 bytes, 435 lines download raw bytes

1<!doctype html>
2<html lang="en" data-theme="dark">
3<head>
4<title>Raku®</title>
5<meta name="description" content="The Raku® programming language." />
6<meta charset="utf-8" />
7<meta content="width=device-width, initial-scale=1" name="viewport" />
8<script src="https://unpkg.com/[email protected]" integrity="sha384-xcuj3WpfgjlKF+FXhSQFQ0ZNr39ln+hwjN3npfM9VBnUskLolQAcN80McRIVOPuO" crossorigin="anonymous"></script>
8
9
10<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/highlight.min.js"></script>
10
11
12<script src="https://cdn.jsdelivr.net/gh/highlightjs/[email protected]/build/languages/haskell.min.js"></script>
12
13
14<script>
15            (function () {
16                const savedTheme = localStorage.getItem("theme");
17
18                let theme;
19                if (savedTheme) {
20                    theme = savedTheme;
21                } else {
22                    theme = window.matchMedia("(prefers-color-scheme: dark)").matches
23                        ? "dark"
24                        : "light";
25                }
26
27                document.documentElement.setAttribute("data-theme", theme);
28            })();
29        </script>
29
30
31<script defer src="https://cloud.umami.is/script.js" data-website-id="bd5ca56b-3bad-47c7-b0a1-73ba5c3b5713"></script>
31
32
33<link rel="icon" href="/img/favicon.ico" type="image/x-icon" />
34<link href="/css/styles.css" rel="stylesheet" />
35<link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" rel="stylesheet" />
36<style>.tab-menu {
37    display: block;
38    justify-content: left;
39}
40.tab-links {
41    display: block;
42}
43.tab-links > li.active > a {
44    text-decoration: underline;
45}
46
47@media (max-width: 768px) {
48    .tab-menu {
49        text-align: left;
50    }
51    .tab-links > * {
52        padding-top: 0;
53        padding-bottom:1em;
54    }
55}
56</style>
57
58<style>.tab-menu {
59    display: block;
60    justify-content: left;
61}
62.tab-links {
63    display: block;
64}
65.tab-links > li > a {
66    border-radius: var(--pico-border-radius);
67    border-top-left-radius: 0;
68    border-top-right-radius: 0;
69    background-color: transparent;
70    text-decoration: none;
71    cursor: pointer;
72    user-select: none;
73}
74.tab-links > li.active > a {
75    text-decoration: none;
76    border-bottom: var(--pico-border-width) solid var(--pico-primary-hover);
77}
78
79@media (max-width: 768px) {
80    .tab-menu {
81        text-align: center;
82    }
83    .tab-links > * {
84        padding-top: 0;
85        padding-bottom:1em;
86    }
87}
88</style>
89
90<style>dashboard {
91  display: flex;
92  flex-wrap: wrap;
93  justify-content: center;
94  gap: 1rem;
95}
96</style>
97
98<style>dashboard > article {
99  display: flex;
100  align-items: center;
101  flex-direction: column;
102
103  /* Responsive sizing */
104  flex: 1 1 600px;
105  max-width: 800px;
106
107  padding-left: 0.5rem !important;
108  padding-right: 0.5rem !important;
109  margin-top: 0 !important;
110}
111
112dashboard > article > header {
113  border-bottom-color: darkgray;
114  border-radius: 0px;
115}
116
117dashboard > article > footer {
118  border-top-color: darkgray;
119  border-radius: 0px;
120  margin-top: auto;
121}
122</style>
123
124<style>/* Custom styles for the hamburger menu */
125.menu {
126    display: none;
127    flex-direction: column;
128    gap: 10px;
129    position: absolute;
130    top: 60px;
131    right: 20px;
132    background: rgba(0, 0, 0, .95);
133    padding: 1rem;
134    border-radius: 8px;
135    box-shadow: 0 4px 6px rgba(128, 128, 128, .2);
136    z-index: 800;
137}
138
139.menu a {
140    display: block;
141}
142
143.menu.show {
144    display: flex;
145}
146
147.hamburger {
148    color: var(--pico-primary);
149    display: none;
150    cursor: pointer;
151    font-size: 2.5rem;
152    background: none;
153    border: none;
154    padding: 0.5rem;
155}
156
157@media (max-width: 768px) {
158    .hamburger {
159        display: block;
160    }
161
162    .nav-links {
163        display: none;
164    }
165}
166</style>
167</head>
168
169<body>
170<header class="container">
171<nav>
172<ul>
173<li class="logo">
174<span>
175<a target="_self" style="display: flex; align-items: center; gap: 0.5rem; text-decoration: none;" href="https://raku.org">
176<img title="Hi, my name is Camelia. I'm the spokesbug for the Raku Programming Language. Raku has been developed by a team of dedicated and enthusiastic open source volunteers, and continues to be developed. You can help too. The only requirement is that you know how to be nice to all kinds of people (and butterflies)." src="/img/camelia-logo.png" width="60px" />
177<p style="margin:0">Raku®</p>
178</a></span></li></ul>
179<ul hx-swap="outerHTML" hx-target="#content" class="nav-links">
180<li>
181<a href="/community">community</a></li>
182<li>
183<a href="/learn">learn</a></li>
184<li>
185<a href="/tools">tools</a></li>
186<li>
187<a rel="noopener noreferrer" href="https://docs.raku.org" target="_blank">docs</a></li>
188<li>
189<a href="https://raku.land" rel="noopener noreferrer" target="_blank">modules</a></li>
190<li>
191<a target="_blank" href="https://github.com/rakudo/rakudo" rel="noopener noreferrer">source</a></li>
192<li>
193<a href="/install">install</a></li>
194<li>
195                    <a style="font-variant-emoji: text" id ="sunIcon">&#9728;</a>
196                    <a style="font-variant-emoji: text" id ="moonIcon">&#9790;</a>
197                </li>
198</ul>
199<button class="hamburger" id="hamburger">&#9776;</button>
200<ul class="menu" hx-swap="outerHTML" id="menu" hx-target="#content">
201<li>
202<a href="/community">community</a></li>
203<li>
204<a href="/learn">learn</a></li>
205<li>
206<a href="/tools">tools</a></li>
207<li>
208<a rel="noopener noreferrer" href="https://docs.raku.org" target="_blank">docs</a></li>
209<li>
210<a rel="noopener noreferrer" href="https://raku.land" target="_blank">modules</a></li>
211<li>
212<a rel="noopener noreferrer" href="https://github.com/rakudo/rakudo" target="_blank">source</a></li>
213<li>
214<a href="/install">install</a></li>
215</ul>
216</nav></header>
217<main class="container">
218<div>
219<style>#background {
220    background: url('/img/Butterfly_bottom_PSF_transparent.gif');
221    top: 140px;
222    left: 0vw;
223    width: 100vw;
224    height: 360px;
225    background-size: auto;
226    opacity: 0.1;
227    filter: grayscale(100%);
228    transform: rotate(-9deg);
229    position: fixed;
230    background-repeat: no-repeat;
231    background-position: center top;
232    z-index: -1;
233    pointer-events: none;
234    padding: 20px;
235}
236</style>
237
238<div id="background"></div>
239</div>
240<div style="position: relative; padding: 20px;" align="center">
241<h1>Learn</h1></div>
242<dashboard>
243<article style="order: 1;">
244<header class="container">
245<h3>Getting Started</h3></header>
246<main class="container"><h4>Raku Guide</h4><ul><li><p><a href="https://raku.guide/">Raku Guide</a> is a quick overview to get you up and running.</p></li></ul><h4>Raku Docs</h4><ul><li><p><a href="https://docs.raku.org/">Raku Official Documentation</a> has in-depth Tutorials and References.</p></li></ul><h4>Online Learning</h4><ul><li><p><a href="https://course.raku.org/">Raku Course</a></p></li><li><p><a href="https://learnxinyminutes.com/docs/raku/">Learn Raku in Y minutes</a></p></li><li><p><a href="https://learnxinyminutes.com/docs/perl6-pod/">Learn Pod in Y minutes</a></p></li><li><p><a href="https://exercism.org/tracks/raku">Raku on Exercism</a></p></li></ul><h4>Code Examples</h4><p>Raku is well represented on <a href="https://rosettacode.org/wiki/Category:Raku">Rosetta Code</a>, where you can see the Raku Programming Language (and many other languages) applied to numerous programming tasks.</p></main>
247</article>
248<article style="order: 2;">
249<header class="container">
250<h3>Books</h3></header>
251<main class="container"><p>See <a href="https://perl6book.com/">a helpful chart of Raku Books</a> or pick from the list below:</p><ul><li><p><a href="https://www.apress.com/gp/book/9781484261088">Raku Fundamentals</a> by <em>Moritz Lenz</em> (published, print and ebook)</p></li><li><p><a href="https://deeptext.media/perl6-at-a-glance/">Perl6 at a Glance</a> by <em>Andrew Shitov</em> (published, print)</p></li><li><p>
251<a href="http://greenteapress.com/wp/think-perl-6/">Think Raku: How to Think Like a Computer Scientist</a> by <em>Laurent Rosenfeld</em> (published, print)</p></li><li><p><a href="https://smile.amazon.com/dp/1484232275/">Parsing with Perl6 Regexes and Grammars</a> by <em>Moritz Lenz</em> (published, print and ebook)</p></li><li><p><a href="https://kyclark.gitbooks.io/metagenomics/content/">Metagenomics</a> by <em>Ken Youens-Clark</em> (published, ebook)</p></li><li><p><a href="https://www.amazon.com/gp/product/B07221XCVL">Learning to program with Perl6: First Steps</a> by <em>JJ Merelo</em> (published, ebook)</p></li></ul></main>
252</article>
253</dashboard>
254</main>
255<footer class="container">
256<hr />
257<p>
258            Hypered with <a href="https://htmx.org" target="_blank">htmx</a>.
259            Aloft on <a href="https://harcstack.org" target="_blank"><b>&Aring;ir</b></a>.
260            Constructed in <a href="https://cro.raku.org" target="_blank">cro</a>.
261            Written in <a href="https://raku.org" target="_blank">raku</a>.
262            &nbsp;&amp;&nbsp;
263            Styled by <a href="https://picocss.com" target="_blank">picocss</a>.
264        </p>
265<p>Please report any issues with this site at <a href="https://github.com/Raku/raku.org" target="_blank">Raku/raku.org</a>.</p>
266<p>The Raku® Programming Language</p>
267</footer>
268<script>    // Hilite-helper.js
269
270    function copyCode() {
271        // copy code block to clipboard adapted from solution at
272        // https://stackoverflow.com/questions/34191780/javascript-copy-string-to-clipboard-as-text-html
273        // if behaviour problems with different browsers add stylesheet code from that solution.
274        const copyButtons = Array.from(document.querySelectorAll('.copy-code'));
275        copyButtons.forEach( function( button ) {
276        // this works with / without label
277        var codeElement = button.nextElementSibling;
278        while (codeElement && codeElement.tagName !== 'DIV') {
279          codeElement = codeElement.nextElementSibling;
280        }
281        button.addEventListener( 'click', function(insideButton) {
282            var container = document.createElement('div');
283            container.innerHTML = codeElement.innerHTML;
284                container.style.position = 'fixed';
285                container.style.pointerEvents = 'none';
286                container.style.opacity = 0;
287                document.body.appendChild(container);
288                window.getSelection().removeAllRanges();
289                var range = document.createRange();
290                range.selectNode(container);
291                window.getSelection().addRange(range);
292                document.execCommand("copy", false);
293                document.body.removeChild(container);
294            });
295        });
296    }
297
298    // DOM ready
299    document.addEventListener('DOMContentLoaded', function () {
300        // trigger the highlighter for non-Raku code
301        copyCode();
302        hljs.highlightAll();
303    });
304
305    // HTMX updates
306    document.addEventListener('htmx:afterSwap', function () {
307        copyCode();
308        hljs.highlightAll();
309    });
310</script>
310
311
312<script>function setupTabLinks() {
313    const links = document.querySelectorAll('.tab-links > *');
314    const hiddenInput = document.getElementById('selectedOption');
315    const display = document.getElementById('selectedDisplay');
316
317    links.forEach(link => {
318        link.addEventListener('click', function (e) {
319            e.preventDefault();
320
321            links.forEach(l => l.classList.remove('active'));
322
323            this.classList.add('active');
324
325            const value = this.getAttribute('data-value');
326            if (hiddenInput) hiddenInput.value = value;
327            if (display) display.textContent = `Selected: ${this.textContent}`;
328        });
329    });
330}
331
332// Run on initial load
333document.addEventListener('DOMContentLoaded', setupTabLinks);
334
335// Re-run after HTMX swaps in new content
336document.body.addEventListener('htmx:afterSwap', setupTabLinks);
337</script>
337
338
339<script>function setupTabLinks() {
340    const links = document.querySelectorAll('.tab-links > *');
341    const hiddenInput = document.getElementById('selectedOption');
342    const display = document.getElementById('selectedDisplay');
343
344    links.forEach(link => {
345        link.addEventListener('click', function (e) {
346            e.preventDefault();
347
348            links.forEach(l => l.classList.remove('active'));
349
350            this.classList.add('active');
351
352            const value = this.getAttribute('data-value');
353            if (hiddenInput) hiddenInput.value = value;
354            if (display) display.textContent = `Selected: ${this.textContent}`;
355        });
356    });
357}
358
359// Run on initial load
360document.addEventListener('DOMContentLoaded', setupTabLinks);
361
362// Re-run after HTMX swaps in new content
363document.body.addEventListener('htmx:afterSwap', setupTabLinks);
364</script>
364
365
366<script>
367            // Show/hide icons
368            function updateIcons(theme) {
369                if (theme === "dark") {
370                    sunIcon.style.display = "none";
371                    moonIcon.style.display = "block";
372                } else {
373                    sunIcon.style.display = "block";
374                    moonIcon.style.display = "none";
375                }
376            }
377            function setTheme(mode) {
378        const htmlElement = document.documentElement;
379        let newTheme = mode;
380
381        if (mode === "toggle") {
382            const currentTheme = htmlElement.getAttribute("data-theme") || "light";
383            newTheme = currentTheme === "dark" ? "light" : "dark";
384        } else if (mode === "system") {
385            newTheme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
386        }
387
388        htmlElement.setAttribute("data-theme", newTheme);
389        localStorage.setItem("theme", newTheme); // Save theme to localStorage
390        updateIcons(newTheme);
391    }
392
393    // update icons on page load
394    document.addEventListener("DOMContentLoaded", () => {
395        const theme = document.documentElement.getAttribute("data-theme");
396        updateIcons(theme);
397    });
398
399    // Listen for system dark mode changes and update the theme dynamically
400    window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", () => {
401        setTheme("system"); // Follow system setting
402    });
403
404            // Attach to icon click
405            const sunIcon  = document.getElementById("sunIcon");
406            const moonIcon = document.getElementById("moonIcon");
407
408            document.getElementById("sunIcon").addEventListener("click", () => setTheme("dark"));
409            document.getElementById("moonIcon").addEventListener("click", () => setTheme("light"));
410        </script>
410
411
412<script>const hamburger = document.getElementById('hamburger');
413const menu = document.getElementById('menu');
414
415if (hamburger && menu) {
416    hamburger.addEventListener('click', () => {
417        menu.classList.toggle('show');
418    });
419
420    document.addEventListener('click', (e) => {
421        if (!menu.contains(e.target) && !hamburger.contains(e.target)) {
422            menu.classList.remove('show');
423        }
424    });
425}
426
427// Hide the menu when resizing the viewport to a wider width
428window.addEventListener('resize', () => {
429    if (menu && window.innerWidth > 768) {
430        menu.classList.remove('show');
431    }
432});
433</script>
433
434</body>
435</html>

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.