🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
tbrowder i found this while implementing a frac function for a PR 00:01
i'm filing a rakudo issue unless someone can say it's ok 00:02
lucs That looks absolutely wrong :) 00:04
Unless it's parsed as -(1.5e0.abs) ? 00:06
tbrowder issue #4242 has been filed 00:28
raydiak that's my guess, postfix method call is probably tighter precedence, so you can say e.g. "-obj.attr" or so 00:29
tbrowder that may be. i haven't so far found where that's handled in the rakudo code. your thought sounds good 00:30
raydiak I'd personally hope the whole thing with the negative would be parsed as a single term, though. hopefully someone more knowledgable will chime in
tbrowder i am really surprised that the Int worked 00:31
raydiak m: say -(1.5e0.Int) 00:32
camelia -1
raydiak m: say (-1.5e0).Int
camelia -1
tbrowder m: say (-1.5e0).abs 00:39
camelia 1.5
tbrowder the way i found the error was copying some tests from the "sign" function which used the same syntax but with the ".sign" method and that did work 00:41
raydiak m: say -1.5e0.sign
camelia -1
moon-child wonders if we need a low-precedence versio of ., a la and/&& and or/||
that's -(1.5e0.sign)
completely consistent 00:42
raydiak okay now that is a bit unsettling...
oh, right
I guess the only real problem is that the - should probably be part of the numeric term, not an operator, at least you'd think... 00:43
moon-child apl uses ¯ for negative literals and - as a negation function 00:44
raydiak I'm hoping someone is just going to pop up and declare it to be a parsing bug. I could be remembering wrong, but I thought we even had a test for this in roast forever ago... 00:49
tbrowder there are LOTS of tests and i haven't yet tried to find any specific tests for the situation. it needs someone more aware of the numerics 00:51
moon-child dump.t has a number of tests with things like (-128).raku (rather than -128.raku) 00:53
raydiak m: say 1/2.Int # Rats have the same problem 00:57
camelia 0.5
raydiak pretty sure negatives and rationals were supposed to be terms, last I knew
moon-child that creates problems, though. 5-6 is two terms juxtaposed, whereas 5 - 6 is a subtraction 00:58
(though there is the same problem with kebab-cased identifiers) 00:59
raydiak ttiar is not valid raku unless i'm mistaken, so only one is a valid parse. backtracking is how the grammar works, no? 01:00
moon-child ttiar? 01:01
grammar uses backtracking yeah
raydiak two terms in a row 01:03
design.raku.org/S99.html#TTIAR 01:04
moon-child ahh. yes; it's just surprising behaviour imo
raydiak the current behavior surprises me more, but perhaps that means more about me than raku :) 01:13
raydiak m: say -42 .abs 01:43
camelia 42
raydiak I found this discussed in logs from 2015. the current behavior is known and intended. 01:44
moon-child that is ...
there's also this fwiw 01:45
m: say .abs given 42
camelia 42
moon-child m: say .abs given -42
camelia 42
raydiak m: say <-42>.abs 01:46
camelia 42
tbrowder ok, thnx, i'll regroup, close the issue, and press on. thanks all for helping me. bye 01:51
raydiak yw, good luck 01:52
codesections out of curiosity, raydiak, do you have a link to the 2015 discussion? I'm curious about the logic 01:56
raydiak codesections: just from my own logs: gist.github.com/raydiak/47f754ca4b...bd79d60d56 02:15
codesections raydiak++ ty 02:19
raydiak of course, you're welcome
I don't see anything particularly conclusive there that makes me feel swayed other than the overloading issue. mostly just shows that it was known and discussed by core devs years ago. didn't see anything else pertinent further down, the conversation just moves on to other things 02:21
rir_ lizmat, The Exceptional Road was the next I intended to explore. I'll keep Noise and Discipline in mind as I go. 02:23
codesections yeah, agreed re: nothing all that definitive. I like moon-child's idea of steal borrowing APL's ¯ syntax for negative numbers, though 02:38
raydiak easy enough to do from your own code if you want, I guess is the conclusion of that conversation 02:57
lizmat clickbaits and another Rakudo Weekly News hits the Net: rakudoweekly.blog/2021/03/08/2021-...ated-star/ 09:36
jmerelo lizmat++ 09:46
jmerelo You probably know it already, but we weren't funded for this round of Google Summer of Code 09:46
lizmat no I didn't :-( 09:47
meh
perhaps next year as The Raku Foundation :-)
Geth Raku-Steering-Council/main: 7f08895a14 | (Elizabeth Mattijsen)++ | minutes/20210306.md
The minutes of RSC meeting on 6 March 2021
11:09
Raku-Steering-Council/main: 89b6b476c1 | (Elizabeth Mattijsen)++ | minutes/20210306.md
Better markdown for minutes
11:11
jmerelo lizmat++ 11:13
lizmat hmm... I just realized I forgot to mention who attended
PimDaniel \o 11:15
Hi
tyil o/
Geth Raku-Steering-Council/main: f4c246d80b | (Elizabeth Mattijsen)++ | minutes/20210306.md
Mention who was in attendance

I guess Stefan *did* make it to the meeting, although it was towards the end of the meeting :-)
11:16
PimDaniel When we write ' my @a = @b" @b is not cloned into @a? I suppose @a acts like a pointer, no? Or i must write @a := @b? 11:17
tyil PimDaniel: what is the output you're seeing, and what is the output you're expecting? 11:18
PimDaniel tyil : This is just general question. I do no speek of output for now. 11:19
tyil ah
PimDaniel I just want to understand.
tyil m: my @b = < a b c >; my @a = @b; @b[0] = 'd'; say @a; say @b; 11:20
camelia [a b c]
[d b c]
tyil after assigning @b to @a, and then altering @b, the changes don't show up in @a
m: my @b = < a b c >; my @a := @b; @b[0] = 'd'; say @a; say @b;
camelia [d b c]
[d b c]
PimDaniel Yes tyil, i know this. 11:21
So the response is := for attrib if i want @a is address of @b. 11:22
But now, my question is what happens if your object is copied from a sub or method? 11:23
PimDaniel method mysub { my @b = <a b c d e f g h>; @!a = @b; } @!a is a class parameter!! will @!a still exist after leaving the method? 11:25
tyil if your class contains a `has @.a`, yes 11:26
PimDaniel @.a or @!a, no ?
tyil both should work, yes 11:28
PimDaniel I suppose the Perl5 principe remains that until a reference is attached to an object the object not destroyed.
Which is not the case in C langage with pointers. 11:29
tyil I'm not sure about that, maybe a core dev will read this and come with an answer to that
lizmat @!a indicates the actual attribute
@.a indicates the *accessor* to the attribute 11:30
if there is one
if you have specified an attribute like @!a, there is no accessor
PimDaniel Ok thank's tyil, so i must change some of my assignements.
lizmat m: class A { has $!foo }; dd A.new.foo
camelia No such method 'foo' for invocant of type 'A'
in block <unit> at <tmp> line 1
lizmat m: class A { has $.foo }; dd A.new.foo 11:31
camelia Any
PimDaniel yes lizmat : this is clear for me.
lizmat also: as long as an object exists, its attributes will exists as well 11:32
PimDaniel but @.a is the accessor AND the attribute of course. This is a powerfull trick to avoid to write accessors.
lizmat PimDaniel: it even goes further. $.foo is just short for self.fee 11:36
PimDaniel: it even goes further. $.foo is just short for self.foo
lizmat m: class A { method bar { "bar" }; method foo { $.bar } }; ; say A.foo 11:37
camelia bar
lizmat m: class A { method bar { "bar" }; method foo { self.bar } }; ; say A.foo
camelia bar
PimDaniel lizmat i'v read that $.foo create the methods accessors: foo{ return $!foo } and getter foo($x) {$foo = $x}. 11:39
lizmat you mean setter ? 11:40
the latter is incorrect
PimDaniel setter
yes
yes i know
and getter foo($x) {$!foo = $x} 11:41
lizmat if you say: has $.foo, it basically creates a method foo() { $!foo }
this decontainerizes the $!attribute, so it is a right value
if you say: has $.foo is rw, then it basically creates: method foo() { return-rw $!foo } 11:42
PimDaniel Hum OK i see!
lizmat so then it returns the container, and in Perl speak: you have an l-value sub
PimDaniel Ok i see this is more subtil that i thought. 11:44
lucs kj
PimDaniel but it is very intelligent.
May be those who wrote that were not supids.
:)))))
lizmat :-) it took a while, though :-) 11:45
PimDaniel Yes!
tyil you can't rush art
tadzik unless it's speedpainting 11:46
PimDaniel I'm confident Raku will win!
It's better than many langages for many things. I like python because it is simple but i prefer Raku because it is powerfull and has many possibilities. 11:47
tyil better is relative 11:48
if speed is your goal, you're gonna have a hard time competing with C ;D
PimDaniel tyil i've yet watch this. 11:49
lizmat tyil: that's only processing speed :-)
tyil lizmat: true
PimDaniel remenber The begining of PHP. :))))). Memory heap etc... 11:50
tyil (I don't use Raku for it's runtime performance anyway, but the performance boost it gives to the developer, which would be me)
if it takes me mere seconds to write (or reason) about my code, compared to minutes (or hours) in another lang, I see that as a big win :D 11:51
PimDaniel Yes of course : performance is not all.
lizmat I dropped PHP at 1.9b5 or something like that, after I spent 3 days trying to figure out why it didn't work, and it turned out to be a syntax error that it didn't catch
tyil I have php 7.3 and 7.4 installed this very moment 11:52
lizmat I did keep using PHP in production until mod_perl came around, but that PHP was generated by a Perl script :-)
PimDaniel In fact i hate PHP.
I really prefer Python but PHP is one of the fastest. 11:53
because you speak of speed.
tyil if you're doing web applications, php is one of the faster choices, indeed
PimDaniel I used PHP recently to write a small program: horror!
tyil (and I personally prefer php > python as well) 11:54
if only because the community is more helpful in my experience
PimDaniel i use PHP CLI.
tyil and python can't even make it's main promise of "one way to do a thing" true in its own stdlib
there's a handful of methods to format a string now, and in my not so humble opinion, they all suck :p 11:55
PimDaniel I like python because things are simple.
tyil I wish I could agree 11:56
PimDaniel back later. 12:00
El_Che isn't web applications a JS thing nowadays? 12:06
tyil El_Che: nothing is a JS thing if it were up to me 12:10
codesections sadly, it doesn't appear to be up to you, judging by, e.g., the number of electron apps/js-heavy websites out there these days 12:53
tyil very sadly indeed 12:54
leont Electron apps are a terrible idea from the user's perspective, but great from a corporate one 13:26
SmokeMachine vrurg: Hi! just to let you know that I've answered your issue on Red (github.com/FCO/Red/issues/472). I hope that's what you needed. I'd really like to have more people testing `has-one`. I don't think that should be experimental, but only with more people trying that I'll be able to make it a normal feature.
tbrowder .ask jmerelo jj, tweak has disappeared from the docs again 13:38
tellable6 tbrowder, I'll pass your message to jmerelo
kawaii good afternoon o/ 14:11
lizmat kawaii o/ 14:12
El_Che tyil: I was working on a small react js app as a client for a rest service (for people that don't know how to use curl) without knowing much JS or react. It was OK, no scars so far 15:13
tyil I generally oppose js requirements on websites, seeing as js is the de-facto way to get malware over the web 15:14
not allowing js in your browser is by far the best thing you can do to boost your online security
El_Che not allowing JS is the best way not to be able to use sites nowadays 15:19
tyil most websites aren't ones that I want to use anyway 15:20
El_Che a future of wasm wakes you up at night, right? :)
tyil but opening up a massive security hole just to propogate terrible development practices sounds like a bad idea anyway
not sure what value that wasm comment has
El_Che wasm would make web dev more obvious because you can do it in your lang of choice instead of js 15:21
tyil I am aware
but your snarky comment isn't helping you convince anyone of your viewpoint 15:22
El_Che you missed or don't appreciate sarcasm, but it's OK 15:23
(what you certainly missed is that I am not trying to convince anyone)
tyil brushing off a failed attempt of a witty comment as sarcasm is cute, but not worth anything 15:24
SmokeMachine El_Che: if you don't know much of JS, maybe next time you could think of using something like this: github.com/FCO/MemoizedDOM/blob/ma...do/App.pm6 (I'm just kidding)
tyil I hope you have a good day getting upset at other people having differing viewpoints
I'll go check out a different buffer for now
SmokeMachine El_Che: I'm kidding, but that works!!! fco.github.io/MemoizedDOM/todo6.html 15:25
El_Che upset?
we're on a different frequence, I think, as I am not upset
El_Che SmokeMachine: is it a kind of wasm or a transpiler to JS? 15:29
it runs on github pages, so it generates JS?
SmokeMachine neither... it's Rakudo.js running on webperl (github.com/FCO/MemoizedDOM/tree/ma...o-webperl) 15:30
El_Che: try opening the source code... usercontent.irccloud-cdn.com/file/.../image.png 15:31
El_Che SmokeMachine: wow, nice 15:33
SmokeMachine :)
El_Che I didn't know you could do that 15:34
it's raku code in the html
SmokeMachine yes, it is :) 15:35
SmokeMachine that's why it takes so long loading... :) 15:35
I really think it would be cool to improve that 15:36
(probably not very useful, but very cool) 15:37
SmokeMachine El_Che: And I like the MemoizedDOM solution as well... I still need to do a html slang for that, as I've done for this: github.com/FCO/p6-react 15:41
El_Che SmokeMachine: is it a experiment and can you use it to build webpages? 15:46
SmokeMachine El_Che: that todo app uses this(webperl.zero-g.net/perl6.html) but it can also be transpiled. and both MemoizedDOM and p6-react I've done to see if that was possible... I still plan to improve them. but all the merit to running is from Rakudo.js and not mine 15:50
guifa2 vrurg: so after finally upgrading my dev machine to a post-COERCE one… I realized that Role() sadly doesn't work because the role has to punned and any stubbed methods cause it to bomb. Not sure if there's a way around that 23:00
tellable6 guifa2, I'll pass your message to vrurg