🦋 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.
tonyo excellent obfuscation 04:07
m: constant \s = -> \a { &infix:<*>(a,2) }; -> --> s { }()(2).say; 04:08
camelia 4
Nemokosch Functions hidden behind terms: yes, negative integers: no 08:21
vrurg will hold lessons about core development
I'm definitely willing to alter the grammar to eliminate this "consistency" that -1 is an expression rather than a literal 08:23
guifa you might have more buy in for working to ensure that the pointy-arrow return value excepts anything resolvable at compile time: that's a restriction in, e.g., interpolated module names in use statements 11:07
-1 is resolvable at compile time. 10 + $a (where $a is a compile-time constant) is similarly resolvable at a compile time 11:08
guifa is afk
Nemokosch you mean "accepts", no? 11:14
I don't think this is an either-or thing, by the way. -1 _is a value and not an expression_. This needs to be fixed before it causes further trouble, regardless compile-time resolution. 11:17
Geth doc: massa++ created pull request #4115:
Including :x adverb
11:50
lizmat Nemokosch: fwiw, with static optimization enabled, a -1 will be codegenned as a WVal of -1 11:51
tellable6 lizmat, I'll pass your message to Nemokosch
Nemokosch lizmat: yeah no, my biggest worry isn't the generated code, rather the conceptual and grammar implications of "-1 is not a value but an expression" 12:14
lizmat do you consider +1 to be an expression ? 12:16
Nemokosch I don't consider it to be the same as -1, for sure 12:17
perhaps I still wouldn't consider it an expression but mainly it's not the same 12:19
I'd say it's more valid to say "+1 is a numeric literal" than "-1 is not a numeric literal", it's less counterfactual regarding the expectations of whoever enters a number 12:29
tonyo if you're coming from haskell then you have no expectations of `-1` being a number..my presumption wouldn't be others' expectations 13:31
stackoverflow.com/a/61272957 13:35
dutchie consider APL/J where there is a separate minus sign to form a negative number literal (¯1 or _1) 13:35
possibly not relevant as a choice forced by other aspects of array language syntax, but interesting nonetheless 13:37
tonyo APL has a lot of interesting decisions/design 13:45
Nemokosch perhaps _that_ shouldn't be the base of assumptions 14:58
Raku is advertised as a language that "just works the way you expect" and the mainstream interpretation seems to be: the way a lay person reads text 15:00
if you are coming from 4th grade math, your expectation is that `-1` is a number, and `-1` will work everywhere where a numeric literal is needed - unless the domain explicitly excludes this value 15:02
by the way, for Haskell: it eats -1 just fine, as a number, and doesn't eat +1 at all 15:04
tonyo fourth graders don't write a lot of code 15:05
and no, haskell doesn't. `let a = 5 - -1` is an error
Nemokosch yes, it does, I just tried it 15:06
and anyway, it's written down in the SO answer you linked
everybody was a 4th grader once; not everybody did Haskell/APL
and this is an advertised aspect of Raku design
Geth doc: 760bbc3538 | (Humberto Massa)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Including :x adverb (#4115)
15:12
linkable6 Link: docs.raku.org/language/regexes
Nemokosch These discussions aren't chat compatible really, this format is a fuel of way too quick responses. I will do what I can, be it implementation or describing a rationale 15:25
Humberto Massa is a prolific Weekly Challenger 💯 15:27
[Coke] also sets up a basic win10 box in azure so he can do the win install instructions on a pristine box. 16:00
tonyo the original backend of rakudo was written in haskell 16:31
gist.github.com/tonyo-tatari/3c2c0...74cb896905
take a nice look at the ghci not allowing the `let` statement above 16:32
tonyo well, one of the backends, anyway 16:45
Nemokosch anyway, -1 is a number according to the REPL of haskell.org itself, and I still fail to see why this would be any relevant for Raku
tonyo i didn't say it was relevant to raku. it's relevant to making assumptions about peoples expectations, though 16:47
Nemokosch well, very slightly 16:50
docs.raku.org/language/syntax#Literals the docs do mention (2 times out of 3) the current parsing
tonyo why would your expectations differ from the docs? 16:51
Nemokosch no I mean, documenting the behavior is better than not documenting it 17:00
but doesn't make the behavior itself better
so far, I'm yet to hear a benefit of this approach, something tangible
and I already see a disadvantage: arrow returns don't work for negative numbers which is hardly justifiable towards an outsider 17:01
this is how it all started. I wanted to fix arrow returns and realized that the whole grammar is built upon the assumption that negative numbers cannot be values 17:02
Guest49 Hi who create this disgusting website? 17:03
docs.raku.org/language/5to6-nutshell 17:04
Nemokosch mehh, you haven't tried to learn Typescript from docs 😄 17:05
oh right, one more thing. Probably it's possible to fix return arrows to accept any "constexpr" - but the mental acrobatics probably won't stop here, if one always have to pay attention to allow "negative literals" anywhere where literals are okay. 17:08
The only convincing way I can imagine is some mechanism that ensures at parsing that "constexpr"s are turned into their values 17:09
And even then, I would still think it's worth knowing if there was some tangible benefit on the side of minus-one-as-negated-one 17:11
lizmat Guest49: anything else you'd like to say? 17:49
Geth mu: 955caf36c4 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | docs/Perl6/Cheatsheet/cheatsheet.txt
Version 9 of the cheatsheet

Replace the clearly wrong @*INC by $*REPO
18:40
[Coke] github.com/lizmat/App-Rak/issues/1...1270549515 - anyone remember the fix for this 'zef install' error? 19:05
lizmat [Coke]: no idea, but I bet it's the same thing that is breaking CI on WIndows :-( 19:10
lizmat the path feels wrong though: a .tar.gz extension as a directory, and then a mix of separators ? 19:12
[Coke] running in git bash on windows. 19:16
tbrowder i’m trying to create another child class of DateTime. i don’t yet see a reliable way to pass new() args to self.DateTime::new(|c). some combos work and others don’t. do i need to unpack the |c from the subclass or redefine the capture before passing it along? or do i need to go the whole multi signature route? or is it a lost cause? i had success with DateTime::Julian, thanks to lizmat, because only one specific signature was 20:35
passed to self new, otherwise the (|c) works fine.
lizmat tbrowder: could you post a gist of what you're trying ? 22:06
elcaro Need some guidance on licenses. If I'm creating bindings to a shared lib (eg. .so, .dll) does the licens of my module have to comply with the license the shared lib is under? 23:20
I notice Inline::Go is MIT, but Go itself is BSD3. Both Inline::Ruby and Inline::Python are Artistic2 (which is largely a Perl/Raku thing) 23:22
elcaro With a shared lib... I guess I'm not really including any source, so maybe there's no strict requirement? Halp 23:26
[Coke] Someone using your wrapper is bound by your license and the lib's license. 23:27
If you use the same license, you're making it easier on your users, presumably, so they only have to worry about one license.
elcaro I see 23:28
[Coke] I am not a lawyer, but I do often ask the legal team at $dayjob "can we use this OSS thing?"
elcaro Yeah, what you said makes sense. Thanks 23:29
[Coke] if you're doing a bundled distro (like, you're building a wrapper that CONTAINS the other thing and you're shipping both, that's a different set of issues. You may even be prohibited from doing that, depending on the original lib's license) 23:30
good luck! 23:31
elcaro Yeah, I'm not bundling... but yeah I think it makes sense to release the wrapper under the same license. They have to be ok with that license anyway to use the shared lib, so it only makes sense
tbrowder lizmat: i'll post a gist tomorrow--almost my bedtime :-) 23:41
[Coke] ugh. the small VM I created to do the windows build test is too small. 23:59