🦋 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.
Gus26 It's telling me I need 'use experimental :macros', but even when I add the use statement, it still complains about it. I assume it's a normal use statement, without the quotes, but I tried with and without quotes and it doesn't seem to recognize it. Any thoughts? 00:00
tonyo m: use experimental :macros; 00:01
camelia ( no output )
tonyo what version of raku Gus26
Gus26 I'm trying this
committable6: rakuast %*ENV<RAKUDO_RAKUAST> = 1; my $p = run 'raku', '-e', "use experimental :macros; macro m() { use experimental :macros; quasi { say 'a' } } m;", :out; my $o = $p.out.slurp: :close; say $o;
committable6 Gus26, ¦rakuast: «===SORRY!===␤X::Syntax::Confused at line 2, near "quasi { sa"␤␤»
Gus26 Oops I was trying to put inside the function 00:02
committable6: rakuast %*ENV<RAKUDO_RAKUAST> = 1; my $p = run 'raku', '-e', "use experimental :macros; macro m() { quasi { say 'a' } } m;", :out; my $o = $p.out.slurp: :close; say $o;
committable6 Gus26, gist.github.com/4cbcb7ea0109796ba9...3e5b351bd5
Gus26 Trying what I figure is the simplest possible program that demonstrates the AST functionality is really turned on 00:03
I suppose I could try and instantiate some AST nodes but I need to learn more about the API; I got the sample macro code from one of jnthn's talks 00:04
Also, without the macro, I'm not sure how you insert an AST back into your program 00:07
Ok so that problem was caused by shell quoting, didn't even consider that originally. Now I get the error that it's not recognizing quasi 00:19
committable6: rakuast %*ENV<RAKUDO_RAKUAST> = 1; my $p = run 'raku', '-e', 'use experimental :macros; macro m() { quasi { say "a" } } m();', :out; my $o = $p.out.slurp: :close; say $o;
committable6 Gus26, ¦rakuast: «===SORRY!===␤X::Syntax::Confused at line 2, near "{ quasi { "␤␤»
ugexe does there need to be a semicolon on the } before m() since its on a single line? 00:24
say "a" } }; m(); 00:25
Gus26 As I keep playing with it I feel like there's more shell escaping problems 00:26
ugexe committable6: rakuast %*ENV<RAKUDO_RAKUAST> = 1; my $p = run 'raku', '-e', 'use experimental :macros; macro m() { quasi { say "a" } }; m();', :out; my $o = $p.out.slurp: :close; say $o;
committable6 ugexe, ¦rakuast: «===SORRY!===␤X::Syntax::Confused at line 2, near "{ quasi { "␤␤»
ugexe guess thats not it
Gus26 Even simplifying further, it doesn't work but it's a strange error to me 00:27
committable6: rakuast %*ENV<RAKUDO_RAKUAST> = 1; my $p = run 'raku', '-e', 'macro m { }', :out; my $o = $p.out.slurp: :close; say $o;
committable6 Gus26, ¦rakuast: «===SORRY!===␤X::Syntax::Regex::NullRegex at line 2, near "}"␤␤»
00:27 berber44 left
Gus26 And in an empty quasi and it complains about some character problem 00:27
committable6: rakuast %*ENV<RAKUDO_RAKUAST> = 1; my $p = run 'raku', '-e', 'macro m { quasi { } }', :out; my $o = $p.out.slurp: :close; say $o;
committable6 Gus26, ¦rakuast: «===SORRY!===␤X::Syntax::Regex::UnrecognizedMetachar at line 2, near " quasi { }"␤␤»
Gus26 I have no idea what an UnrecognizedMetachar would be 00:28
I guess a character not allowed inside a macro?
Or is it some shell quoting issue with the curly brace? 00:29
ugexe committable6: rakuast %*ENV<RAKUDO_RAKUAST> = 1; say run('raku', '-e', q|macro m($x) { quasi { {{{$x}}} }; }; m(1);|, :merge).out.slurp(:close); 00:40
committable6 ugexe, ¦rakuast: «===SORRY!===␤Undeclared variable $x␤␤»
Gus26 I don't think it's recognizing the macro keyword
I tried putting back in the use experimental :macros to no effect 00:41
This suggests that there is really something there, but I'm not sure what to do with it: 00:44
committable6: rakuast %*ENV<RAKUDO_RAKUAST> = 1; my $p = run 'raku', '-e', Q^say RakuAST.WHAT^, :out; my $o = $p.out.slurp: :close; say $o;
committable6 Gus26, ¦rakuast: «(RakuAST)␤␤»
ugexe hmm right but i dont think rakuast implies macros 00:45
its just a precursor to better macro support
i also havent kept up with rakuast as much as i should so i might be woefully out of date in my thinking 00:51
Gus26 Hmm, maybe I should make sure the environment variable is actually getting through 00:52
And print the variable from the nested -e block
Also, how can you reference a constructor without calling it?
I'm trying to get the constructor signature
ugexe i suppose there could be many constructors 00:53
Gus26 But RakuAST::Statement.new.signature is trying to call signature on the created object, not the method itself
ugexe ah ignore me then heh
Gus26 I guess it's likely I'm looking for the BUILD method though right?
Isn't it standard practice to not really touch new and put logic in BUILD? 00:54
Probably should have considered this sooner, but the place to see how this works is in the tests 01:05
01:09 kvw_5_ joined
japhb Is anyone already working on a CBOR implementation (en.wikipedia.org/wiki/CBOR)? I think MUGS will need to switch to that (from JSON) in order to handle really big/rapid game updates, especially including blobs or arrays of native numbers, without spending too much bandwidth transmitting and time (de-)serializing. 01:09
I didn't see anything on modules.raku.org, but I know sometimes people have such things "simmering" in a local repo for quite a while before making them official.
01:12 kvw_5 left
Gus26 Ok, if you're manually building the AST, you don't need the ENV variable, so this works: 01:15
rakuast use MONKEY-SEE-NO-EVAL; my $s = RakuAST::Call::Name.new(name => RakuAST::Name.from-identifier('say'),args => RakuAST::ArgList.new(RakuAST::IntLiteral.new(5))); EVAL($s)
c: rakuast use MONKEY-SEE-NO-EVAL; my $s = RakuAST::Call::Name.new(name => RakuAST::Name.from-identifier('say'),args => RakuAST::ArgList.new(RakuAST::IntLiteral.new(5))); EVAL($s)
committable6 Gus26, ¦rakuast: «5␤»
01:25 brtastic joined, db48x left, db48x joined
Gus26 So the nested call to raku does see the ENV var, but somewhere along the line it's going crazy, and I'm at a loss why 01:26
Still feels like a quoting issue, but I don't see how
Even using the manual AST evaluation in the nested raku causes a weird error 01:28
committable6: rakuast %*ENV<RAKUDO_RAKUAST> = 1; my $p = run 'raku', '-e', Q[my $s = RakuAST::Call::Name.new(name => RakuAST::Name.from-identifier('say'),args => RakuAST::ArgList.new(RakuAST::IntLiteral.new(5))); EVAL($s)], :out; my $o = $p.out.slurp: :close; say $o;
committable6 Gus26, ¦rakuast: «===SORRY!===␤Unknown compilation input 'optimize'␤␤»
Gus26 Also, I guess when you use -e it no longer cares about EVAL
I think -e is doing weird things but I can't find any docs
It's actually looking for a package here: 01:30
committable6: rakuast %*ENV<RAKUDO_RAKUAST> = 1; my $p = run 'raku', '-e', Q[use MONKEY-SEE-NO-EVAL;], :out; my $o = $p.out.slurp: :close; say $o;
committable6 Gus26, gist.github.com/4f221254a9d34b640d...36b159f317
Gus26 Jeez we have been trying way too hard, it just works 01:37
committable6: rakuast use experimental :macros; macro z($str) { quasi { say {{{$str}}}; } }; z("foo");
committable6 Gus26, ¦rakuast: «foo␤»
01:51 frost-lab joined 02:16 lucasb left 02:25 defaultxr joined 02:33 Gus26 left 02:36 kini joined 02:38 mowcat left 02:41 defaultxr left 02:44 defaultxr joined 02:51 mahafyi left 03:31 stanrifkin joined
stanrifkin what means :D behind the types? Like Complex:D 03:32
raydiak defined 03:34
m: say Complex ~~ Complex:D; say Complex.new ~~ Complex:D 03:35
camelia False
stanrifkin look like a smiley to me :D 03:37
codesections m: say Complex ~~ Complex:U; say Complex.new ~~ Complex:U # for comparison
camelia True
tejr ragu :DDD
codesections And that's why it's called a 'type smiley' 03:38
(in the docs)
raydiak that's not unintentional. makes it happier to look at :) we sometimes even call them "type smileys" or something like that
03:47 stanrifkin_ joined 03:50 stanrifkin left, stanrifkin_ left 03:55 mahafyi joined 04:31 brtastic left 04:47 Sgeo__ joined 04:48 gordonfish left 04:49 abraxxa1 joined 04:50 abraxxa left, Sgeo_ left 05:18 jmerelo joined 05:36 ufobat_ joined 05:56 neshpion left 06:03 parabolize left 06:04 abraxxa1 left 06:07 abraxxa joined 06:18 rindolf joined 06:23 rindolf left 06:25 Sgeo__ left 06:39 rindolf joined 06:45 wamba joined 07:05 asymptotically joined 07:08 sena_kun joined 07:32 brtastic joined 07:37 dakkar joined 07:47 pecastro joined 07:48 aborazmeh joined 07:56 mahafyi left 08:00 mowcat joined 08:04 mowcat left 08:05 aborazmeh left 08:07 mowcat joined 08:08 mowcat left 08:47 wamba left 09:40 ZzZombo joined 10:01 solitario left 10:03 solitario joined 10:08 ZzZombo left 10:12 ZzZombo joined 10:24 ZzZombo left
patrickbkr[m] japhb: Are you aware of the existence of FlatBuffers? (alas no Raku lib available either) 10:40
10:41 wamba joined 10:44 mahafyi joined 11:28 Xliff joined
Xliff \o 11:28
Can someone tell me why the constant-def regex isn't working? 11:29
If you would like editing access to fiddle with it, please request. Would prefer you clone, though! :)
12:11 mahafyi left 12:30 abraxxa left 12:33 abraxxa joined 12:52 natrys joined 13:08 jmerelo left 13:10 jhill joined
ugexe not to be pedantic, but doesnt the :D stand for DEFINITE (like the method)? 13:45
not defined
it seems like something i used to know but i certainly don't remember the difference at the moment heh 13:46
(the difference between DEFINITE and defined)
13:46 wamba left 13:49 |oLa| joined
codesections huh, looks like you're right. TIL. 13:50
m: sub f { fail }; say f().defined; say f().DEFINITE; f() ~~ Failure; f() ~~ Failure:D
camelia False
codesections m: sub f { fail }; say f().defined; say f().DEFINITE; say f() ~~ Failure; say f() ~~ Failure:D
camelia False
13:54 |oLa| left
codesections And I guess the difference is that .DEFINITE is a pseudo-method that can't be meaningfully overwritten, whereas .defined is a regular method inherited from Mu. docs.raku.org/language/mop#index-e...E-DEFINITE 14:00
14:02 frost-lab left
vrurg And 'defined' actually winds down to the same nqp::p6definite, as DEFINITE 14:03
codesections (except when overwritten, as with Failure)
14:04 wamba joined
ugexe and :U stands for... indefinite 14:08
14:14 test joined 14:15 test is now known as Guest43428, Kaiepi left, Kaiepi joined 14:16 Guest43428 left 14:18 b2gills left, b2gills joined 14:29 gordonfish joined 14:33 ufobat__ joined 14:35 Sgeo joined 14:37 ufobat_ left 14:38 Kaiepi left, Kaiepi joined 14:43 Kaiepi left, xinming joined 14:44 Kaiepi joined 14:46 Sgeo left, Sgeo joined
xinming releasable6: 14:49
releasable6 xinming, I cannot recognize this command. See wiki for some examples: github.com/Raku/whateverable/wiki/Releasable
tellable6 2021-04-03T14:32:37Z #raku <SmokeMachine> xinming_ no, that’s just a way to add “” around the table name… sorry, that problem wasn’t fixed yet… :(
xinming releasable6: status
releasable6 xinming, Next release will happen when it's ready. 3 blockers. 8 out of 183 commits logged (⚠ 1 warnings)
xinming, Details: gist.github.com/c70085c045df0b777a...10d673ad3f
14:57 parabolize joined 15:16 brtastic left
MasterDuke anybody here on windows ever see this when running rakudo's tests? dev.azure.com/MoarVM/MoarVM/_build...amp;l=1900 15:24
15:37 abraxxa left 15:38 abraxxa joined 15:39 softmoth_ joined 15:44 guifa2 joined
guifa2 codesections: re your question on SE (I've left the site so can't respond there), even in blocks, you can adjust values in a closure 15:45
m: my $foo = 0; my &bar = { $foo + 1 }; say bar; $foo++; say bar;
camelia 1
japhb patrickbkr[m]: I hadn't looked at FlatBuffers (thanks for the pointer) because it wasn't listed in en.wikipedia.org/wiki/Comparison_o...on_formats as being a JSON superset. I wanted something that could do everything that JSON could do (only better in terms of performance and space efficiency) and which could be a valuable core addition to Cro as a default-supported format. 15:46
codesections yeah, that's what I realized/mentioned in the comment. I was surprised by that, but I think I was misunderstanding how lexical scope works 15:47
(in Raku, but also just in general)
japhb FlatBuffers has the downside of needing a schema to parse, IIUC. I also wanted to make sure that the serialization and parsing where schemaless.
MasterDuke protobuf?
codesections (the same effect occurs in js, for example)
El_Che did someone mention protocol buffers? 15:48
(oh MasterDuke just did)
japhb MasterDuke: Also needs a schema to parse. And has one of the most baroque systems for parsing I know of. (I know, I implemented the wire format in Raku back before it was called that.)
MasterDuke ah 15:49
japhb Some other advantages of CBOR is that it is getting picked up in a bunch of IETF specs, has standard bindings for zero-copy (on parse) browser-side typed arrays, and is designed not only to be relatively space efficient, but to be parser-efficient as well, since part of the target audience is constrained/IoT devices. 15:55
All of which are other reasons it looks like a decent fit for adding support to Cro as well. :-) 15:56
japhb wonders if our UDP support is decent enough to support CoAP too .... 15:57
tonyo flatbuffers looks to have flexbuffers 16:02
guifa2 codesections: it's more of at the end of the scope, if the variable doesn't "belong" to anyone else, it'll get frozen. 16:04
m: sub foo ($a is rw) { return { $a + 1 } }; my $x = 0; my &bar = foo $x; say bar; $x++; say bar;
camelia 1
raydiak japhb: fwiw, I was looking at p5's CBOR::PP and it seems extremely short and clean and easy to port to Raku 16:13
japhb tonyo: Hmmm, flexbuffers are at least not schema'd, though it was only by you mentioning it that I even found it -- seems like flexbuffers uses the flatbuffer wire format, but is otherwise not their primary target? 16:16
raydiak: Oooh, good data point.
16:18 dataangel left, dataange` joined
raydiak however I have no idea of the legalities of creating a derivitive work of a GPLv2 project and relicensing it as artistic 2, or if you'd have to do it as its own separate GPL'd module (or get special permission/relicensed copy from the original author) 16:19
Xliff Can someone help me with regex issues, here: replit.com/@Xliff/MobileBeneficial...#main.raku 16:20
japhb raydiak: CBOR::PP and CBOR::Free appear to be Perl-licensed. CBOR::XS is I think the only GPL-only one? 16:23
raydiak japhb: oh I missed that, just saw the bulk of the license file and missed the first few lines, and saw github said gplv2. looks like its actually dual licensed if I carefully read the top of the license file 16:26
Xliff: apparently I am not human enough to pass the captcha on that site after a few attempts :D 16:27
those things are getting tricky...here in the US you usually wouldn't call a motorhome a "truck", even though I think the dept. of transportation classifies it as one. same with vans/minivans etc 16:28
Xliff raydiak: You have to be kidding me! :( 16:32
radiak: Have an email?
I'll try to invite you and see if that's a workaround
raydiak Xliff: no joke, I failed at "airplane" too, unless the site is just having problems
[email@hidden.address] should work 16:33
Xliff Invited
16:34 dakkar left
raydiak don't see it yet, I'll check again in a few minutes. I just sent a test message, it does still work 16:38
16:42 mahafyi joined
raydiak got it, looking... 16:44
Xliff Thanks. 16:46
raydiak can you put that together into an actual test that shows how you're initiating the match/parse against the header file and shows the output? 16:48
Xliff ?
raydiak you just define some lexical tokens/rules, but you don't actually use them to parse the file 16:49
Xliff Oh... I didn't finish it off...
Should now be corrected. 16:50
16:53 aluaces left
raydiak looks like you're getting there. in general, I'd suggest wrapping it all in a grammar and using grammar::tracer, if that's something you can do in this environment 16:53
Xliff Well, if you comment out the $<value> rule, I can pick up names,. 16:54
However that's useless.
It looks like <string> isn't working, and I'd like some help figuring out why 16:55
Throwing it all in a grammar and using that is just another way to get a whole lot of nothing. 16:57
Grammar::Tracer would require the whole output to match\ 16:58
It's why I did this with a regex.
radiakAck! You had it. You needed to remove the my's 17:02
raydiak my bad, assumed this thing would have version control 17:03
Xliff LoL! No 17:05
raydiak I suggest doing that, but against a much shorter test file
Xliff Yes, but the utulity of Grammar::Tracer when used for what really is a line-by-line algorithm is...less than awesome. 17:06
So. As you can see... as soon as I add support for value extaction, things stiop working. 17:09
... or not 17:10
Huh... why does removal of $$ allow the <value> to process?!
Also. Only picks up the decimal, not the hexi... 17:11
!?? 17:12
Now Grammar::Tracer has dissappeared!
raydiak uh...I'll reinstall it 17:13
Xliff Didn't even know Grammar::Tracer was installed by default on repl.it@
raydiak it's not, I installed it in the shell
it does have zef 17:14
Xliff Ah! Nice trick! radiak++
raydiak this tool is fun, I'm a bit sad that I'm about to have to leave. but it also feels a bit immature. definitely should have an edit history, and not randomly lose things in the filesystem 17:15
17:16 aluaces joined
Xliff Yes. 17:17
Leave? Leave where?
raydiak I have a legal appointment downtown 17:18
Xliff Oh, but you'll be back! 17:20
Then the fun can resume!
Good luck with your appointment.
raydiak Xliff: thanks :) it'll be a few hours, but absolutely I'd be happy to do this some more if you're still around and haven't worked it out by the time I'm back 17:21
my regex/grammar memory is rusty anyway, nice to be brushing up on it
Xliff Sure thing! 17:29
tonyo that thing wouldn't load for me 17:39
17:39 neshpion joined
tonyo wouldn't mind taking a look at the regex, just finished the toml 1.0.0 thing so still have some regex freshness in mind 17:40
17:41 aborazmeh joined 17:52 aborazmeh left 17:59 sena_kun left 18:00 sena_kun joined
lizmat clickbaits rakudoweekly.blog/2021/04/19/2021-...atch-anew/ 18:00
raydiak tonyo: I had to sign up to bypass the captcha, which is the part that wasn't working for me 18:01
lizmat++ thank you for all of your continuing hard work, weekly and otherwise 18:04
tonyo 7oh, i don't even get a captcha 18:10
it appears to load but no code shows
raydiak I saw that too, but only between captchas. either way, signing up may make a difference if you're interested. it doesn't seem very mature, but being a multiuser code editor, kinda fun to use anyway with another person 18:14
tonyo ah, that enabled more of the ui 18:15
no joy tho
raydiak hm. yeah, seems immature. maybe try another browser? I'm on chromium 18:16
18:28 sftp left, sftp joined 18:29 CIAvash joined 18:33 juanfra__ joined 18:42 wamba left
Kaiepi codesections, i was redirected to you about some legal concerns about my code i had in #raku-dev 18:53
<Kaiepi> i use modified snippets of openbsd source code in a few spots. i know there are comments i need to worry about in doing so, but is this permissible, and if so, is there anything else i need to worry about?
18:53 abraxxa left 18:55 neshpion left, abraxxa joined
El_Che keep the license text? 18:56
18:57 neshpion joined
Kaiepi that's what i'm doing at the moment 18:58
19:06 Black_Ribbon joined 19:07 mahafyi left
Xliff tony-o: Maybe an invite might help. Email? 19:11
19:13 MasterDuke left 19:16 wamba joined 19:27 softmoth_ left
tonyo sent via msg 19:29
19:38 wamba left 19:50 lucasb joined 19:58 asymptotically left
Geth doc: 70d30afc75 | (Stoned Elipot)++ | doc/Type/Range.pod6
Use code formatting for an operator
linkable6 Link: docs.raku.org/type/Range
20:08 neshpion left 20:09 neshpion joined 20:13 wamba joined 20:15 MasterDuke joined 20:23 aborazmeh joined 20:31 MasterDuke left 20:32 MasterDuke joined 20:52 kybr joined 20:59 abraxxa left 21:01 abraxxa joined 21:03 brtastic joined 21:05 Ven_de_Thiel joined
kybr is it possible to invoke a constructor using just the () after a class name? Foo() instead of Foo.new ? i tried somrthing likke this: class Finger { sub CALL-ME() { "got here".say } } 21:13
ugexe method CALL-ME 21:14
Ven_de_Thiel `Finger()` looks like a conversion missing the object to be converted
kybr does not seem to work either. I get (Finger(Any))
21:16 ufobat__ left
kybr camelia: class Finger { method CALL-ME() { Finger.new } ; method fun() { "got here".say } } ; Finger().fun 21:16
Garland_g[m] Finger.() seems to work. 21:21
ugexe yeah it doesn't work with 0 arguments for some reason
m: class Bar { }; say Bar(Str); # looks like the Bar() takes this code path even with a CALL-ME() 21:24
camelia (Bar(Str))
21:24 rindolf left
codesections Kaiepi: since I'm not licensed to practice law in your jurisdiction, I can't really give legal advice but keeping the license seems like a good idea in general 21:24
kybr: to flesh out what Ven_de_Thiel said a bit: the syntax for type conversions is `TargetType(OriginType)` and if OriginType is omitted, it's treated as Any. E.g.: 21:28
m: my $a = Int(); say $a = '42'; say $a.WHAT
camelia 42
codesections er, 21:29
21:29 softmoth_ joined
codesections m: my Int() $a; say $a = '42'; say $a.WHAT 21:30
camelia 42
codesections (I'm kind of surprised having the coercion doesn't work as the right-hand-side, but that's a tangent) 21:31
Anyway, the point is that Finger() is being parsed as a type coercion
21:34 softmoth_ left 21:36 aluaces left 21:42 wamba left 21:43 Ven_de_Thiel left, aborazmeh left 21:54 dogbert11 joined 21:58 dogbert17 left
Xliff How can I get access to self outside of a method? 21:59
lizmat there is no self outside of a method ? 22:00
22:02 dogbert17 joined
Xliff gist.github.com/Xliff/30478a31e96e...4a722ae3c3 22:03
See ^^ for code
22:04 UukGoblin left 22:07 dogbert11 left, brtastic left, HobGoblin joined 22:13 dotdotdot left 22:16 neshpion left 22:19 dotdotdot joined 22:34 dogbert11 joined 22:37 dogbert17 left 22:39 neshpion joined 23:13 agentzh left 23:17 agentzh joined, agentzh left, agentzh joined
guifa2 is legitimately surprised about the pushback from the CAT. (especially from guy who claimed to not trust it because he didn't know who sjm was — guess he doesn't follow perl much lol) 23:33
23:35 pecastro left
raydiak Xliff: still around? 23:50
23:55 aborazmeh joined