6 ms·
A Complete Course of the Raku programming language
- easygenes 6y agoSadly only first part is complete. Raku is the much more functionally inspired new Perl. It’s the renaming of Perl 6 and means “camel” or “paradise” in Japanese.
- StylusEater 6y agoLooks like people can submit PRs: https://github.com/ash/raku-course https://github.com/ash/raku-course
- deleted 6y ago[deleted]
- zeotroph 6y agoAlso I'd prefer more than one subheading per page. That would make scrolling/wheeling through the content easier.
- qsort 6y agoIs Perl/Raku widely used these days? Are they worth learning? I've always been curious about those languages but I've had the impression that people are moving away from them.
- thesuperbigfrog 6y agoLearning Perl is worthwhile because it is ubiquitous on Unix-like systems and Perl-compatible regular expressions are the defacto standard regular expression syntax. Perl may not be as popular now as it was in the past, but it is still around and lots of legacy systems that were written in Perl are still in active use.
- pvorb 6y agoBut as Perl-compatible regular expressions are available in many other languages, this is not really a reason for learning Perl itself, right? Or am I missing some deeper insight into regexes, because I don't know Perl?
- wxkn 6y agoThat's true, but it's worth mentioning that using the regexes in perl is quick and even fun to write. They are built-in to the language. some people find it very convenient.
- jrumbut 6y agoAlso the Perl community has been pushing the boundaries of regex and text processing generally. If you find yourself in a place with frequent one-off text wrangling or Unix admin problems some Perl knowledge is worthwhile.
- thesuperbigfrog 6y agoIt is a matter of personal preference. I find that regular expressions and text-wrangling tasks are faster and easier in Perl than in other programming languages due to its accessible syntax and regular expression engine speed. This article shows the regular expression syntax in several popular programming languages: https://cs.lmu.edu/~ray/notes/regex/ https://cs.lmu.edu/~ray/notes/regex/ This GitHub repo gives some regex performance test benchmarks: https://github.com/mariomka/regex-benchmark https://github.com/mariomka/regex-benchmark Perl is pretty fast among the scripting languages that were benchmarked. If you are familiar with C / C++, then learning Perl is relatively fast and easy: https://perldoc.perl.org/perlintro https://perldoc.perl.org/perlintro
- deleted 6y ago[deleted]
- pram 6y agoIn general no, but between the two: Raku is essentially used in nothing, so your time would be better spent learning Perl.
- dunefox 6y ago> Raku is essentially used in nothing, so your time would be better spent learning Perl. Only if your goal is to be able to work on legacy codebases. Learning a cool language in itself is cool.
- mempko 6y agoWe use Raku for various things. For example, generating job workflows. It has an amazing type and object system.
- anewaccount2021 6y agoI use both every day. The core perl5 packages I rely on are updated regularly. The perl5 runtime is released on a reliable schedule. Everything works. I use raku mostly for fun. It has come a long way. It has further to go, but I don't mind. There is a surprising amount of vital packages already available for getting things done. I don't think anyone believes perl5 will be as popular as it was years ago, or that raku will be a top-five language, but who cares? As long as the core community persists, its enough.
- megameter 6y agoRaku is crammed with enough good, original ideas about programming languages that I would compare it to the "learning Lisp" meme in that it will probably reveal something new to you. But as for usage, it's mostly legacy Perl codebases, which are much less interesting - Python and Ruby basically cover the same bases.
- krupan 6y agoReally, probably not. Perl was mind blowing, productive, and super fun when your only other choices were C/C++ and bash/sed/awk. Most people eventually realized that There’s More Than One Way To Do It makes for code maintenance nightmares.
- vanderZwan 6y agoGiven the sense of humor the Raku devs seem to have, I'm surprised they didn't call it an incomplete complete course (as a working title)
- sigzero 6y agoThe good thing is that it is under a grant to get the work done. Should be interesting to watch it get fleshed out.
- greydius 6y agoCamel is rakuda. Raku means easy, comfortable, without trouble, etc.
- msvan 6y agoOver the years I have learned and dipped my toes in many programming languages, and I'd need some kind of reason to look into yet another language. What are Raku's main contributions to the programming language design space that I probably haven't seen elsewhere?
- sigzero 6y agoMaybe grammars? You'd have to research. https://docs.raku.org/language/grammars https://docs.raku.org/language/grammars
- tsjq 6y agoIt is Perl
- deleted 6y ago[deleted]
- cutler 6y agoHyperoperators by The Damian.
- jinpa_zangpo 6y agoRational numbers instead of floating point as the default real type.
- db48x 6y agoThat's not exactly a new innovation though; Lisp has had a whole numeric tower for a few decades now…
- raiph 6y agoI was taught in school that `0.1` is rational. Afaik it isn't in any lisps. I think that's the point the GP was making. That said, while making `0.1 + 0.2 - 0.3` come out as exactly zero, with a clean and principled way to avoid things going pathological when the denominator gets large, is nice, it's hardly one of Raku's "main contributions to the programming language design space that I probably haven't seen elsewhere?"! :)
- qalmakka 6y agoI'm so glad they renamed Perl 6, having it dangling for decades like a Sword of Damocles hurt Perl more than anything else could. At least both languages are now able to progress in their separated ways, and I must say Raku is a really pleasant language, and a joy to use.
- sigzero 6y agoAgreed. Now both projects can more forward for whatever someone's definition of forward means. I am just glad it happened.
- wolco5 6y agoNot sure Raku was the best choice. I initially thought this was about the programming language for roku and was a little disappointed it was about perl 6 changing names.
- giancarlostoro 6y agoI'm going to butcher my question so my apologies, I've heard Perl described as a sort of linguist / grammatical type of language, where you can solve the same problem using multiple approaches and syntax. Is this something Raku is drifting from or embracing? I think Raku is kind of interesting and I did try it out a few times whilst it was called Perl 6, but I'm not sure what its niche is. I mostly do Python for professional projects but don't mind experimenting with other languages. I guess what I'm trying to ask is what are the major fundamental differences between the two languages? Features aside, although if some features are part of the answer thats fine.
- donaldihunter 6y agoRaku definitely embraces multiple approaches and syntax, continuing the “There is more than one way to do it” motto of Perl. In addition, Raku aims for consistency and composability while introducing new language constructs like laziness, gather/take, async/await, hyper operators, grammars and more.
- codesections 6y ago> I've heard Perl described as a sort of linguist / grammatical type of language, where you can solve the same problem using multiple approaches and syntax. Is this something Raku is drifting from or embracing? Very much embracing – "turning up to 11" might be a better way to put it. I recently wrote a three-part blog series[0] about what Raku's primary values, and the more-than-one-way-to-do-it idea features prominently in that list. [0]: https://www.codesections.com/blog/raku-manifesto/ https://www.codesections.com/blog/raku-manifesto/
- jonny383 6y agoIs perl or "Raku" still used in serious new applications these days? I'm not talking about gluing stuff together with scripts - I mean a large project operating wholly under it
- tyingq 6y agoNot many, but yes, there are examples. Booking.com is one. Or a smaller example, the web admin interfaces and REST API server for Proxmox is Perl.
- mfontani 6y agoThere are many Perl projects used in serious applications. Here's a few: https://www.rexify.org/ https://www.rexify.org/ -- an automation framework https://mojolicious.org/ https://mojolicious.org/ -- amazing web framework https://metacpan.org/pod/DBIx::Class::Manual https://metacpan.org/pod/DBIx::Class::Manual - amazing ORM
- gamache 6y agoShort answer: no, Perl is a very rare choice for starting a "serious new application", and Raku's even further off. In Perl's case, it's not that the production-ready libraries and frameworks aren't there -- they are, and they are fast and stable and in some cases very sophisticated -- but simply that the community of developers likely to start a "serious new application" has passed Perl by for more modern (e.g., Rust, Elixir, Kotlin, Go even if its ideas are old) or ubiquitious (e.g. JS, Python) choices. In Raku's case, there is not a deep bench of libraries and tools suitable for production. In both cases, hiring for previous knowledge is not practical.
- jjjbokma 6y agoDoes a static microblog generator[0] count as serious? I use it for my own, mostly linkblog [1]. [0] https://github.com/john-bokma/tumblelog https://github.com/john-bokma/tumblelog [1] https://plurrrr.com/ https://plurrrr.com/
- heresie-dabord 6y ago> used in serious new applications these days? Unpack this for us... Do you mean commercial applications? If so, you can determine for yourself the small number of languages used for "serious applications". If you mean data analysis, ETL, system administration, and general data reconstruction, I can't think of a faster, more appropriate language than Perl. Sed and awk are also powerful mainstays.
- krylon 6y agoSo far I have found the lack of good tutorials my main roadblock towards learning Raku. I am looking forward to spending the weekend working my way through this.
- anewaccount2021 6y agoLearnXinYminutes has a great tutorial. The main raku.org site already has incredible docs.
- cutler 6y agoRaku seems to be stuck in a "we'll optimise that later" dead-end, especially with string processing. Parse a large log file with a regex and compare Raku with Perl5. Raku has a long way to go.
- space_ghost 6y agoRaku also suffers from a lack of ecosystem. Perl5 and Node have huge advantages there.
- p6steve 6y ago'use Inline::XXX;' gives raku coders access to Perl5 (CPAN) and python modules
- lizmat 6y agoActually, it is even simpler than that. If you have the Inline::Perl5 module installed, then the only thing you need to do to load a Perl module, is to use the :from<Perl5> adverb in the -use- statement, e.g.: use DBI:from<Perl5>;
- raiph 6y agoI think Raku's Inline approach will one day eliminate that suffering and replace it with the even larger advantage that Raku's ecosystem will trend toward being the sum of other PL's existing ecosystems. Consider the Perl modules on CPAN. Raku's ability to just use many of these existing Perl modules, including ones that use XS, completely unmodified, running via standard perl binaries, and thus running exactly the same as they would be if run standalone instead of within the Inline harness; and using standard Raku syntax, as if Perl modules were native Raku modules; all of that, done well, is an extraordinary breakthrough. Stefan Seifert did remarkable and respected work for a decade on some of the most important Inlines that Perl folk use; imo his 5 years of work on the Raku evolution of that notion are far more remarkable in terms of the long term implications I see as I watch the maturing of the Perl Inline and look forward to the anticipated redo of the Inlines for other langs to catch up with the Perl Inline.
- amelius 6y agoMy first question whenever a new programming language comes up: does it solve the problem of "what color is your function"? [1] [1] https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function/ https://journal.stuffwithstuff.com/2015/02/01/what-color-is-...
- bmn__ 6y agoYes, unlike the languages mentioned in TFA, it just works. Specifically, you can `await` anywhere without the requirement of declaring the surrounding context as async which in practice means you eliminate the red/blue distinction.
- valenterry 6y agoThat must mean that it blocks and wait for the result. That doesn't "solve" the problem though.
- raiph 6y agoIt's a cooperative yield point so while the code containing the `await` blocks and waits, the underlying thread/core is released and "stolen" by the standard scheduler for other work, and then resumed when the processes it's waiting for complete or are cancelled. What problem is there beyond that?
- valenterry 6y agoI doubt that this is the case. Before I answer, let me ask you back: Why don't all languages just do it like that? Sounds pretty easy, no?
- bmn__ 6y agoIt is not okay to continue to sow doubt. I require you taking eight minutes to download the language and validating/disproving the claims.
- 7thaccount 6y agoRaku is a seriously cool programming language, but it is still not at the level to where I'll put in learning effort past all the tutorials I've read in the past. When it reaches maturity, I could see myself using it in some hobby projects. It seems like it has a good bit of the power you see in languages like Smalltalk, but in a more accessible package.
- donaldihunter 6y agoI haven’t used Raku for anything big, but I do use it for a lot of small projects. I find the expressiveness great and I can get things done with minimum fuss. It’s especially good for command-line tools where a MAIN function gives a CLI with parameters and autogenerated usage.
- youdontlisten 6y agoLook, Larry, give it up, OK? Nobody is going to use Perl 6. There are a million other languages out there these days. What does your language do that is in any way special or unique? Nothing. Needless to say, the name Perl has little cachet or relevance today, thus explaining the name change. Lipstick on a pig. At this point, if a supposed 'alternative' can't replace the C language, I want nothing to do with it. We need to get back to the hardware. No, Go doesn't cut it, and (laugh track deafening) I'm not interested in Rust, either. I think the very idea of a VM language, while a cool and fun toy back in the early 2000s, is losing its relevance, at least for the moment. Source code portability is much better than binary portability.
- aeturnum 6y agoThis language looks cool! I also really like the page-by-page format for the tutorial, which strikes exactly the right balance (for me) between giving too little and too much info. As a side note, I noticed that the "Notes on using Unicode" page[1] referred to the quotation marks used in kanji-based languages[2] as "fancy." I think this kind of exotification of non-western cultures (where mundane things become exciting or "fancy" because it's not from your culture) can be a kind of cultural "code smell" that warns off non-western developers. Even if it comes from a humorous or enthusiastic place, an outsider just sees someone getting weirdly excited about a normal thing. [1] https://course.raku.org/essentials/on-unicode/ https://course.raku.org/essentials/on-unicode/ [2] https://en.wiktionary.org/wiki/%E3%80%8C_%E3%80%8D https://en.wiktionary.org/wiki/%E3%80%8C_%E3%80%8D
- donaldihunter 6y agoThat is useful feedback. As far as I know, Raku docs have changed in the past to remove cultural in-jokes or smells.
- ashport 6y agoThanks. I've updated that.
- aeturnum 6y agoNice! As a side note, I think it's very cool that Raku supports multiple quote characters. It's unusual to see that in source code and, while I code mostly in English, I imagine it would be nice for people writing in other languages.
- huhtenberg 6y agoIs there a one-page version of this? Or at least with support for ← and → keys for page navigation. It's basically impossible to skim this course or to jump around it quickly. Edit - here's a GreaseMonkey script for the arrow navigation between the pages. Right arrow - next page, Left arrow - previous page. https://pastebin.com/uQMWyfq0 https://pastebin.com/uQMWyfq0
- andredz 6y agoThank you very much; works great.
- ReallyOldLurker 6y agoThere is an AppImage that you can try out if you don't want to do a full compiler, etc. download and install. https://github.com/timo/rakudo-appimage https://github.com/timo/rakudo-appimage
- VeronicaX11 6y agoI literally clicked on this thinking "Neat! Let's try something new" until I remembered it's just perl rebranded... unless i'm missing something?
- lizmat 6y agoIf you insist on comparing it to Perl, you could consider it "Perl Re-Imagined". Just like "The Lord Of The Rings" is a re-imagination of "The Hobbit".
- webmaven 6y ago> If you insist on comparing it to Perl, you could consider it "Perl Re-Imagined". Just like "The Lord Of The Rings" is a re-imagination of "The Hobbit". The Lord of the Rings is a sequel to The Hobbit, rather than a re-imagining. Of course there was a bit of re-imagining necessarily involved, much like the relationship between Star Trek: The Original Series and it's sequel The Next Generation.
- lizmat 6y agoAs a Tolkien aficionado, Larry Wall I think knew what he was saying when he made this comparison. I think that if you compare https://en.wikipedia.org/wiki/The_Hobbit#Plot https://en.wikipedia.org/wiki/The_Hobbit#Plot with https://en.wikipedia.org/wiki/The_Lord_of_the_Rings#Plot https://en.wikipedia.org/wiki/The_Lord_of_the_Rings#Plot, you'll get an appreciation as to what Larry Wall meant.
- webmaven 6y agoAre you attributing the comparison in your comment to Larry Wall?
- VeronicaX11 6y agoI do have to say i'm rather impressed after your comment inspired me to look at the docs for the first time.
- unixhero 6y agoLearn Rakudo Perl6 in one video: https://www.youtube.com/watch?v=l0zPwhgWTgM https://www.youtube.com/watch?v=l0zPwhgWTgM This guy is so amazing. Mad props to him.
- metreo 6y agoOverall this seems like a fitting outcome for both projects, it certainly gives what it now Perl7 a sense of momentum and freshness as far as discussions around some of the direction being taken by Raku (nee Perl6). Huge thanks to everyone involved.
- mikewarot 6y agoWhen I saw that f 5, 6; is interpreted as equivalent to f(5, 6); something inside me just snapped.. if you don't have parenthesis, you don't have clear delineation of parameters vs functions, especially when things get nested, or need to be read years later.
- raiph 6y agoThen just write it as `f(5, 6);`. That works too. Tail nesting doesn't need parens, but otherwise you're right, use parens to nest. As for reading code, rest assured that "buy food" rather than "buy(food)" is something the vast majority of English readers find easy to read, even years later. That said, if such things make you snap, perhaps it's time to relax and ignore posts about programming languages you don't know. :)