🦋 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. |
|||
00:00
reportable6 left
00:01
reportable6 joined
00:02
guifa_ left
00:41
razetime joined
00:53
ab5tract left
01:12
ab5tract joined
01:20
razetime left
|
|||
SmokeMachine | RakuCron can start jobs now! :) | 01:38 | |
ab5tract | SmokeMachine: nice :D | 01:52 | |
tellable6 | 2023-08-05T21:20:24Z #raku-dev <lizmat> ab5tract irclogs.raku.org/cro/live.html | ||
guifa__ has officially commenced work on Polyglot::Regexen::Perl | 01:54 | ||
ab5tract | guifa__: I hope that's an additional vote in favor of removing the P5 regex "braid" from core :) | 02:01 | |
guifa__ | I think we should test it first | ||
before making the decision | |||
ab5tract | fair enough | ||
guifa__ | At the very least, there's a good argument for maintaining PCRE (if not Perl) in core | ||
even Perl has a switch for PCRE | 02:02 | ||
ab5tract | I think there is a better argument for PCRE than there is for P5 | 02:03 | |
happy hacking :) | 02:04 | ||
guifa__ | Honestly now that ECMA is done Perl (and PCRE) will be pretty easy | 02:05 | |
it's mostly update the exact definitions of escapes (easy), and handling some of the specialized (? …) blocks | 02:06 | ||
the one I'm struggling figuring out how to do is the same-script one, such that backtracking occurs correctly | 02:07 | ||
and then I just need to do a lot of tests for the special alternation group that adjusts how positionals are counted, and then done | |||
well, I guess also need to figure out how to handle embedded blocks — I think the only logical choice there is to only allow Raku code. Same for any other language that allows for embedded code | 02:09 | ||
02:20
evalable6 left,
linkable6 left
|
|||
antononcube | @guifa As I threatened I complained publicly about your "laziness" - see the sub-section "Introduction :: Standard enhancements" here: rakuforprediction.wordpress.com/20...functions/ | 02:21 | |
02:22
evalable6 joined
|
|||
guifa__ | haha | 02:23 | |
02:23
linkable6 joined
|
|||
guifa__ | Polyglot::Regexen is solid now, but it does require a recent version of Rakudo | 02:23 | |
02:25
ab5tract left
|
|||
antononcube | Great. | 02:26 | |
02:50
guifa left
02:57
bigdata joined
03:11
cm_ joined
03:12
cm left,
cm_ is now known as cm
03:31
cm left
03:32
bigdata left
03:33
gabiruh left,
gabiruh_ joined
03:41
cm joined
05:10
bloatable6 left,
reportable6 left,
bisectable6 left,
greppable6 left,
committable6 left,
coverable6 left,
releasable6 left,
benchable6 left,
sourceable6 left,
tellable6 left,
notable6 left,
statisfiable6 left,
nativecallable6 left,
squashable6 left,
quotable6 left,
linkable6 left,
evalable6 left,
unicodable6 left,
shareable6 left,
bisectable6 joined
05:11
quotable6 joined,
shareable6 joined,
releasable6 joined,
coverable6 joined,
sourceable6 joined,
tellable6 joined,
unicodable6 joined,
statisfiable6 joined
05:12
squashable6 joined,
linkable6 joined,
benchable6 joined,
nativecallable6 joined,
reportable6 joined,
notable6 joined,
evalable6 joined
05:13
committable6 joined,
greppable6 joined,
bloatable6 joined
05:53
MoC joined
06:00
reportable6 left
06:01
reportable6 joined
07:05
abraxxa joined
07:22
japhb left,
japhb joined
07:48
jpn joined
07:53
dakkar joined
08:09
squashable6 left
08:10
squashable6 joined
08:12
Sgeo left
08:16
tea3po joined
08:20
teatwo left
|
|||
nemokosch | Another illustration that modules rather depend on a certain version of Rakudo, not a certain language version | 08:54 | |
09:21
spacekookie left
09:41
NemokoschKiwi joined
|
|||
NemokoschKiwi | I wanted to test something peculiar: what if you bind-swap two variables that don't have the same scope? | 09:42 | |
m: my @outer = <ao bug>; { my @inner = <victor koji>; (@outer, @inner) := (@inner, @outer); }; dd @inner; dd @outer; | 09:43 | ||
camelia | ===SORRY!=== Error while compiling <tmp> Cannot use bind operator with this left-hand side at <tmp>:1 ------> i>; (@outer, @inner) := (@inner, @outer)⏏; }; dd @inner; dd @outer; |
||
NemokoschKiwi | okay, that's still my bad | 09:44 | |
m: my @outer = <ao bug>; { my @inner = <victor koji>; :(@outer, @inner) := (@inner, @outer); }; dd @inner; dd @outer; | |||
camelia | ===SORRY!=== Error while compiling <tmp> Variable '@inner' is not declared. Perhaps you forgot a 'sub' if this was intended to be part of a signature? at <tmp>:1 ------> ter, @inner) := (@inner, @outer); }; dd ⏏@inner; dd @outer… |
||
NemokoschKiwi | okay, that *still* is my bad 😅 | ||
m: my @outer = <ao bug>; { my @inner = <victor koji>; :(@outer, @inner) := (@inner, @outer); dd @inner; }; dd @outer; | |||
camelia | Lexical with name '@outer' does not exist in this frame in block <unit> at <tmp> line 1 |
||
NemokoschKiwi | as expected... | 09:45 | |
m: my @outer = <ao bug>; { my @inner = <victor koji>; :(@outer, @inner) := (@inner, @outer); dd @inner; } | |||
camelia | Lexical with name '@outer' does not exist in this frame in block <unit> at <tmp> line 1 |
||
NemokoschKiwi | okay this is bullshit though | ||
actually worse than expected | |||
m: my @outer = <ao bug>; { my @inner = <victor koji>; dd @inner; } | 09:46 | ||
camelia | Array @inner = ["victor", "koji"] | ||
NemokoschKiwi | m: my @outer = <ao bug>; { my @inner = <victor koji>; dd @inner; @outer; } | ||
camelia | WARNINGS for <tmp>: Useless use of @outer in sink context (line 1) Array @inner = ["victor", "koji"] |
||
NemokoschKiwi | oops | ||
m: my @outer = <ao bug>; { my @inner = <victor koji>; dd @inner, @outer; } | |||
camelia | Array @inner = ["victor", "koji"] Array @outer = ["ao", "bug"] |
||
NemokoschKiwi | so the binding itself guards against this use, with a rather undescriptive error message | 09:47 | |
m: my @outer1 = <ao bug>; my @outer2 = <garou garashi>; { :(@outer1, @outer2) := (@outer2, @outer1); }; | 09:48 | ||
camelia | Lexical with name '@outer1' does not exist in this frame in block <unit> at <tmp> line 1 |
||
NemokoschKiwi | even worse when they could be swapped actually | 09:49 | |
guifa__ | nemokosch: I'm depending on an experimental feature, it makes sense that right now I'm on a particular rakudo version | 09:54 | |
When 6.e is out, anything that's 6.e compatible will work fine for the module | |||
NemokoschKiwi | this is just an extremic example | 09:56 | |
in theory, those modules that mangle with the metamodel, depend on Rakudo, and quite possibly a specific version of Rakudo (i.e there are no formal guarantees that things won't break, only the "we are not changing anything" sentiment) | 09:57 | ||
and in practice, **all** modules depend on Rakudo because the language is not defined in an exhaustive way | |||
any time anything possibly user-facing changes, that can very well break a dependency; only Blin stands in the way of that | 09:58 | ||
10:00
NemokoschKiwi left
|
|||
nemokosch | there was an issue about this github.com/Raku/problem-solving/issues/253 to be frank, I would have been dissatisfied with my response even 2 months after writing it | 10:21 | |
"user code should just depend on the language version" is easy to say but the reality is that user code does not, and mostly cannot, depend on anything but the actual runtime | 10:23 | ||
actually, I might as well open a new issue for this; not because I anticipate enthusiasm towards a solution but to at least register that this issue has only been growing over time | 10:32 | ||
librasteve | great news - finally you can go crag 'my \λ=2.5nm; my \ν=c/λ; say ν.norm' #119.916..PHz on your command line | 10:39 | |
zef install App::Crag (calculator using raku grammars) | |||
lizmat | librasteve++ | 10:47 | |
but why stop there ? | 10:48 | ||
crag 'λ=2.5nm; ν=c/λ; say ν.norm | |||
surely should also work ? | |||
:-) | 10:52 | ||
10:57
spacekookie joined
10:58
melezhik joined
|
|||
melezhik | o/ | 10:58 | |
has anyone read the Raku: A language for gremlins - on HN? produced quite an attention there ... | |||
news.ycombinator.com/item?id=37040681 | |||
lizmat | notable6: weekly :) | 11:00 | |
notable6 | lizmat, Noted! (weekly) | ||
lizmat | notable6: weekly | ||
notable6 | lizmat, 3 notes: 2023-08-08T15:34:57Z <lizmat>: news.ycombinator.com/item?id=37040681 ; 2023-08-08T15:34:59Z <lizmat>: lobste.rs/s/x5impj/raku_language_for_gremlins ; 2023-08-10T11:00:34Z <lizmat>: :) | ||
lizmat | lobste.rs is also busy | ||
11:14
jpn left
|
|||
melezhik | lizmat ++ | 11:38 | |
11:59
TieUpYourCamel left
12:00
reportable6 left
12:01
reportable6 joined
12:08
Aedil left
12:12
Vyrus left
12:13
Vyrus joined
12:14
melezhik left
12:22
jpn joined
12:29
jpn left
|
|||
nemokosch | it might be your lucky day, somebody is wrong on the internet 😂 | 12:41 | |
this is more important than some "problem solving" issue | |||
what is lobste.rs? Can I get more Dunning-Krueger lads mad at me? | 12:43 | ||
antononcube | @lizmat Agreed, on crag 'λ=2.5nm; ν=c/λ; say ν.norm. Although, any opinion I might voice in that kind of functionalities is going to be very biased by Mathematica and Wolfram|Alpha. | 12:45 | |
nemokosch | okay this lobste.rs is much more chill | 12:48 | |
12:58
Aedil joined
|
|||
antononcube | At some point you realize that time is a precious resource, not worth spending on games, TV, and programming. You can spent all that time arguing with people in The Internet. | 13:02 | |
nemokosch | makes sense right?? | 13:05 | |
13:09
spacekookie left
|
|||
antononcube | I read the lobste.rs thread — mildly interesting… | 13:11 | |
… it makes sign/log in and tell them that Julia sucks. | 13:12 | ||
nemokosch | 🤣 | 13:15 | |
I know, Julia is like Obama... | |||
13:16
jpn joined
13:21
spacekookie joined
|
|||
antononcube | Yes, thank you! | 13:21 | |
nemokosch | it's always the worst if you don't choose a side though 🥲 | 13:22 | |
librasteve | well it's only a wrapper on raku -e ' ...' not setting out to make yet another language ... and it should be easy to remember too! | 13:24 | |
nemokosch | anyway, the idea is quite cool | 13:25 | |
librasteve | ... if ονλυ there was a use nostrict΄ | 13:29 | |
checks docs - aha | 13:30 | ||
how about | |||
crag '$λ=2.5nm; $ν=c/$λ; say $ν.norm' | |||
v0.0.4 on the way | |||
antononcube | @nemokosch Reading your comments in ycombinator: I am not sure how generic or scientific the name “produce” (for the routine produce) is. But I have been aware of that operation “very early on” reading/learning Functional Programming (FP). | 13:36 | |
My main FP language is Mathematica / WL. So, WL has Fold corresponding to reduce and FoldList corresponding to produce. WL also has Accumulate which is a shorthand of FoldList[Plus, …]. | 13:38 | ||
@nemokosch LOL : > My point is that Raku may be legitimately confusing and you may be illegitimately confused. | 13:43 | ||
librasteve | huh? | 13:46 | |
13:47
Sgeo joined
|
|||
nemokosch | this is what Mr. Antonov always says | 13:53 | |
like here ^^ (for IRC folks: quote reply to a 20th March 2023 message) | 13:54 | ||
oh yes, it's accumulate in Python as well, and that's how the author called it, too | 13:55 | ||
I think the point is much less what it's called in Raku because that didn't even appear in the article | |||
it just made sense for me to use the Raku name when referencing it 🤷♂️ | 13:56 | ||
and this all leads to the same thing: it's bothering, if not outright crippling, that the article could apparently contain whatever because the audience (at least the loud part of it) will just echo their own prejudices, even if they don't fit the concrete topic | 13:59 | ||
You may say it's ironic but in this I see the reassurance of my own prejudice: namely that there isn't much point in trying to show people "Raku, the good parts" | 14:01 | ||
jgaz | I may have found a bug | 14:09 | |
if I set a `$x = Buf[int8].new(-1)` the value is 0xff (correct) but if I coerce $x [0xff] to an Int with `say $x.Int` I get "1", it should be "-1". | |||
lizmat | nemokosch github.com/Raku/problem-solving/issues/377 I wonder if the word Perl hadn't occurred in the article, how the reactions would have been | ||
jgaz | That would be correct, given `Buf[uint8]` | 14:10 | |
lizmat | jgaz: could you make a gist with the *exact* code and what you expect and what isn't ? | 14:11 | |
jgaz | Can I use pastebin? | ||
lizmat | jgaz sure | 14:12 | |
nemokosch | lizmat: I guess "we will never know that" but it's rather worrying that this wasn't an article very loud about the "Perl" part | 14:13 | |
it very slightly mentioned it | |||
lizmat | the slightest mention of Perl will set a lot of people off :-( | 14:14 | |
nemokosch | That is quite possible but I don't think we can really help with that. We can't ban people to every now and then reference "Perl" with regards to something that has spent 19 years "in its infancy" as Perl 6 | 14:15 | |
lizmat | true, but we can limit the exposure as much as we can | 14:16 | |
14:17
squashable6 left
|
|||
nemokosch | Also, I think "Perl" is to a large extent just a symbol/strawman to the "write-only" sentiment so my impression is that people would keep making the Perl comparison even if it had no "genetic" basis | 14:18 | |
14:18
squashable6 joined
|
|||
I actually wonder if a comparison to Ruby is much better | 14:21 | ||
jgaz | lizmat: pastebin.com/j7tvNd9k | ||
please met me know if I am having a sudden attack of dumb, but I don't think I am. :D | 14:22 | ||
lizmat | jgaz: when you coerce a Buf to an Int like that, you get the number of elements in the Buf | 14:23 | |
jgaz | Because Buf is a container not a scalar? | ||
lizmat | m: my $x = Buf[int8].new(0xff, 0xff); say $x.Int | ||
camelia | 2 | ||
lizmat | m: my $x = Buf[int8].new(0xff, 0xff); say $x[0].Int | ||
camelia | -1 | ||
lizmat | jgaz ^^ | ||
so not a bug :-) | |||
nemokosch | see, this may not be a very fortunate conversion, for example... | 14:24 | |
and this one isn't even about "write-only" and TIMTOWTDI | |||
jgaz | yeah, had I picked something other than 1/-1 I probably would have spotted it. | ||
lizmat | how is this different from doing .Int on a native int array ? | ||
jgaz | lizmat: thanks | ||
Sorry to bother. | |||
lizmat | jgaz: no worries, thanks for asking :-) | 14:25 | |
nemokosch | the whole "listy things can be coerced to Int as the number of their elements" is shady imo | ||
and I feel some sort of socially reinforced internal pressure to use "clever tricks" like this that will bite everyone at least once | 14:26 | ||
this particular "clever trick" is too much for my taste - but I kind of keep using it, "since it's already there anyway" | |||
lizmat | and that sorta gives the trick legitimacy, as you *do* tend to use it :-) | 14:27 | |
but I see your point: some decisions made for Perl, and later Raku, were prematurely huffmanized because of: less typing in oneliners | 14:28 | ||
14:30
anthk_ joined
14:31
voidzero joined
|
|||
nemokosch | This is a sociocultural thing in a sense. If several mainstream languages did it (like say, implicit coercion to string with the + operator if the other argument is a string), then it wouldn't be worth mentioning probably | 14:32 | |
14:37
bigdata joined
14:39
heartburn left
14:49
heartburn joined
15:02
abraxxa left
|
|||
antononcube | Julia got an some numerical software award given every 3-5 years, well, just because Julia's team released version 1.0. It is like Obama getting the Nobel Peace Prize just for "showing up." | 15:19 | |
15:30
bigdata left
|
|||
jdv | most of the huff stuff is useful once one learns that's how stuff works | 15:31 | |
or so i think | |||
15:39
razetime joined
15:41
razetime left
|
|||
librasteve | ooo | 15:44 | |
15:44
voidzero left
15:51
ab5tract joined
|
|||
ab5tract | The thing with lobste.rs is that it is invitation only -- lobste.rs/about#invitations | 16:19 | |
It would be great if we could get a few invites for some community members to chime in on Raku discussions | 16:20 | ||
I'm also fairly sure the website name is a reference to Charles Stross' Accelerando, but I can't be certain | |||
antononcube | @ab5tract I have not heard of Charles Stross' Accelerando before. (And I should just because the name of my company sounds similar.) | 16:23 | |
16:33
dakkar left
|
|||
anthk_ | hello, I can't use zef under limited constraints | 16:48 | |
1GB of RAM, 1.2GB of SWAP, i386, OpenBSD 7.3 | 16:49 | ||
I tried to install Linenoise but it always fails with being out of memory | |||
and, yes, I raised the datasize limits to 4GB | |||
lizmat | that feels.... strange | 16:53 | |
reading big JSON files doesn't help, but I haven't seen it grow beyond 600MB or so during an install | 16:55 | ||
tonyo | that's probably a big part of it ^, i'm currently working on an indexer that would reduce memory usage | 16:58 | |
ugexe: ^^ | 16:59 | ||
su.shi | anyone know if it's possible to host a git server using raku? im trying to use the Cro library | ||
lizmat | su.shi I don't know of anybody who's done that, but I think all of the basic building blocks are there in Cro | 17:02 | |
su.shi | i'll be checking it out, then. thanks! | 17:03 | |
anthk_ | tonyo: thanks, hope it helps | 17:04 | |
ugexe | hard to say: obviously zef installed fine, they are using it. But with Linenoise being a native library and OpenBSD being one of the least used OS for rakudo (I would guess anyway) | 17:05 | |
who knows | |||
anthk_ | I can use rlwrap instead of Linenoise, but not having access to p6's "CPAN" it's lmiting | ||
tonyo | anthk_: does `zef update` work OK? | 17:06 | |
su.shi | stuck on git requesting from Cro, when I try to fetch from the remote, Cro says "Malformed request line", but I've no idea what that means, and it doesn't show anything about the request so I'm not sure how to debug this | 17:15 | |
git tells me: 'OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to localhost:8080', I'm not sure what this means | 17:16 | ||
anthk_ | tonyo: yes | 17:17 | |
su.shi | im dumb, it's because i was hosting an http server and tried accessing it as an https server | 17:20 | |
lizmat | su.shi I think you've misunderstood me | ||
I have no idea what the git protocol does, but I guess it's not really http:// is it ? | |||
su.shi ok , shutting up now :) | 17:21 | ||
anthk_ | ok trying Zef install Linenoise with fetch-degree and test-degree to 1 | 17:23 | |
nemokosch | so that's why lobste.rs is a more decent place, ha | 17:26 | |
then I better stay outside :DD | 17:27 | ||
anthk_ | MoarVM panic: Memory allocation failed; could not allocate 524288 bytes | ||
:| | 17:29 | ||
japhb | anthk_: It is possible to tune down MoarVM's various memory sizes -- this has been used extensively in the past to validate memory management and garbage collection correctness. But it's *default* configuration is for a machine with more available RAM than that. | 17:31 | |
anthk_ | japhb: at runtime or while compiling it? | 17:32 | |
japhb | anthk_: #moarvm would be the place to ask about how to configure MoarVM memory smaller. | ||
17:32
jpn left
|
|||
japhb | anthk_: I think there are some dials that are compile time, and other that are runtime. Part of the GC config, IIRC. | 17:32 | |
Been quite a while since I went spelunking in that code. | 17:33 | ||
Please note: being really aggressive in tuning those parameters down will result in MoarVM having to GC a LOT more often, which will have "non-trivial performance effects". :-P | 17:34 | ||
17:35
jpn joined
|
|||
su.shi | it looks like Cro does not support PROPFIND, which it seems to want to use for pushing, so I'm thinking it won't be able to host a git server | 17:36 | |
any other good http server hosting libraries? | |||
anthk_ | japhb: as long I can still stuff, it's fine. The best would be to finetune it at runtime, enough to not OOM on installing packages.I tried even with --serial so it tries to install things one at a time, but no luck | ||
s,still, install | 17:37 | ||
nemokosch | what is special about a "git server"? | 17:39 | |
17:40
jpn left
|
|||
su.shi | I'm writing a server that hosts a git repository through http | 17:40 | |
im not sure there is anything special about it, though idk what PROPFIND is yet, so idk if that is something special for git | 17:41 | ||
looks like it's something to do with a thing called WebDAV | 17:42 | ||
ugexe | If you built rakudo from source in the last week or so it might be worth setting RAKUDO_NO_PRECOMPILATION=1 when installing Linenoise to potentially workaround precompilation itself causing the memory issue | 17:43 | |
anthk_ | the problem it's when trying to compile LibraryMake | 17:54 | |
18:00
reportable6 left,
reportable6 joined
|
|||
nemokosch | haven't heard of PROPFIND either | 18:05 | |
lizmat | yeah, that's pretty ancient WebDAV stuff | 18:09 | |
jdv | webdav. a blast fron the svn flavored past. | 18:18 | |
*from | |||
su.shi | i just want to write a server that takes git commits then test compilation on the new code that was committed, but it seems to be so difficult to do | 18:22 | |
im not sure how to get it to not use webdavb | |||
antononcube | @sushi You might look-up what Melezhik is doing. E.g. "Sparrow". | 18:24 | |
www.youtube.com/watch?v=FZBqRRgkDxE | 18:36 | ||
18:44
PipStuart joined
|
|||
ugexe | anthk_: it would probably help to post the full output using the --debug flag. you also might want to try and explictly install LibraryMake to see if that works in isolation | 18:47 | |
su.shi | is there anyway to set environment variables in raku? | 18:50 | |
nemokosch | so that they are visible to the invoking shell? | 18:54 | |
anthk_ | ugexe: I tried that, installing it to set up the rest later | 18:55 | |
but same error | |||
ok, now launcher with --debug 2> err | |||
su.shi | the git http backend needs me to set env variables for the script, so they need to be visib le in a script that i will be invoking later | ||
nemokosch | I mean that's how it sounds useful but also that's how it sounds so hard to imagine... | ||
anthk_ | s,launcher,launched | ||
su.shi | oh, i think i can just set env variables when i call the script, right? | ||
nemokosch | that you can always do 😉 | 18:56 | |
su.shi | great | ||
anthk_ | Enabled extracting backends [git path unzip] don't understand /tmp/.zef/1691693717.54319/1691693874.54319.9076.856737109147/LibraryMake%3Aver%3C1.0.0%3E%3Aauth%3Cgithub%3Aretupmoca%3E.tar.gz | 19:02 | |
You may need to configure one of the following backends, or install its underlying software - [tar psunzip] | |||
it's just a gzip file, file from unix got it right, it doesn't look corrupted | 19:04 | ||
tonyo | is tar in your path? | ||
anthk_ | yes | 19:05 | |
19:09
SuspiciousSwan joined
|
|||
tonyo | iirc, does tar in openbsd not support gzip ? | 19:11 | |
ugexe | since its showing up in that underlying software listing, that means the `probe` check is returning false - github.com/ugexe/zef/blob/710034fe...od#L81-L90 | 19:13 | |
oh | |||
i think i remember something about openbsd not liking % in filenames... but maybe that was just for make files | 19:14 | ||
does `tar --help` give exitcode 0? | 19:15 | ||
it might be worth updating zef as well... you posted output of zef mentioning `psunzip` which was removed in february | 19:22 | ||
tonyo | it was either freebsd or openbsd doesn't like the .gz stuff, can't remember which | 19:25 | |
ugexe | if you are thinking of the same thing as me, it was .zip | 19:32 | |
maybe not though, bsdtar is the one that actually handles .zip unlike gnutar | 19:33 | ||
thing is, its not even getting that far | 19:35 | ||
the probe check on `tar --help` from my link above is returning false | |||
so zef won't even try to use tar to extract anything | |||
nemokosch | there was definitely an issue with the % stuff, there is an issue in LibraryMake now that you mention it | 19:38 | |
github.com/retupmoca/P6-LibraryMake/issues/42 | 19:39 | ||
tonyo | wonder if it just needs escaped with the linker | 19:40 | |
anthk_ | sorry, I was outside | ||
SuspiciousSwan | Please let me know if this would be better in the beginners channel. | 19:41 | |
Supposed that I receive objects or types of objects, and a function with a type signature, is there a good way to ask if the function can take in an object? | |||
Clearly this is wrong, but I'm not sure if it's just the use of a role instead of specifying it in the type signature, or something deeper. | |||
And if it matters, the classes will be defined during runtime with the MOP | |||
``` | |||
class A { | |||
has Int $.a | |||
anthk_ | openbsd tar doesn't have long switches | ||
SuspiciousSwan | }; | ||
class B { | |||
has Int $.a; | |||
has Int $.b; | |||
}; | |||
class C { | |||
has Date $.a | |||
}; | |||
role hasIntA { | |||
has Int $.a | |||
}; | |||
anthk_ | sorry | ||
SuspiciousSwan: cat file " | |||
cat file | nc termbin.com 9999 | |||
that way the channel won't be flooded | |||
SuspiciousSwan | Sorry about that | 19:42 | |
tonyo | m: sub a ($p1, $p2) { }; say a.^signature; | 19:43 | |
camelia | ===SORRY!=== Error while compiling <tmp> Calling a() will never work with declared signature ($p1, $p2) at <tmp>:1 ------> sub a ($p1, $p2) { }; say ⏏a.^signature; |
||
tonyo | m: sub a ($p1, $p2) { }; say &a.^signature; | ||
camelia | No such method 'signature' for invocant of type 'Perl6::Metamodel::ClassHOW' in block <unit> at <tmp> line 1 |
||
tonyo | ahh | ||
nemokosch | signature is a normal method, no? | ||
m: sub a ($p1, $p2) { }; say &a.signature; | |||
Raku eval | ($p1, $p2) | ||
ugexe | anthk_: how does one print out what would otherwise be `tar --help`? Like `tar -h` or some such? | 19:44 | |
anthk_ | tar -h tries to open a non existant tape device, /dev/rst0 | 19:45 | |
tonyo | doh | 19:46 | |
tar --help? | |||
anthk_ | unknown option - | ||
echo $? returns 1 ofc | |||
nemokosch | man tar? 😄 | 19:47 | |
anthk_ | ^exactly what the bot says | ||
ugexe | ideally the probe works the same across all os, and does not require additional external software to figure it out (otherwise we're now probing for man`) | 19:49 | |
perhaps the exitcode / text of just running `tar` by itself could provide a commonality | 19:50 | ||
if you were to clone zef and checkout v0.16.2 i suspect things might work for you, because it would still have access to the perl script tar extraction fallback. but i'd also like to put out a fix for the `tar` detection in zef to work correctly | 19:53 | ||
gfldex | m: sub f(Int $, Str $) {}; &f.cando(\(42, 'answer')); | ||
camelia | ( no output ) | ||
gfldex | m: sub f(Int $, Str $) {}; &f.cando(\(42, 'answer')).say; | ||
camelia | (&f) | ||
gfldex | SuspiciousSwan: ^^ | ||
SuspiciousSwan | Is the difference between cando and ACCEPTS if it takes a type vs an instance? | 19:55 | |
anthk_ | ugexe: which git checkout it's v0.16.2? | 19:56 | |
ugexe | yeah | ||
anthk_ | ah ok git checkout v0.1.6.2 | ||
ugexe | you'll probably need to `raku -I. bin/zef uninstall zef` first | 19:57 | |
no its v0.16.2 | |||
anthk_ | that was a typo, sorry | ||
nemokosch | cando returns the candidates that can utilize the given arguments | 19:59 | |
and not sure how ACCEPTS is related. That would be the method to back up any sort of smartmatching | 20:00 | ||
anthk_ | ugexe: this way? .raku -I. bin/zef uninstall zef ; raku -I. bin/zef install . | 20:01 | |
ugexe | yeah that should do it | ||
what does `raku -e 'say $*VM.osname'` say on your system? i might just have to special case the detection in this case | 20:02 | ||
gfldex | SuspiciousSwan: Your question isn't really valid, because in Raku there is no clear destinction between values and types. Types are objects and can be used as values. | 20:10 | |
anthk_ | wait. raku ... uninstall lasted a lot, so I just rmdir'ed ~/.raku and I'm trying to reinstall it | ||
SuspiciousSwan | gfldex - ok so I can detect if it has an a with a destructuring subsignature, but how to I allow it to also accept things from class B? - sub doit((Int:$a)) { say $a } works for A, but rejects B due to the extra argument | 20:13 | |
20:15
teatwo joined
|
|||
ugexe | anthk_: it might not be installed to ~/.raku. `raku -I. bin/zef nuke site home` would delete everything though | 20:15 | |
(everything = all installed modules) | |||
anthk_ | osname returns openbsd | ||
well, still installing | 20:16 | ||
20:16
teatwo left,
teatwo joined
|
|||
su.shi | not a huge fan of Cro's documentation | 20:17 | |
how am I to get the data sent with a post request? | |||
20:18
tea3po left
|
|||
gfldex | m: class C { has $.a; has $.b; }; sub f((:a($a), |)) {}; f(C.new); | 20:19 | |
camelia | ( no output ) | ||
gfldex | SuspiciousSwan: you can use a capture to consume any extra attributes | ||
nemokosch | cro.services/docs/reference/cro-ht...est_bodies | 20:20 | |
I guess this can be useful | |||
20:20
MoC left
|
|||
anthk_ | MoarVM panic: Memory allocation failed; could not allocate 327680 bytes | 20:21 | |
SuspiciousSwan | Is that better than using a slurpee like sub doit((Int:$a, *%_))? | 20:22 | |
su.shi | im confused on what this syntax is doing: request-body -> %json-object { # Save it, and then... created 'product/42', 'application/json', %json-object; } is this calling something called request-body, then passing a callable to it ? | ||
gfldex | SuspiciousSwan: might be a wee bit faster | 20:23 | |
SuspiciousSwan | Ok, thank you - I think I was able to navigate through the documentation with people's help and I have something that I thinks works now | 20:26 | |
nemokosch | As a convenience, the router also exports the subs request-body, request-body-text, and request-body-blob, which take a block. | 20:30 | |
so it seems you are right | |||
su.shi | ah nice | ||
ugexe | I created github.com/ugexe/zef/pull/521 to fix tar detection on openbsd | 20:33 | |
20:42
SuspiciousSwan left
|
|||
anthk_ | MoarVM panic: Memory allocation failed; could not allocate 40 bytes | 20:46 | |
:| | |||
nemokosch | lmfao | ||
japhb | anthk_: You know, given the usual OpenBSD paranoia, it occurs to me that it might be necessary to specify that MoarVM is a JIT, and thus should be allowed to write code and then later execute it? Somewhere deep in my memory banks I remember OpenBSD being even stricter about that than basic W^X. | 20:50 | |
ab5tract | antononcube: It's a great novella that was slow-rolled onto the net for free back in the early 2000s during the slashdot era. Charlie Stross is a helluva writer, from what I remember | ||
anthk_ | WX_ALLOWED | ||
yes, USE_WXALLOWD = yes or something llike that in the port | 20:51 | ||
antononcube | @ab5tract Thanks! I will try to find / read it. | ||
anthk_ | but the configure args don't compile it with jit support | ||
I can always recompile raku with jit and wxneeded support, but woudn't a JIT need more memory? | 20:53 | ||
ab5tract | antononcube: www.antipope.org/charlie/blog-stati...intro.html (would have sent as a PM but you are on discord :) ) | 21:03 | |
antononcube | Great thanks! | 21:08 | |
ab5tract | anthk_: are you compiling from git HEAD? or from a specific release tag? | 21:14 | |
anthk_ | I used the openbsd package | 21:15 | |
2022.12 | |||
ab5tract | ouch | 21:19 | |
oh wait, sorry, that's not so bad | |||
. o O ( what is time, anyway? ) | |||
anthk_: it might be worth trying recompiling with jit, just to see what happens. I'm not aware of any breakage in non-jit builds but it is also not a very common way to build rakudo | 21:20 | ||
anthk_ | ab5tract: ok, brb, reboot (wxallowed on port dir) | 21:21 | |
21:21
rypervenche left,
Tirifto left,
kaskal left,
eseyman left,
vrurg left,
camelia left,
bdju left,
tadzik left,
eseyman joined,
Tirifto joined,
rypervenche joined,
rypervenche left,
rypervenche joined
21:22
vrurg joined,
tadzik joined,
bdju joined
21:27
camelia joined
21:28
kaskal joined
|
|||
anthk_ | ok, recompiling, it will last a lot | 21:33 | |
ab5tract | anthk_: ack. thanks for trying this again | 21:35 | |
22:28
linkable6 left,
evalable6 left
22:29
evalable6 joined,
linkable6 joined
23:29
squashable6 left,
evalable6 left,
bisectable6 left,
statisfiable6 left,
coverable6 left,
nativecallable6 left,
releasable6 left,
linkable6 left,
unicodable6 left,
notable6 left,
quotable6 left,
reportable6 left,
tellable6 left,
benchable6 left,
shareable6 left,
sourceable6 left
23:30
coverable6 joined,
releasable6 joined,
evalable6 joined,
unicodable6 joined,
bisectable6 joined
23:31
quotable6 joined,
linkable6 joined
23:32
notable6 joined,
tellable6 joined,
statisfiable6 joined,
squashable6 joined,
sourceable6 joined,
shareable6 joined,
benchable6 joined
23:33
nativecallable6 joined,
reportable6 joined
|