🦋 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. |
|||
00:03
Celelibi left
|
|||
sortiz | Or for a really simple one (a binding for POSIX crypt(3)) see github.com/jonathanstowe/Crypt-Lib...ibcrypt.pm | 00:03 | |
00:24
pecastro left
00:27
guifa2 joined
|
|||
guifa2 | What are some built-in routines that use +@foo slurpies in their signatures | 00:30 | |
notagoodidea | sortiz: thanks! | ||
sortiz | guifa2: +@foo is like **@foo, to avoid flattening iterables. | 00:39 | |
m: sub foo(*@a) { dd @a }, foo 1..3, 4..8; | |||
camelia | Array element = [1, 2, 3, 4, 5, 6, 7, 8] | ||
sortiz | m: sub bar(+@a) { dd @a }, bar 1..3, 4..8; | ||
camelia | Array element = [1..3, 4..8] | ||
sortiz | Used by built-ins when we want to preserve the structure of its inputs | 00:42 | |
00:49
notagoodidea left
|
|||
guifa2 | sortiz: I know what +@foo does, but I was trying to come up with some examples of builtins in that use it | 01:06 | |
all I can think of is for, but that's technically a control structure, not a routine | |||
01:17
Celelibi joined
01:21
xinming_ joined
|
|||
sortiz | guifa2. Sorry, misunderstood your question. In core, I found the built-ins 'cache' and 'reverse' as examples. | 01:23 | |
01:24
xinming left
01:29
Celelibi left
01:30
simcop2387 left,
no-n left
|
|||
guifa2 | sortiz++ the first couple ones that I looked up were all **@foo, so didn't have any good examples for the talk I'm finishing up | 01:31 | |
01:31
Celelibi joined
|
|||
sortiz | Glad to be of help | 01:34 | |
01:41
Celelibi left
01:43
lizmat joined
01:54
brtastic left
01:55
Kaeipi left
01:57
Kaeipi joined,
Kaeipi left
01:59
simcop2387 joined
02:01
Kaeipi joined
02:04
gnufr33dom joined
02:09
Kaeipi left
02:10
Kaeipi joined
02:11
Kaeipi left
02:18
Celelibi joined
02:30
rindolf joined
02:32
kvw_5_ joined
02:35
kvw_5 left
|
|||
elcaro | guifa2: I was looking for an old blog post the other day, as just happened to skim past an old p6weekly post mentioning the `+` sig with regards to the one-arg rule | 02:38 | |
p6weekly.wordpress.com/2015/09/28/...-birthday/ | |||
maybe it's interesting for you | |||
guifa2 | elcaro: yeah, I knew the history and all, just looking for some nice examples in the wild — the talk I'm doing starts with surprisingly intuitive stuff, and then transitions to how module devs can leverage them to make things Just Work™ for users | 02:40 | |
I could think of pretty good examples for everything else | |||
I still prefer my alcoholic description of the slurpies | 02:41 | ||
02:42
JRaspass left
|
|||
guifa2 | *@pour-first, **@chug-now, +@read-the-label | 02:43 | |
(see: tenesianu.blogspot.com/2019/06/per...ollar.html ) | |||
02:47
lucasb left
|
|||
elcaro | Nice... I'm in a conference call right now (supposed to be working, i guess) so i'll have a better read later | 02:48 | |
probably outside of the scope of your blog post, but regarding the first/rest thing, there's also unpacking sigs | 02:51 | ||
ie. `foo(*@all ($first, *@rest))`, or just `foo(*@ ($first, *@rest))` if you don't care about all | |||
guifa2 | Yeah, blog post is a year+ old now (it still calls it Perl 6 ha) | 03:02 | |
Do you know any modules offhand other than Cro that take advantage of foo { … } , where foo is actually a sub that functionally appears to be a control structure? | 03:03 | ||
elcaro | lizmat's `silently` comes to mind | 03:05 | |
guifa2 | oh perfect! | 03:07 | |
That's actually a brilliant example. it's almost the same as quietly (which is a control structure) | 03:09 | ||
elcaro | yeh, that's why I thought of it. | 03:15 | |
(that, and I used it recently, so it was fresh in my brain) | |||
03:15
brtastic joined
|
|||
guifa2 | I'm trying to avoid slang-y stuff, and show just how much vanilla Raku can do | 03:19 | |
But I think I feel comfortable enough with slangs I can write an article on creating one's own quoting structure, which I think would be super useful for some modules | 03:20 | ||
tony-o | slangs are rad | 03:29 | |
haskell slang brings all of hackage to raku | 03:30 | ||
03:41
sortiz left
|
|||
guifa2 | tony-o I was a bit overjoyed once I got a term slang working. Even with just using the basic QAST op 'call', you can do so much. Once RakuAST is around … mmmm | 03:44 | |
tony-o | is rakuast going to speed things up or is it just going to make doing something like code coverage easier/nicer? | 03:47 | |
i think two PTSes ago i did some hacky nqp thing where i was able to insert `got here` messages to figure out code coverage | 03:48 | ||
guifa2 | It's main purpose isn't speed, but my impression is that it can help workout certain optimizations better and result in it eventually. | 03:49 | |
IIRC from what lizmat was saying, one of the major reasons we ended up with it is jnhtn didn't like the idea of using EVAL for constructing code blocks ha | 03:50 | ||
But the long-running desire for macros no doubt helped out too | |||
tony-o | macro yo macros | 04:09 | |
sounds like it's going to be nice | 04:11 | ||
guifa2 | In my case, it's going to be awesome, because I've struggled to be able to adequately mimick regexen. I can do everything *but* interact with the other languages (Q, Regex, and, I dunno, what do we call Raku that's neither Q nor Regex?) | 04:13 | |
04:41
evalable6 left,
linkable6 left,
linkable6 joined,
evalable6 joined
05:02
colemanx joined
05:03
colemanx left
05:04
brtastic left
05:25
brtastic joined
05:34
guifa2 left
05:35
rindolf left
|
|||
notandinus | i have a list like this: <a b c d>, <e f g h*> | 05:37 | |
^ i want to remove * from h and note down it's co-ordinates | 05:38 | ||
removing * is easy with deepmap, how can i note down it's co ordinates? | |||
m: (<a h*>, <b c>).deepmap(*.comb[0]) | 05:39 | ||
camelia | ( no output ) | ||
notandinus | m: say (<a h*>, <b c>).deepmap(*.comb[0]) | ||
camelia | ((a h) (b c)) | ||
05:46
rindolf joined
|
|||
elcaro | notandinus: do you just need it to work on a list-of-lists? or does it need to work with arbitrary nesting of lists | 05:50 | |
notandinus | it's just list of lists, and 4x4 to be exact | 05:53 | |
i could do a nested for loop but i was wondering if there is a general solution | |||
elcaro: ^ | |||
moon-child | hmm, I have an apl solution but it doesn't translate to raku. (Missed opportunity, maybe :) | 05:57 | |
(there's a builtin that tells you the coordinates of 'true's in a multidim array) | 05:58 | ||
elcaro | nothing comes to mind. i would probably do a nested map with indices | 06:00 | |
m: my @a = <a b c d>, <e f g h*>; say (^4 X ^2).grep(-> ($y, $x) { @a[$x;$y].contains('*') }) | |||
camelia | ((3 1)) | ||
elcaro | need a `deepgrep` that you can use the `:k` adverb with :D | 06:01 | |
notandinus | i see | 06:02 | |
elcaro | moon-child: i've been dipping my toes into APL recently. makes me wish for an `Inline::APL` | ||
or a slang (similar to Slang::SQL) that you can just evaluate APL expressions in Raku code | 06:03 | ||
moon-child | that would be cool | 06:04 | |
a good start would just be implementing all the primitives as raku functions. Hyperoperators are neat, but nothing like a real rank operator | |||
elcaro | I have a been mucking around with doing basic APL stuff with Raku | 06:10 | |
just converting exampls from the learn dyalog book | |||
gist.github.com/0racle/b2b2514f8b9...fe1b333b17 | |||
very basic | |||
but would be interesting to implement APL in Raku... although I suspect it could benefit from more speed/development on Native Array | 06:11 | ||
that gist is just a few sample pieces of code from the start of the Mastering Dyalog APL pdf | 06:13 | ||
06:21
jmerelo joined
|
|||
notandinus | i have this array @visited and @puzzle | 06:29 | |
@puzzle = <a b>, <c d>; @visited = (True, False), ((Any), False) | 06:30 | ||
i want to print @puzzle but replace characters that have already been visited with * | 06:31 | ||
i could just use nested for, is there another way of doing this? | 06:32 | ||
i guess not because we need the indexes, right? | |||
06:35
wamba joined
|
|||
elcaro | yeah, you need to do like a deep zip. maybe you need to create a helper function that returns nested indices and implement functions you need around that | 06:40 | |
tbh, I haven't put a lot of thought into a better solution, so maybe someone else might come up with a more concise way. | 06:41 | ||
06:45
jmcgnh left
06:51
jmcgnh joined
|
|||
elcaro | notandinus: not the most elegant solution, but probably how I would handle it in a pinch: gist.github.com/0racle/72afb15114b...e8a7b8e121 | 07:04 | |
07:13
sjm_uk joined
07:17
ufobat joined
07:27
aluaces joined
07:29
ufobat_ joined
07:30
Sgeo left
07:31
Celelibi left,
kvw_5_ left,
xinming_ left,
kvw_5 joined
07:32
ufobat left
07:33
xinming_ joined
07:40
Celelibi joined
07:41
rindolf left
07:50
cxreg left
07:52
cxreg joined
08:02
Garbanzo_ left
08:05
domidumont joined
08:28
parabolize left
08:29
sena_kun joined
08:38
MasterDuke joined
08:47
dakkar joined
08:54
pecastro joined
09:01
JRaspass joined
09:07
tejr left
09:09
tejr joined
09:24
sena_kun left
09:26
aborazmeh joined,
aborazmeh left,
aborazmeh joined,
sena_kun joined
09:34
Scimon joined
|
|||
Scimon | Morning. | 09:34 | |
09:35
daxim left
09:37
Scimon left
09:38
Scimon joined
|
|||
timotimo | oh hej scimon | 09:42 | |
Scimon | I got a new laptop and it took me a while to get IRC setup. | 09:46 | |
timotimo | irc drivers notoriously difficult to get working right, especially on new hardware | 09:47 | |
09:47
codesections left
|
|||
Scimon | Mostly I just didn't think about it. 2020 you know, hard to get the brain in gear. | 09:47 | |
moon-child | timotimo: I hear the windows builtin ones work pretty well ootb | 09:48 | |
Scimon | I'm trying to get myself in a better place this year. | ||
As such I'm picking up a half finished module I was working on which led me to think of a question. I see there's work being done on fez do we have a preference for module upload location? | 09:49 | ||
timotimo | there's this incredible hack called "IRCDISWrapper" that runs ms comic chat in wine and autmates the UI to expose a line-based API | ||
Scimon | I'd need to run windows first ;) | 09:50 | |
Oh wait. Wine... Mmmmm | |||
But yeah. Are we moving away from CPAN? | 09:55 | ||
elcaro | Nothing has changed yet | 10:03 | |
see: twitter.com/jmaslak/status/1348741527363747840 | |||
Scimon | Coolio. | 10:04 | |
Thanks | |||
10:14
gnufr33dom left
10:27
aborazmeh left
10:41
MasterDuke left
10:48
aborazmeh joined,
aborazmeh left,
aborazmeh joined
11:00
notagoodidea joined
11:08
Black_Ribbon left
11:20
rindolf joined
11:26
stoned75 left
11:31
Altai-man joined
11:32
aborazmeh left
11:33
sena_kun left
11:40
PimDaniel joined
|
|||
PimDaniel | hi, c'est encore moi. | 11:40 | |
\o | |||
Is there a solution do declare an array of Int tuples? | 11:41 | ||
Or should we control it aftewards? | |||
lizmat | my Int @a ? | 11:43 | |
are the tuples of the same number of elements ? | |||
PimDaniel | Hi lizmat: i just need ((Int,Int),(Int,Int),(Int,Int),(Int,Int),...) | 11:44 | |
Each tuple is a coord (x,y) point. | |||
And they should be minimum 4. | 11:45 | ||
but can be more. | |||
But from the start, we do not know the coords so this is probably not possible. | 11:46 | ||
Scimon | When not make a Point class? | ||
PimDaniel | hum | ||
lizmat | class Point { has Int $.x, has Int $.y } | 11:47 | |
PimDaniel | why not : yes! | ||
Scimon | That should have been a why not when | ||
timotimo | use complex numbers and make a mathematician angry | ||
PimDaniel | Suis Null en math :(! | 11:48 | |
yes with a Class we can make any control we want!, i'll try this. | 11:49 | ||
Thank's for the idea. | |||
lizmat | m: class Point { has Int $.x, has Int $.y }; dd Point.new(x => 42, y => 666) | ||
camelia | Point.new(x => 42, y => 666) | ||
PimDaniel | Yes : we can see this in any school case curses or example. | 11:50 | |
lizmat | note that classes with accessors optimize better than arrays and indices | ||
PimDaniel | Heu not shure to understand : there's allready a Point class? | 11:51 | |
no no no. | 11:52 | ||
lizmat | no, but it is frequently used in examples :-) | ||
PimDaniel | Yes : easy to make it. | ||
thank's a lot : i must go now, back later... | 11:53 | ||
11:53
PimDaniel left
11:57
MilkmanDan left,
Manifest0 left,
agentzh left
11:58
spacebat2 left,
MilkmanDan joined,
Manifest0 joined,
agentzh joined,
klapperl joined,
jdv79 joined,
spacebat2 joined
|
|||
elcaro | ahh, I missed that convo. I have a Point module on the ecosystem. it's a Value Type and uses native nums internally, so fairly performant | 12:01 | |
12:01
JRaspass left
|
|||
Scimon | m: class Point { has Int $.x, has Int $.y; multi method COERCE( @l ) { return Point.new(x=>@l[0],y=>@l[1]) } };my Point() $p = (3,4);say $p | 12:01 | |
camelia | Point.new(x => 3, y => 4) | ||
12:02
nicholatian joined
|
|||
Scimon | :D I love the new Coercion stuff. | 12:02 | |
12:02
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
lizmat | Scimon++ | 12:03 | |
Scimon | I'd also love to be able to write (3,4).Point() but I guess that's a way off. | 12:04 | |
lizmat | I think you can? but vrurg_ would be able to quicly say how | ||
Scimon | Not directly you get a "No such method Point" error ATM. | 12:05 | |
elcaro | wouldn't that have to try calling .Point() on a list first before realising it's an unknown method, then check if a Point.COERCE is available in the callers namespace | ||
12:06
MasterDuke joined
|
|||
Scimon | I would guess so yes. | 12:06 | |
12:07
aborazmeh left
|
|||
elcaro | seems it would be _possible_ but maybe not worth the added ambiguity | 12:08 | |
[Coke] guesses he should not be surprised at all the APL love that pops up in here from time to time | 12:33 | ||
[Coke] did a POC for APL on parrot years like 12 years ago. | |||
[Coke] tries to figure out what github.com/coke/paraplegic/blob/master/t/jaah.t is doing. | 12:34 | ||
lizmat | feels like a rot13 ? | 12:35 | |
MasterDuke just heard [Coke] announce Slang::APL, wonder what the release date is... | |||
notandinus | is there something like fatpack for raku? | 12:36 | |
lizmat | not to my knowledge | ||
[Coke] | lizmat: ah, it's removing all the FX characters, reversing, and also splitting the string in the middle and putting it back together. | ||
12:37
stoned75 joined
|
|||
[Coke] | ... wow. so old I apparently wasn't doing a LICENSE every time. | 12:38 | |
MasterDuke: :P | 12:39 | ||
[Coke] briefly looks at the source, and wonders how this worked. I see ⌽ in the grammar, but not how it's actually doing anything in the actions. | 12:45 | ||
MasterDuke | github.com/coke/paraplegic/blob/ma...pm#L57-L67 ? | 12:47 | |
elcaro | [Coke]: seems the love flows both ways. came across an article on the aplwiki that has a Raku script for maintaining xkb settings | 12:48 | |
aplwiki.com/wiki/Typing_glyphs_on_Linux | |||
(or was it you that wrote it? :D) | |||
notandinus | ok so i wrote a script with some modules, how do i turn it into zef installable thing that can also be uploaded to cpan or fez (later) ? | 12:56 | |
github.com/andinus/octans | |||
^ it's this, do i just have to add META6.json thing? | |||
also, any comments on the structure or anything related to the project? | 12:57 | ||
wait, does github not syntax highlight .rakumod ? | |||
jmerelo | notandinus: not really. It's probably not caught up with those extensions yet. We did the PR IIRC, but it's not been deployed. | 12:58 | |
notandinus | syntax highlighted code: git.tilde.institute/andinus/octans | 12:59 | |
jmerelo: ah i see | |||
notagoodidea | notandinus: normally with the raku shebang, github will highlight the code. | ||
notandinus | oh do you also put shebang on modules? | ||
notagoodidea | not sure if it changes anything? But if it is just to provide hl on github, it may not be worth it knowing that hl will arrive one day or the other? | 13:01 | |
jmerelo | notandinus: not really. github uses several heuristics to know how to highlight and find out which language it is. One of them is the shebang line. | ||
[Coke] | jmerelo: hello | ||
notandinus | i see, thanks. i guess i'll wait for hl, i don't use it for viewing anyways | 13:03 | |
any comment on the module thing? | |||
i've read this docs.raku.org/language/modules#Dis...ng_modules | 13:04 | ||
i was wondering if i should place my modules under Octans:: directory (?) | 13:05 | ||
notagoodidea | I am still looking to the same thing but most the modules I see organize themself around bin/ lib/ where bin/ hold the cli part and lib/ have the lib/Foo/Bar.rakumod for Foo::Bar name. Not sure if it is the favored methods. like App::Octans => lib/App/Octans.rakumod. | 13:08 | |
But it is mainly from observation on how package are structured in the raku module space and it depends on the authors but the main ones seems to go around a similar structure (due to the Foo::Bar naming scheme?) | |||
13:09
JRaspass joined
|
|||
notandinus | i see, so i'll place octans.raku -> bin/octans and all other moduels in lib/Octans/ | 13:10 | |
notagoodidea | it seems like the most common structure I have seen but newbie and so. | ||
notandinus | i see, it's fine the structure can be changed anytime | 13:11 | |
13:12
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
notandinus | hmm docs.raku.org/language/modules#Upl..._ecosystem | 13:15 | |
^ has instructions to upload to fez, can i already upload there? | |||
[Coke] | (APL) ah, all the magic is in tools/, weird. :) | 13:16 | |
Scimon | Well it's been over a year but I've picked up my Pure Raku Markdown module again and done some tidying up. Got over 50% spec tests passing now. | 13:17 | |
13:18
finsternis left
|
|||
notandinus | hmm fez install fails with: (tried git and tar), please ensure one is in your path | 13:27 | |
i have both git and tar in $PATH | |||
notagoodidea | notandinus: I discovered App::Mi6 (modules.raku.org/dist/App::Mi6) | 13:56 | |
Scimon | It's v. good. | 13:57 | |
notandinus | notagoodidea: i see, i'm looking at that and another authoring tool | 13:58 | |
i'm still finalising the repository before uploading | |||
notagoodidea | not sure how to play with fez as it seems to release to CPAN. | 14:01 | |
notandinus: Your feedback about those interests me! | 14:02 | ||
Scimon | Mi6 release to Cpan. fez releases to the new under development Raku ecosystem. As I understand it. | 14:06 | |
14:07
aborazmeh left
|
|||
notandinus | notagoodidea: i think fez is not ready yet, it'll be the new raku ecosystem | 14:10 | |
after fez is done, p6c will be phased out | 14:11 | ||
i'm going to upload my project to cpan for now | |||
14:13
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
notandinus | btw en.wikipedia.org/wiki/Moby_Project 's dictionary is in public domain, it has lots of words (~0.35 mil) | 14:14 | |
14:21
vrurg_ is now known as vrurg
14:29
Kaeipi joined
|
|||
notagoodidea | ok, my C game is quite low but `typedef struct Foobar *Barfoo;` is a way to make the pointer opaque. using NativeCall, `class Barfoo is repr("Cpointer") {}` is the goodway to create the binding? | 14:32 | |
14:38
lucasb joined
|
|||
notagoodidea | m: say (0x1 | 0x2); say (0x1 +| 0x2); | 14:44 | |
camelia | any(1, 2) 3 |
||
notandinus | hmm very weird, %?RESOURCES is set to Nil even when i include the files in META6.json | 14:49 | |
MasterDuke | notandinus: running locally (i.e., from the top-level module directory)? might need a `-I .` | 14:51 | |
notandinus | MasterDuke: i installed it with zef | ||
i'm trying to access it from bin/octans | |||
hmm it does print something when i try to acess it from a module inlib/ | 14:52 | ||
am i not supposed to access it from bin/ ? | |||
hmm, it's working correctly when i acess it from lib/ | 14:54 | ||
but i need to use it in bin/, the main program | |||
MasterDuke | not sure then, i've never created a module with a bin/ | 14:55 | |
notagoodidea | zef seems to install the bin/ in $HOME/.raku/bin | ||
notandinus | it's a program, am i doing it wrong? i've put the modules in lib/Octans/* and the program octans in bin/octans | 14:56 | |
in my case zef put it here: /home/andinus/star/share/perl6/site/bin/octans | 14:57 | ||
looking at github.com/tony-o/raku-fez | 15:00 | ||
dakkar | is that your program, or a launcher script? (a call to `CompUnit::RepositoryRegistry.run-script`)? | 15:01 | |
15:01
MasterDuke left
|
|||
notandinus | they've put everything in Fez::CLI and just write `use Fez::CLI' in bin/fez | 15:01 | |
dakkar: it's my program | |||
i've put the sub MAIN in bin/octans | |||
and i need %?RESOURCES in sub MAIN | |||
dakkar | ok, if you run it directly, rakudo can't know what distribution it belongs to, so $?RESOURCES can't work | 15:02 | |
zef should have written another `octans` script, probably in star/bin/ | |||
15:02
Sgeo joined
|
|||
dakkar | (it'd be in ~/.raku/bin/ for me, but I'm not using star) | 15:02 | |
15:04
daxim joined
|
|||
dakkar | actually… I have ~/.raku/bin/zef, and the program itself is in ~/.raku/resources/D5A6DAB7FF5EFBDDBE82A4D69694601F07F66C52 | 15:04 | |
vrurg | Actually, I might be mistaken, but a script can't know where to take resources from. It's a privilege of a module. | ||
notandinus | dakkar: i ran find .| ag octans in ~/star and it only has it in ./share/perl6/site/bin/octans | ||
dakkar | vrurg: that's also possible, but if so, the documentation needs patching | ||
hmm, I could test it | |||
notandinus | i see, so should i turn it in a module and call `use Octans::CLI' like fez is doing? | 15:05 | |
vrurg | notagoodidea: It's always a good idea | ||
vrurg minimizes script size whenever possible. | |||
It's also a matter of well-organized code. | 15:06 | ||
notandinus | ok i just had to move the whole script to Octans::CLI and add `use Octans::CLI' in bin/octans, it works fine now | 15:10 | |
thanks | |||
dakkar | yep, just confirmed | 15:12 | |
so either docs.raku.org/language/variables#%?RESOURCES or the implementation, is wrong | 15:13 | ||
15:13
MasterDuke joined
|
|||
notandinus | i see, are you filing a report? | 15:14 | |
dakkar | yeah | 15:15 | |
against rakudo, because I'd like it to work as the documentation says ☺ | |||
notandinus | it does say "Distribution of the current compilation unit", only modules are part of the compunit right? | ||
dakkar | no | ||
programs are compiled | |||
notandinus | oh i see, | ||
dakkar | `CompUnit::RepositoryRegistry.run-script` exists, so scripts are in the repository of compilation units… | 15:16 | |
which strongly implies they are compilation units | |||
notandinus | i see | ||
so after this is fixed there would be no need to put programs in lib/X/CLI right? | |||
dakkar | the fact they're not (currently) getting *pre* compiled shouldn't matter | ||
it would still be a good idea (for testability, at least) | 15:17 | ||
notandinus | i see, will bin/ things also get precompiled later on? | ||
dakkar | that's my understanding | ||
notandinus | oh i see, to test the output of the CLI.rakumod thing? | ||
makes sense | |||
15:21
wamba left
15:26
Altai-man left,
gnufr33dom joined
|
|||
dakkar | github.com/rakudo/rakudo/issues/4173 | 15:31 | |
notandinus | github.com/tony-o/raku-fez/blob/master/bin/fez is not calling MAIN on Fez::CLI, how does it work then? | 15:35 | |
Fez::CLI is defining the MAIN sub but theres nothing that is calling it | 15:36 | ||
i moved my things in sub MAIN but it doesn't work | |||
MasterDuke | the MAINs are exported, so `use`ing it should make them available (and then called) when run from the command line. did you export your sub MAIN? | 15:38 | |
notandinus | i see, no mine wasn't exported | 15:39 | |
thanks, works after exporting | |||
15:40
wamba joined
|
|||
[Coke] | MasterDuke: I figure you were probably kidding... but do we need a slang? or just all the APL operators? | 15:46 | |
(I see no modules in the ecosystem for APL yet) | 15:47 | ||
notagoodidea | With NativeCall, is it possible to assign size to Carray as in `struct { int data[3] }` -> `class foo ... { has CArray[int32] $.data }`. Not sure how to give the size of the created array. | ||
15:49
jess left
|
|||
MasterDuke | [Coke]: that was just kidding, i've never used APL so don't really know. but what about Inline::APL? (or all three: Slang::APL, Inline::APL, and all the operators! the more the merrier) | 15:50 | |
15:50
clarkema joined
|
|||
[Coke] | inline would be calling out to existing apl; slang would be if there's extra syntax... I think APL::Operators would be fine to start. | 15:51 | |
... should be trivial to create an APL::Operators based on the test suite from the old parrot project. | |||
I'll start there. | |||
15:53
[Sno] joined
15:55
sno left
16:01
[Sno] left
16:04
parabolize joined
|
|||
tony-o | notagoodidea: docs.raku.org/language/nativecall#Structs | 16:08 | |
doesn't appear you'd need to | |||
unless you're initializing it, then you need to use the CArray[int32].allocate(3) | 16:10 | ||
notagoodidea | tony-o: No I don't initialize it, but I would have to be sure that only 3 elements are provided/initialized on the Raku side of the call before giving it to C. or at least that is how I understand it. | 16:12 | |
tony-o | ah, try it with that class+TWEAK example in the link ^ | 16:13 | |
notagoodidea | Yep, seen that, thanks! | 16:14 | |
dakkar | ooh, wait, an int[3] inside a struct is not a carray, is it? | ||
a carray is a pointer | 16:15 | ||
that struct contains the three ints, not a pointer to ints | |||
16:15
dataangel left
|
|||
notagoodidea | dakkar: hu? | 16:16 | |
16:16
dataangel joined
|
|||
dakkar | AIUI, a CArray is passed to C as a pointer | 16:16 | |
notagoodidea | So you do : `class .. { has int32 $.data1, etc. }` or `class ... { has Pointer $.data1, etc.}`. | 16:18 | |
dakkar | but your `struct { int data[3] }` contains the integers directly (you wouldn't malloc that data, would you?) | ||
definitely not pointer | |||
notagoodidea | As said early my C game is meh to low, so still learning my pain point when I meet them :) I am all ear. | 16:19 | |
dakkar | I'm really not the best person for this, as my C is pretty rusty and my understanding of NativeCall is limited | ||
I'd start with `has int32 $.data0; has int32 $.data1; has int32 $.data2` | 16:21 | ||
at least that should match the memory layout | |||
then you may want to remove the public accessors for those, and provide more sensible ones (and a TWEAK) | |||
tony-o | in c that can work both ways | 16:27 | |
in this case - int x[3] ==> x[2] is the same as (x+2) | |||
dakkar | yes, because foo.data has nominally type int* | 16:28 | |
tony-o | for NC more just a question of you want to access it | ||
dakkar | but that pointer is not stored in memory, it's the compiler cheating | ||
and for NC it matters very much what is actually in memory | |||
if you try to interpret a random int as a pointer, you're going to have a bad day | 16:29 | ||
16:31
Celelibi left
|
|||
tony-o | yes that's true | 16:32 | |
notandinus | i uploaded my module to pause under Perl6, how much time does it take to reflect in modules.raku.org ? | ||
[Coke] | (APL) so, one operator that won't work: prefix:<|>, which conflicts with flattening. | 16:34 | |
16:41
PimDaniel joined
|
|||
PimDaniel | I think the documentation is too tricky for newbies. | 16:42 | |
16:43
mowcat joined
|
|||
dakkar | [Coke]: use ❘ instead 😁 | 16:43 | |
PimDaniel: learning from a reference is, indeed, difficult | |||
PimDaniel | If i want to put a sub into a say Misc module out of class : i cannot see a simple example nor explanation to do it a simple way. | 16:44 | |
A simple example with an export would help. | |||
dakkar | `package Misc { sub foo() is export { return 3 } }`? | 16:45 | |
`module Misc { sub foo() is export { return 3 } }`? | |||
sorry | |||
docs.raku.org/type/Routine#trait_is_export | |||
16:46
mowotter joined
|
|||
dakkar | PimDaniel: was that what you were after? | 16:46 | |
PimDaniel | Yes thanks : but easy because you know where to search! When i search i found a lot of complicated things that lost me. | 16:47 | |
Thank's a lot : but i pass hours searching and finaly forget what i searched! | |||
dakkar | yep, docs.raku.org is a reference, meaning it's for people who already know *some* of what they're looking for | 16:48 | |
it's not a good resource to learn from scratch | |||
16:48
JRaspass left,
stoned75 left
|
|||
PimDaniel | so, is ther a good ressource to learn from scratch? | 16:48 | |
i come from Perl5 but not sure it helps. | 16:49 | ||
16:49
mowcat left
|
|||
dakkar | it helps quite a bit ☺ | 16:49 | |
raku.org/resources/ this links to books and things "for newcomers" | |||
[Coke] | dakkar: my goal is to use whatever the original APL operators are. | 16:50 | |
MasterDuke: gist.github.com/coke/94d976b93b5bd...295654bc86 | |||
(those all pass with a verrrrry small module) | |||
dakkar | [Coke]: ⌶ U+2336 APL FUNCTIONAL SYMBOL I-BEAM maybe? /me is guessing | 16:51 | |
PimDaniel | I already red a curse for newbie level in French but it's quickly insufisant when you pass the school cases examples. | 16:52 | |
dakkar | (U+2336 to U+2395 are all APL operators) | ||
16:52
[Sno] joined
|
|||
dakkar | PimDaniel: ah yes, that's the common issue with programming: the tutorials are too simple, the reference is too advanced | 16:52 | |
PimDaniel | dakkar: thank's for your link! | 16:53 | |
perry | And to learn how to read reference manuals you need to read reference manuals :P | ||
MasterDuke | [Coke]: cool | ||
dakkar | in ~60 years, I feel the only solution we've come up with is "keep writing documentation, tutorials, &c &c, eventually something useful will come out" | ||
PimDaniel | I need to precise that i'm french too. I can read english and spanish. I understand German a few and no more. But my be a good curse exists in Spanish. | 16:55 | |
notagoodidea | PimDaniel: Andrew Shitov have a few books on Raku/Perl6 that are nice and a new course coming up at course.raku.org/essentials/ | ||
PimDaniel | notagoodidea: Thank's! | 16:56 | |
notagoodidea | but the Part2/3 are not yet published. | ||
16:57
gnufr33dom left
|
|||
MasterDuke | aren't there translations of the docs available somewhere? | 16:57 | |
PimDaniel | The French one i have IS a translation. | ||
It was very helpfull for starting and i still look at it sometimes. | 16:58 | ||
notandinus | my first raku module: modules.raku.org/dist/octans:cpan:ANDINUS | 16:59 | |
notagoodidea | notandinus: congrats! | 17:01 | |
notandinus | thanks :) i had this pause account for so long, i made it while learning perl but never got around uploading any of my perl stuff. | 17:03 | |
PimDaniel | I used unit module Misc; instead of a block, I tried a multi but it complains about Missing block | 17:07 | |
The multis where tested appart and work! | |||
17:12
notagoodidea left
17:19
Scimon left
17:26
guifa2 joined
|
|||
guifa2 | Is there any way to specify endianness when working with >8bit blobs? (the read/write functions on 8bit blobs let you specify it, but >8bits don't have it for, e.g., writing out a file) | 17:28 | |
tony-o | docs.raku.org/routine/encoding#utf...nd_utf16be | 17:30 | |
17:30
Celelibi joined
|
|||
dakkar | what's UTF got to do with blobs? | 17:31 | |
tony-o | that seems to indicate there's a BOM specifier somewhere | ||
dakkar | a BOM is a thing in a file | 17:32 | |
blobs are in-memory things | |||
guifa2: I get the feeling that blob16 &c are not designed to be serialised | |||
guifa2 | Dakkar: yeah, which is kind of a shame, because they do make working with some things easier | 17:33 | |
tony-o | oop, misread that as buf | ||
dakkar | buf are also in-memory things | ||
tony-o | i didn't say they weren't | 17:34 | |
dakkar | guifa2: I think you'll have to write your own read/write subs | ||
tony-o: UTF is for text, blob/buf are a bit more general ☺ | |||
guifa2 | I think a quick wrapper class will be best | 17:35 | |
tony-o | i'm aware | ||
dakkar disconnects, end of the workday | 17:37 | ||
17:38
thdrmz left
17:42
dakkar left
17:43
Garbanzo_ joined
17:50
natrys joined,
stoned75 joined
|
|||
[Coke] was looking at some APL, saw ⎕ and was thinking he was missing a character in his font. | 18:04 | ||
(APL) so the operators are really trivial but I think anything interesting would have to be an APL slang. | 18:05 | ||
(once you start getting into variable assignment, etc.) Anyone have a pointer to an APL test suite? | 18:07 | ||
18:14
Garbanzo_ left
18:17
monkey_ joined
18:31
Garbanzo_ joined
18:50
jmerelo left
18:54
aborazmeh left
18:55
aborazmeh joined,
aborazmeh left,
aborazmeh joined
19:03
Kaeipi left
19:05
Kaeipi joined
19:06
xelxebar left
19:09
Garbanzo_ left,
xelxebar joined
|
|||
PimDaniel | back again! | 19:21 | |
after a walk throught the woods with friends! | |||
I could do my Misc module! It was just that i'v put "is export" between the name of the sub the 1st ( : thought it was like for Classes but no. | 19:26 | ||
19:28
sortiz joined
19:29
MasterDuke left
|
|||
[Coke] | sub x() is export { ...} | 19:35 | |
19:42
sjm_uk left
19:47
berber44 joined
|
|||
PimDaniel | Coke: Yess! Thanks! | 19:48 | |
19:48
Kaeipi left
|
|||
PimDaniel | unit module Coke; sub flour is export { ... } | 19:49 | |
:) | |||
19:50
Kaeipi joined
|
|||
PimDaniel | no sub flour() is export { ... } | 19:50 | |
sortiz | ping guifa2 | ||
19:50
Kaeipi left
19:51
Kaeipi joined
|
|||
PimDaniel | is new a particular method? | 19:52 | |
or does it behave like any other? | |||
guifa2 | sortiz o/ | ||
lizmat | classes inherit from Any, and "new" is a method provided to each class that way | ||
so it is just like any other method, just provided to you by default | 19:53 | ||
and like any method, can be overridden if you should decide to want to do that | |||
PimDaniel | the best is to tell what i wanna do: | 19:54 | |
sortiz | guifa2, All Blobs supports reads with the selected endiannes. | ||
Just use one of the Endian enum | |||
The default is NativeEndian | 19:55 | ||
PimDaniel | What does really do bless? | ||
sortiz | PimDaniel, bless "creates" the object. | ||
guifa2 | PimDaniel: bless actually instantiates the object | ||
PimDaniel | and when a class has no new? | 19:56 | |
no new method and no bless too? | |||
lizmat | it inherits them | ||
m: class Foo { }; dd Foo.new | |||
camelia | Foo.new | ||
19:57
Kaeipi left
|
|||
stoned75 | docs.raku.org/language/objects#ind...w_(method) | 19:57 | |
PimDaniel | how can i call new called with named and positional parameters? Should i make a multi? | 19:58 | |
19:59
Kaiepi joined
|
|||
PimDaniel | my $pt = Point.new(x => 39,y => 68); and my $pt = Point.new(39,68); | 20:00 | |
guifa2 | yeah, just make it a multi | ||
stoned75 | at the URL previously mentioned you could read 'If you want a constructor that accepts positional arguments, you must write your own new method' | ||
guifa2 | class Point { multi method new ($x, $y) { self.bless: :$x, :$y }; multi method new (:$x is required, :$y is required) { self.bless: :$x, :$y } }; say Point.new(x => 39,y => 68); say Point.new(39,68) | 20:01 | |
evalable6 | Point.new Point.new |
||
PimDaniel | guifa2: i think it's quite what i was about to write, thank's! | 20:03 | |
self.bless(:$x,:$y) instead. | 20:04 | ||
according to other examples i saw. | |||
20:06
berber44 left
|
|||
PimDaniel | IT WORKS!!!! | 20:07 | |
is fact i added multi but i forgotted method multi method , pfff! | |||
it's a sub or a method or something else... | 20:08 | ||
Is Comma ide efficient? | 20:11 | ||
lizmat | efficient enough that the developers work with it themselves when working for clients ? | ||
*developers of Comma | |||
PimDaniel | I just discover that it exists. | 20:13 | |
is it written in raku? | 20:14 | ||
moritz | no | 20:15 | |
tony-o | it's written in uncommon lisp | ||
moritz | it's part of the JetBrains IDE framework, which is java, iirc | ||
20:16
domidumont left
|
|||
lizmat | but some parts of it are definitely Raku.... it uses all of the introspection features of Raku, e.g. and you can't do that from Java afaik | 20:16 | |
PimDaniel | Well, bon i would not mind pay 12 Euros but i'm affraid they ask me more later. | ||
The commynity edition to try may be. | 20:17 | ||
lizmat | well, they is Edument CZ, of which the CEO is Jonathan Worthington :-) | ||
PimDaniel | Ok i understand! No problem! | 20:20 | |
I suppose all this is a lot of work, of course! | 20:21 | ||
20:27
b2gills1 left,
Kaiepi left
20:31
Kaiepi joined,
Kaiepi left
|
|||
PimDaniel | back later , need to rest... bye! | 20:32 | |
20:32
PimDaniel left
20:36
ufobat_ left
|
|||
[Coke] | lizmat: I think not quite CEO, but he's on the website, anyway. :) | 20:39 | |
(top row! :) | |||
lizmat | of the Edument CZ branch, I'm pretty sure he is | ||
20:44
brtastic left
|
|||
sortiz | m: my @b32 is Blob[int32] = 1,2,3,4; dd @b32; @b32.read-int32(0, BigEndian).say; | 20:44 | |
camelia | Blob[int32].new(1,2,3,4) 16777216 |
||
sortiz | m: my @b32 is Blob[int32] = 1,2,3,4; @b32.read-int32(1) # Bug? | 20:45 | |
camelia | MVMArray: read_buf out of bounds offset 1 start 0 elems 4 count 4 in block <unit> at <tmp> line 1 |
||
lizmat | that feels like a bug at first sight | 20:47 | |
afk& | 20:48 | ||
20:48
monkey_ left
20:49
lichtkind joined
|
|||
sortiz | m: my @b32 is Blob[int32] = 1,2,3,4; @b32.read-int16(1).say # Works | 20:50 | |
camelia | 2 | ||
sortiz | m: my @b32 is Blob[int32] = 1,2,3,4; @b32.read-int16(1, BigEndian).say # Works | ||
camelia | 512 | ||
sortiz | m: my @b32 is Blob[int32] = 1,2,3,4; @b32.read-int16(3).say | 20:52 | |
camelia | MVMArray: read_buf out of bounds offset 3 start 0 elems 4 count 2 in block <unit> at <tmp> line 1 |
||
sortiz | m: my @b32 is Blob[int32] = 1,2,3,4; @b32.read-int16(2).say | ||
camelia | 3 | ||
sortiz | Indeed a bug. | 20:53 | |
20:56
aborazmeh left
|
|||
[Coke] | lizmat: ah, website sez: COUNTRY MANAGER CZ, so there we go! | 21:17 | |
21:26
wamba left
21:32
Garbanzo_ joined
21:38
b2gills joined
|
|||
[Coke] | gist.github.com/coke/7a01ffb4085c0...ceea4158d9 - when I use zef to install App::Uni, I get this wrapper script - when I run the script, it gives me the full path in $*PROGRAM-NAME - but if I have a simple script, it does not. | 21:56 | |
I want the usage message to be "as invoked", not the full path (that I did not use) | |||
kawaii | What do *@ and *% denote in sub signatures? Just 'some array' and 'some hash'? | 21:57 | |
[Coke] | "slurpy array" (all the remaining positional, all the remaining hash) | 21:58 | |
s/hash/named/ | |||
kawaii | Ah so they're both anonymous _and_ slurpy | 21:59 | |
22:10
natrys left
22:15
rindolf left
22:17
kaiwulf joined
|
|||
kaiwulf | I'm new to raku. I like perl so I figure I should get in to raku too. | 22:18 | |
El_Che | kaiwulf: welcome! | 22:21 | |
kaiwulf | Thanks! | 22:23 | |
22:26
Black_Ribbon joined
22:55
notagoodidea joined
|
|||
notagoodidea | 22:55 | ||
22:58
lucasb left
23:19
telex left
23:20
telex joined
23:27
epony left
23:28
lichtkind left,
notagoodidea left
23:43
JRaspass joined
23:47
clarkema left
23:55
moon-child left
|