🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). Log available at irclogs.raku.org/raku/live.html . If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 6 September 2022.
dr.shuppet @librasteve I'm not sure if I would put Raku into the lineage of scripting languages like Perl, PHP, Ruby, Python, or Lua. Unlike all of these languages, Raku is heavily based on typing. This is not only to the extend of typical OOP features like operator overloading, but much more: in Raku, the type of the value can change how core features of the language itself operate on the value. For example, passing a 07:03
Junction type will lead to a subroutine being called multiple times: perl sub verbose-identity ($x) { say "Hi"; return $x; } verbose-identity(True | False); bash # Output Hi Hi AFAIK those are concepts unique to Raku, if I were to compare the way typing is used in the language quantitatively, it would roughly comapare to Haskell (but Haskell uses typing for something else).
It seems like the trend in programming languages is shifting the focus from syntax and other "outer" features to the type system, Raku is quite ahead in this aspect 07:10
vendethiel That sort of autothreading is similar to array programming, which appeared in fortran in ‘57 (afaik) 12:56
antononcube @vendethiel With a mix of HPF. 12:57
HPF : High Performance Fortran
vendethiel well, APL in ‘66 then :). 13:01
antononcube Sure, APL spawned lots "modern" ideas. 13:04
(I.e. forgotten old ones.) 13:05
[Coke] wrote a wrapper script for my sudoku helper app that includes "which sudoku || zef install App::SudokuHelper" and I'm not sure how I feel about it. 13:54
tellable6 2024-04-30T08:38:22Z #raku-dev <finanalyst> [Coke] please take another look at doc-website PR#363. Makes indexed=true default, and defaults are not written unless changed
dr.shuppet Yeah, it's similar to languages that work with vectors by default, more recently also R for example 14:17
I was referring more to the way it integrates into Raku
librasteve @dr.shuppet that makes sense - I understand that all the early raku implementers learned Haskell first and PUGS (the first raku parser) was written in Haskell 17:27
Guest6 gather/take has me baffled. I'm working on the Weekly Challenge (so SPOILERS); here's my code: gist.github.com/nd3i/b10f39060b706...7c8fb41576 See the two 'take's (lines 22 & 29)? I have to add '.clone' to get the expected result. If I remove the .clones, the gather produces the right number of results, but all the elements are the 17:28
same: the last values for the variables. I never ran into needing to clone the values before; I'm lost as to what's different here. Must be something obvious but I'm not seeing it.
librasteve I am sympathetic to folks that ask "what niche is raku in" and, I still think that the best answer is "it is in the same lineage as perl, but on steroids" where the steroids start with the type system (all the C++ OO power tools in a friendly form, the MOP), and include many, many cool things vector / autothreading capabilities (like junctions, maps, hypers), unicode / regex v2 / grammars, functional (afaik raku is 17:34
the only production language with lazy execution), concurrency, a very cool math system (Inf, Rat, Int, Complex), and its all well balanced and composable
my base case is that (i) errr it IS perl6 and written by that Larry guy, (ii) it is interpreted [yeah, I know that this is a bit grey - but the intent is to make the dev cycle and distribution feel like perl / python intepreters rather than C or Rust or, god forbid, Java], (iii) it is whipituppable with dynamic types (ie no types needed)for a quick short scripts), it carries the sigil heritage from bash / perl / 17:43
PHP, (iv) it is intended as a glue language as is not the best choice for high performance in the absence of modules that call into underlying C / C++ / Rust libraries via C FFI, (v) it is CLI native
also - I DO think that there is a perl diaspora that went out to PHP, Ruby and Python and that a (small) fraction of these folks are looking for something less constricted 17:44
not really sure about Lua - so maybe that shouldn't be on the list - I stuck it on in ignorance since I heard that it is a new-fangled scripting language so a comparable to raku in terms of when it was released and also having an ease of coding / whipitupability vibe 17:46
ugexe Guest6: I guess its taking a reference for $lw. for example taking "$lw" also work. i'm not sure why it would be doing that for a simple scalar though 17:52
Guest6 <ugexe> That was my guess that led me to try .clone. But as I said, I've not run into this with gather/take before (and I use it often), and the example in the docs docs.raku.org/language/control#gather/take -- sub factors --- looks similar and works fine for me. 17:57
gfldex m: &take.signature.say 17:58
camelia (|)
gfldex Very funny Rakudo. :-|
gfldex m: &take.candidates».signature».say; 17:59
camelia ()
(\value)
(|)
gfldex Guest6: I'm surprised as well, as &take boild down to `nqp::setpayload($ex,my \out := nqp::p6recont_ro(value));`. 18:01
antononcube @dr.shuppet "Yeah, it's similar to languages that work with vectors by default, more recently also R for example" -- I very tempted to call that feature of R "braindead." It does make sense to people who have studied statistics and see how it inspired R... 18:06
librasteve Guest6: could it be this docs.raku.org/language/traps#Conta..._a_capture ?? 18:19
Guest6 TTFN 18:35
dr.shuppet You can certainly see Raku as "Perl on steroids", it's just that IMO its core is very different from Perl 18:49
I mean the theoretical code 18:50
jdv larry m8ght disagree:) 18:59
*might
ab5tract dr.shuppet: I agree with you. It's kind of hard to express, though. The core spirit is very, very Perl-ish. 19:02
dr.shuppet ab5tract: Sprit yes, definitely
Raku allows you, thanks to its design, to do more natural-language-inspired stuff for example, like *.contains: all "a".."z" for pangram detection, recently covered on Exercism (sadly, no Raku segment this time) 19:05
ab5tract oh, that's pretty cool 19:07
I tend to ignore the existence of .contains but that proves that I probably shouldn't 19:08
librasteve perl is very natural_language inspired, Larry the linguist saw to it that nouns (variables), verbs (operators), etc all had a very natural feel ... 19:16
so I can get on board with raku = practical Haskell || unconstricted Python since these are not mutually exclusive 19:18
ab5tract Python would be one of the last comparisons I would make 19:25
I read dr.shuppet's example as "this affinity for natural language demonstrates Perl-ish spirit of Raku", but I could be wrong 19:28
*the 19:29
dr.shuppet ab5tract: That's exactly what I meant
librasteve oh - my bad
dr.shuppet Python of course is a bit of an antithesis to Perl, they even adopted "There's Only One Way To Do It" as a slogan 19:33
librasteve on Python, syntax-wise its chalk and cheese, true : newbie-wise it a shoehorn for raku (but can be done imo ... eg read Think Raku) : niche-wise raku is a subset of Python for sure, but where coding savvy folks feel limited by python, the ease and speed of scripting and the gluey nature are similar 19:34
yes - Python zen caught a lot of sigil-wary folks as perl Osbourned - and a whole generation or two have now started with Python - so I think that raku can aspire to catch a lot of whitespaced-out pythonistas (and we are no Rust or TypeScript or Elm) 19:36
must run -ttfn
ab5tract o/
dr.shuppet IMHO one reason why Raku is not so popular is that people don't imagine something like Raku being possible 19:43
But I expect that to change eventually 🙂 20:00
lizmat expects so as well :-) 20:09
antononcube "IMHO one reason why Raku is not so popular is that people don't imagine something like Raku being possible." -- Very interesting statement! 20:41
If it is true, then it is true for other powerful programming languages. 20:42
coleman raku docs site maintenance incoming 22:01
restarted 22:03