🦋 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.
codesections earlier, lizmat said that sending a file to the raku REPL would support multiline blocks better if the editor saved the text as a temp file (instead of essentially pasting it in). That made sense, and I've seen similar approaches in other languages/REPLs. However, unless I'm missing something, it looks like the temporary-file approach won't work either, because the REPL can't currently load a file 02:42
into the global namespace (only import Modules). Is that correct?
(Of course, that's a great design decision for the language as a whole, even if it makes setting up a REPL-driven workflow quite a bit more difficult) 02:43
(I'm basing my conclusion that the REPL can't load a non-module file on stackoverflow.com/questions/501199...epl-usage, combined with my inability to get it to do so. But that answer is a couple years old, and I'd love to learn that it's out of date now) 02:48
rjbs Hey, I just found a crazy bug with rakudobrew and it seems so weird, but maybe (a) nobody uses rakudobrew anymore or (b) I am just an idiot. 03:53
rjbs If I initialize rakudobrew in my zshrc *after* plenv, then rakudobrew seems to put the path to the current perl shim into my PATH, which breaks using "plenv shell" subsequently. 03:54
If I put initialize rakudobrew *first*, it's fine. ???
rjbs Bleh, I see. rakubrew now, which wants me to do a curl pipe. 03:55
aleksb hi, if I want to create local modifications to a zef package (e.g. to fix a bug) for use in my own projects, what is the easiest way? 04:27
samebchase- aleksb: You can clone the repository, make modifications and do a zef install from inside that repository, and it will install it for you locally. 04:35
Let me find the exact syntax
aleksb: I think you can cd to the repository and do a plain `zef install`. 04:37
aleksb: Sorry it is `zef install .` Notice the dot 04:38
aleksb: I got it from github.com/MARTIMM/mongo-perl6-dri...-630363249 04:40
aleksb I had to do `zef install . --force-install` to override the official version (which was already installed) but it works 04:46
thank you!
dev hi 05:49
holyghost A nice project for someone, make allegro library raku bindings (allegro.cc liballeg.org) 07:12
It's a giftware licensed game library 07:14
written in C, there's also a iphone system for it 07:18
I might write an extension for it, an adaptive systems library for game AI and statistics 07:23
e.g. for RTS games 07:24
ab5tract m: sub infix:</>(&f, *@a) is tighter(&infix:<+>) { reduce &f, @a }; say &[~] / <w e x> 07:29
camelia wex
ab5tract m: sub infix:</>(&f, *@a) is tighter(&infix:<+>) { reduce &f, @a }; say &infix:<+> / 5, 6, 7 07:30
camelia 567
ab5tract m: sub infix:</>(&f, *@a) is tighter(&infix:<+>) { reduce &f, @a }; dd &[~] / <w e x>
camelia "wex"
ab5tract m: sub infix:</>(&f, *@a) is tighter(&infix:<+>) { reduce &f, @a }; dd &infix:<+> / 5, 6, 7
camelia 5
6
7
ab5tract what am I doing wrong? :(
ab5tract m: dd reduce &infix:<+>, 5, 6, 7 07:32
camelia 18
ab5tract lizmat: any ideas? ^ 08:56
moritz there's already an infix /; I don't think you can redefine the precedence of an existing operator 09:08
also, for your code to work you'de have to give it a looser prec than infix:<,> 09:09
ab5tract moritz local definitions override core 09:10
moritz m: sub infix:<RED>(&f, @*a) is looser(&infix<,>) { reduce &f, @a }; say &infix:<+> RED 10, 11, 12
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
infix used at line 1. Did you mean 'indir', 'index'?
moritz m: sub infix:<RED>(&f, @*a) is looser(&infix<,>) { reduce &f, @a }; say &[+] RED 10, 11, 12
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
infix used at line 1. Did you mean 'index', 'indir'?
ab5tract m: sub infix:<+>($a, $b) { say "computer says no" }; "x" + "y"
camelia computer says no
moritz ab5tract: I know, but that example doesn't redefine the *precedence* of an existing op 09:11
m: sub infix:<RED>(&f, @*a) is looser(&infix:<,>) { reduce &f, @a }; say &[+] RED 10, 11, 12
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@a' is not declared
at <tmp>:1
------> 3@*a) is looser(&infix:<,>) { reduce &f, 7⏏5@a }; say &[+] RED 10, 11, 12
ab5tract why would the new definition not also have its precedence applied
moritz m: sub infix:<RED>(&f, *@a) is looser(&infix:<,>) { reduce &f, @a }; say &[+] RED 10, 11, 12
camelia 33
ab5tract anwyay i think you maybe missed that the first example using `
`~` works as expected 09:12
but using infix + does not
moritz ab5tract: because that would need to remove an existing operator from a language you're deriving
but the example above with a new symbol works
m: sub infix:<RED>(&f, *@a) is looser(&infix:<,>) { reduce &f, @a }; say &[+] RED 10, 11, 12
camelia 33
moritz m: sub infix:<RED>(&f, *@a) is looser(&infix:<,>) { reduce &f, @a }; say &[~] RED 10, 11, 12 09:13
camelia 101112
ab5tract m: > sub infix:<+>(Str $a, Str $b) { say "no ints allowed" }; say 5 + 5 09:14
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix > instead.
at <tmp>:1
------> 3>7⏏5 sub infix:<+>(Str $a, Str $b) { say "no
ab5tract I don't see how preceddence can really matter here because local definitions override any core 09:15
moritz that's what I've been trying to explain
there are two parts to an infix:<something> definition
1) if the symbol doesn't exist already, add it to the parser 09:16
2) install it in the lexical pad, call it
if you override an existing operator, only 2) happens
but you need 1) to change the precedence of an operator 09:17
ab5tract I'm still not convinced
moritz then show me an example where a local override changed the precedence of an existing operator 09:18
ab5tract Behavior of my redefinition of `infix:</>` according to different precedence changes behavior
it doesn't do the *right* thing 09:19
but it doesn't do *no* thing
moritz m: sub infix:<+>($a, $b) is tighter(&infix:<~>) { "[$a + $b]" }; say 3 ~ 4 + 5
camelia 3[4 + 5]
ab5tract m: sub infix:</>(&f, *@a) is looser(&infix:<,>) { reduce &f, @a }; dd &infix:<+> / 5, 6, 7 09:20
camelia 5
6
7
moritz m: sub infix:<+>($a, $b) is looser(&infix:<~>) { "[$a + $b]" }; say 3 ~ 4 + 5
camelia 3[4 + 5]
ab5tract ok I see it now
sorry for the confusion
moritz happens, it can be a confusing topic :D 09:21
ab5tract that's also a bit disappointing and unexpected relative to the general behavior of local redefinitions :(
moritz also, I consider it a bug that rakudo doesn't even give an error message regarding ignoring the precedence specfication
ab5tract LTA for certain
moritz (one could also argue that it's a bug that you cannot redefine the precedence, but I wouldn't even know how to approach fixing it) 09:22
ab5tract I'm busy otherwise I would be tempted to do a deep dive into CORE-settings to understand the hows and whys of it 09:25
:)
ab5tract moritz: would it perhaps be possible to have a special form of braid that has a more aggressive override strategy, leaving in place all CORE definitions that have not been overridden but otherwise always adding it to the parser regardless of any existing definitions? 09:34
moritz ab5tract: I don't know the current parser deep enough to answer that 09:35
ab5tract erm, sorry, that came out a bit confusing. "adding it" <-- "it" meaning any definition gets both steps 1 & 2
moritz: me either.. Lucky for us, it sounds like in a little while here we will have a new and improved parser to learn. 09:36
Laziness wins again! :)
jnthn The grammar changes very little, however. 09:40
ab5tract moritz thanks for your help. I've updated this here with this new knowlede: www.reddit.com/r/rakulang/comments...r/fws8u3s/ 09:41
ab5tract jnthn: can you elaborate? the grammar of CORE-settings? the grammar of setting up a cascading braid like I described above? the grammar of the braid grammars? 09:43
help me I'm drowning!
jnthn I guess you're referring to the RakuAST changes, and I mean that the parser itself will parse in the same way, it's what we build from it that will changes. 09:44
So don't expect much parsing wise to get magically fixed :)
Some semantic things probably will :) 09:45
ab5tract Oh, I meant that it sounds like the way slangs / braids are defined relative to the parser will likely look radically different after RakuAST 09:49
keep in mind I have zero clue how you crazy core devs manage any of that at the moment!
moritz only the part that translates the parse tree into an AST will look different
the parser itself won't
ab5tract "the part that translates" == there are more than one, no? isn't each braid going to do this differently? 09:51
moritz no, they just look up the symbols in different scopes 09:52
but the code is the same
ab5tract jnthn I guess for practical purposes, I guess I am most curious about an answer to my question: would it enable -- or change the implementation of -- addition of a mechanism to specify that you want to completely override global definitions including precedence in your local scope. 09:53
that seems like something that braids do naturally but braiding is not something we get to do ourselves outside of the ill-defined slang, correct?
jnthn ab5tract: I think that issue is orthogonal. 09:59
jnthn Clearly the semantics today of ignoring the requested precedence are LTA, though. 10:00
Maybe we should allow changing precedence or an existing operator, but only if you declare a `proto` (and so hide all existing candidates, that assumed a different precedence)
ab5tract yeah, this is the only kind of thing I had in mind 10:04
some simple signal to say "please install in the parser in place of whatever may already be there"
ab5tract could be handy too if user space ever grows too wild with new conflicting operator definitions? 10:04
assuming that it is the case that the first definition to the parser gets the precedence for user defined operators well 10:06
ab5tract *as well 10:11
JJMerelo I was kicked off... 11:07
Altai-man_ go ahead, please. You have my email, right?
Altai-man_ JJMerelo, hm, not really. :( Can you PM it to me, please? 11:09
lizmat breaking news on CNN: hand-sanitizer and fireworks don't mix :-) 12:05
jnthn
.oO( But it'd make a great "will it blend" episode... )
12:10
lizmat :-) 12:11
jnthn The hand sanitizer at my local microbrewery smells like something tasty to drink. I don't plan to try, but...
El_Che jnthn: git push first 12:12
jjatria Is there a search URL that can be used with the Raku docs, as in to use with DuckDuckGo bangs (duckduckgo.com/newbang) or browser custom search thingies? 14:43
DuckDuckGo has `!perl` which uses the perldoc site
Altai-man_ jjatria, duckduckgo.com/newbang <- ? :) 14:45
jjatria Yeah, my message had that same URL. But that form wants a search URL 14:46
Does the Raku docs site have one that can be used for that sort of thing?
Altai-man_ ooh, I see what you mean. I don't think there is one. 14:47
jjatria It would be neat to be able to search with `!raku`
Altai-man_ Because website is static and there are all kinds of problems with search caused by that.
codesections Would it be against the spirit of duckduckgo bangs to have it redirect to duckduckgo.com/?q=site%3Adocs.raku.org ? (i.e., just a site search of the docs website) 14:57
that's what happens if you search for a term on the website that doesn't match an existing page
(well, a google site search, but still)
jjatria codesections: Ha! I guess it's worth a try. Bangs an always be updated later, if we ever get a proper search URL 15:11
codesections er, rather duckduckgo.com/?q=site%3Adocs.raku.org+ 15:17
jjatria Welp, submitted. Let's see what happens 15:55
codesections I'm attempting to get a Raku debugger set up, and could use a bit of help interpreting the error message I'm getting: 18:06
$ zef install --/test App::MoarVM::Debug
===> Searching for: App::MoarVM::Debug
===> Searching for missing dependencies: MoarVM::Remote
===> Searching for missing dependencies: Data::MessagePack
===> Fetching [FAIL]: Data::MessagePack:ver<0.1.2> from [email@hidden.address]
ck.git
Aborting due to fetch failure: Data::MessagePack:ver<0.1.2> (use --force-fetch to override)
(this is after following the directions in the README at github.com/edumentab/p6-app-moarvm-debug ) 18:07
lizmat timotimo ^^ 18:09
Xliff codesections: You may want to alert the maintainer for ata::MessagePack
*Data
codesections: In the meantime, you can install from git by hand. 18:10
codesections (As an aside, am I correct that App::MoarVM::Debug is the debugger I should be installing as a new user? I started from the docs page (docs.raku.org/programs/01-debugging), which referred me to github.com/jnthn/rakudo-debugger, but that page indicates (I think) that it's been deprecated in favor of MoarVM::Remote)
Xliff git clone [email@hidden.address] cd Perl6-Data-MessagePack; zef install . 18:11
codesections: Actually, you may want to look into Comma. commaide.com/
codesections Xliff, thanks. What is the error I'd be alerting the Data::MessagePack maintainer to? Is it a version mismatch? 18:12
Xliff Paste exactly what you get from zef 18:13
codesections The text I pasted was the full msg 18:14
Xliff Then paste everything from the "Fetching [FAIL]". If you wait a second, I might be able to get you a better message. 18:14
Ah. It's not a URL 18:15
He may be better served to use the following for source-url in META6.json: github.com/pierre-vigier/Perl6-Dat...gePack.git 18:16
codesections re: Comma – does it offer a standalone debugger or just a full IDE/editor? If it's the latter, is it worth switching? I'm pretty happy with my Emacs setup and feel some reluctance to switch to a non-FOSS editor. But I'd be willing to do so for compelling enough benefits 18:18
Altai-man_ codesections, full IDE/editor, no separation. But means for debugging are open, so you can look at something like github.com/edumentab/p6-app-moarvm-debug and integrate it into whatever or write your own frontend. 18:20
I think emacs folks would be truly thankful. :) 18:21
re fetching failure above: just clone it an zef install . 18:22
codesections > so you can look at something like github.com/edumentab/p6-app-moarvm-debug
right, that's what I started with (and the README I was following) :) 18:23
Altai-man_ is bad for not backlogging 18:23
codesections ha :) 18:25
> re fetching failure above: just clone it an `zef install .`
codesections yeah, that seems like the right solution. I'd like to understand the error msg, though 18:26
and insight into what it means/what the fetching error was based on this msg: 18:27
$ zef install --/test App::MoarVM::Debug
===> Searching for: App::MoarVM::Debug
===> Searching for missing dependencies: MoarVM::Remote
===> Searching for missing dependencies: Data::MessagePack
===> Fetching [FAIL]: Data::MessagePack:ver<0.1.2> from [email@hidden.address]
ck.git
Aborting due to fetch failure: Data::MessagePack:ver<0.1.2> (use --force-fetch to override)
(rerunning the install command with --debug is noisier but doesn't seem more helpful. If anyone would like to see that msg, I'm happy to post it but otherwise I'll hold off to avoid spamming the channel) 18:30
(er, more than I already am, anyway) 18:31
codesections Oh, I see. The url in the META6.json file incorrectly uses `git@github.com:` instead of `github.com`. Looks like Altai-man_ has had a PR out fixing that error since September, github.com/pierre-vigier/Perl6-Dat...ck/pull/17 18:46
timotimo i'm not sure why fetching messagepack would afil like that? 19:30
if you're able to fetch lots of things from github 19:31
codesections I think I figured out what the issue could be. If I `git clone` from the github.com/$URL address, I clone the repo. If I `git clone` from the [email@hidden.address] address, I'm *prompted to unlock my SSH key* and clone the repo 19:34
I'm guessing that zef can't handle that case?
timotimo d'oh 19:35
maybe
Xliff Auto-convert the [email@hidden.address] instances into https: ?? 19:38
vrurg_ Xliff: unless I oversee a hidden problem I like the idea. 19:43
[email@hidden.address] is a huge pain in the ...
codesections do y'all think it's worth opening an issue on the zef repo over this? I'm happy to do so, if that'd be helpful 19:50
timotimo hm, does the thing come from the meta json file or from the ecosystem meta list? 20:17
probably the former 20:18
an issue could be for tracking "what distros still have the wrong kind of url" in the ecosystem and/or an issue in zef for looking for a flag or env var you can pass to git to prevent a password unlock request or so 20:19
codesections The issue opened against Data::MessagePack (and the PR) suggested it came from Data::MessagePack's META6.json file (which did, indeed, have a git@ url) 20:19
cpan-raku New module released to CPAN! DBIish::Pool (1.0.1) by 03RBT 20:39
Xliff vrurg: I may just look into submitting a PR for zef. 21:08
codesections Update on the source-url issue discussed earlier: the zef issue I opened has been closed with the following comment: 22:31
It’s not up to zef to enforce ecosystem policy like what source-url is allowed. For all I know users have configured their own fetcher that actually uses that uri format. There is no blessed format, and any format can be made to work then rough configuration and code. And because there are many possible fetchers how could it possibly report “set your ssh key” when that plug-in cannot know a
later plug-in might actually understand that uri? Admittedly it’s possible but it’s a lot of work to fix a problem that stems from elsewhere.
It’s not up to zef to tell the user about errors the author made (wrong source-url) — that is for authoring tools or ecosystem prechecks. Zef will never tell you e.g. “hey your META6.json is wrong“ because it isn’t an authoring tool.
codesections (source: github.com/ugexe/zef/issues/359) 22:31
Xliff Hrm 22:33
codesections So, I guess the solution that leaves is updating docs.raku.org/language/modules to clearly state that distribution authors should use https URLs for the `source-url` field 22:34
Xliff codesections: Added a comment to your bug.