🦋 Welcome to the MAIN() IRC channel of the Raku Programming Language (raku.org). This channel is logged for the purpose of keeping a history about its development | evalbot usage: 'm: say 3;' or /msg camelia m: ... | Log inspection is getting closer to beta. If you're a beginner, you can also check out the #raku-beginner channel!
Set by lizmat on 25 August 2021.
Curiosa Parsing asm with raku should be straightforward, What is really difficult is to make an opcode table 00:12
Since x64 is really a mess
moon-child yes, it is 00:17
I spend around 1.2k lines of code in my implementation, and I still don't do some stuff 00:18
(no avx512, mmx, or x87)
Curiosa Wow, congrats! 00:19
moon-child and that's not counting the instruction tables themselves, which are a similar size, nor the label logic
Curiosa Are you open sourcing it?
moon-child once it is complete enough to be useful to somebody 00:20
Curiosa You could leave something like avx512 out , if anyone will need they will provide
moon-child my goal is to provide a complete representation of x86 machine code, providing all potentially useful interpretations of all byte sequences 00:21
(i.e. disassembler is the interesting part, but still have to represent all the same things) 00:22
if you just want an assembler, those are a dime a dozen
Curiosa I think Rakudo still misses a native assembler 00:25
Curiosa One could write a c compiler once he has an assembler 00:27
moon-child my assembler is not written in raku. So it is a moot point
if you want to write a c compiler, I suggest emitting textual assembly and targeting gas or nasm
making a native assembler is an interesting and worthwhile project, but it is certainly not necessary
Curiosa Nothing is necessary in modern computing 00:31
moon-child sure. I think that's a bit of a reductionist argument though. Gcc still pipes to gas 00:32
Curiosa I think that in terms of interoperability with C, C++ got it right. 00:34
And everyone else (a part Objective C) wrong
Sauf the language that are written in C 00:35
And Raku is not one of them
moon-child sure. You imply that interoperability in c is more important than other language characteristics. I do not agree with that
if you want to use c++, use c++
Curiosa No, I imply that Raku doesn’t express its potentia 00:36
Because of the fact that it’s written in Raku and doesn’t compile c 00:37
Imagine having to rewrite everything in Raku, and then having to follow every single new version and development happening in C only to keep being compatible 00:39
That’s what languages as D, Rust, Go, do it 00:40
In Perl, python you just need to recompile
There are other flaws in Raku, such as the reinvented wheels to parallel compilation 00:41
Make files are a thing from quite long 00:42
By the way, artificial intelligence will eventually be able to solve the halting problem in like 99.999% of software, and there will be no more intelligible programming languages 00:45
Esoren o_O 00:46
Curiosa moon-child said complete representation of x86 machine code 00:47
Seems like Turing proved this impossible 00:48
But ai gurus will solve this statistically I’m sure about that
moon-child I exclude the possibility of runtime code generation
otherwise it is possible
Xliff \ 01:04
\o
What's the best way to get the method OBJECT of a method? 01:05
class a { method AA { } }; A.^lookup('AA').gist.say
m: class a { method AA { } }; A.^lookup('AA').gist.say
camelia ===SORRY!=== Error while compiling <tmp>
Undeclared name:
A used at line 1. Did you mean 'a'?
Xliff m: class a { method AA { } }; a.^lookup('AA').gist.say
camelia AA
Xliff ^ Like the above, but without the .^lookup
class a { method AA { } }; a.AA.METHOD.gist.say 01:06
evalable6 Nil
Xliff class a { method AA { } }; a.AA.^name.say
evalable6 Nil
Xliff class a { method AA { } }; a.AA.^name.say # a.AA is still a METHOD CALL
evalable6 Nil
Xliff Was hoping it would work like lexical vars....
mmy $a = 01:07
m: my $a = 0; $a.VAR.name.say
camelia $a
Esoren I don't know much beyond what I've read in the docs, but I have read this:  docs.raku.org/language/packages#Cl...ber_lookup 01:18
Xliff Yes, but that uses .^lookup, which is what I want to avoid. 01:19
Esoren No other way is suggested 01:20
Xliff Yes. I was hoping that was no longer true. :)
guifa Xliff: you have to use HOW methods to get methods 01:52
Xliff Well, piffule. .^lookup is expensive. It shouldn't be expensive to lookup methods. 01:55
guifa perhaps find_method is a bit faster, I haven't measured, and I've never been super clear on which stuff is Raku and which is Rakudo specific for that stuff 01:56
Xliff class a { method AA { } }; a.^lookup( 02:22
class a { method AA { } }; a.^lookup('AA') for 10000; say now - INIT now; a.^find_method('aa'); say now - INIT.now 02:23
m: class a { method AA { } }; a.^lookup('AA') for 10000; say now - INIT now; a.^find_method('aa'); say now - INIT.now
camelia ===SORRY!=== Error while compiling <tmp>
Whitespace required after keyword 'INIT'
at <tmp>:1
------> ow; a.^find_method('aa'); say now - INIT⏏.now
Xliff m: class a { method AA { } }; a.^lookup('AA') for 10000; say now - INIT now; a.^find_method('aa'); say now - INIT now
camelia 0.00070379
0.003005477
Xliff So... ^lookup is faster. 02:30
japhb Xliff: Several problems there: 1. You're using `INIT now` as your start time and then doing two different measurements, 2. You're measuring times short enough that background interrupts or other task switches can affect the results, 3. Always looking up the same method means you're measuring the efficiency of caching that method, 4. You're doing sufficiently different numbers of iterations that you're 02:48
measuring steady state in one case, and first-run performance in the other.
Geth ecosystem/alabamenhu-patch-2: 4c0223b885 | L'Alabameñu++ (committed using GitHub Web editor) | META.list
Update META.list

Add new Timezones::ZoneInfo module to ecosystem (required for new DateTime::Timezones module)
07:52
ecosystem: alabamenhu++ created pull request #602:
Update META.list
guifa lizmat ^^ took a few more hours but it's finally there (yay for writing good test files, found some odd time zone names that I hadn't anticipated handling differently). Now on to learning RakuAST ^^ 07:56
^_^ I meant
Geth ecosystem: 4c0223b885 | L'Alabameñu++ (committed using GitHub Web editor) | META.list
Update META.list

Add new Timezones::ZoneInfo module to ecosystem (required for new DateTime::Timezones module)
08:18
ecosystem: 368c15e54e | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | META.list
Merge pull request #602 from Raku/alabamenhu-patch-2

Update META.list
Xliff Has anyone looked at Advent #24? 11:48
It begs for RakuAST. Until then, is there a writeup for the current QAST setup? How would run execute a QAST tree? 11:49
MasterDuke Xliff: github.com/Raku/nqp/blob/master/do...t.markdown 13:49
Xliff MasterDuke: replit.com/@Xliff/advcent-24-2021#main.raku 14:43
guifa Xliff have you started working with RakuAST yet? 16:21
Also… does anyone know how to throw a custom warning? I can't quite seem to get it right 16:23
m: class Foo is CX::Warn { ; }; warn Foo; CONTROL { when Foo { say "captured foo" } default { say "got a ", .WHAT.say } } 16:24
camelia ===SORRY!=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> ONTROL { when Foo { say "captured foo" }⏏ default { say "got a ", .WHAT.say } }
Anton Antonov @guifa Meaning, not just using `warn` or `note`?
guifa m: class Foo is CX::Warn { ; }; warn Foo; CONTROL { when Foo { say "captured foo" }; default { say "got a ", .WHAT.say } }
camelia (Warn)
got a True
guifa m: class Foo is CX::Warn { ; }; Foo.new.throw; CONTROL { when Foo { say "captured foo" } default { say "didn't capture" } } 16:26
camelia ===SORRY!=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> ONTROL { when Foo { say "captured foo" }⏏ default { say "didn't capture" } }
guifa m: class Foo is CX::Warn { ; }; Foo.new.throw; CONTROL { when Foo { say "captured foo" }; default { say "didn't capture" } }
camelia captured foo
guifa ^^ that one works BUT
m: class Foo is CX::Warn { ; }; Foo.new.throw;
camelia control exception without handler
in block <unit> at <tmp> line 1
guifa ^^ this ends up dying because there's no CONTROL, but that's not how a normal warn works
gfldex guifa: costum control exceptions are not well supported by Rakudo. 17:20
see: github.com/rakudo/rakudo/issues/4227 17:23
thundergnat Anton Antonov: rosettacode.org/wiki/Finite_state_machine#Raku was contributed / written by rosettacode user smls. I do not know his IRL name and wouldn't dox him if I did. 19:59
He does have a github repository under the same user name, but it hasn't been active for some time. 20:02
In general all code on Rosetta code is under the GNU Free Documentation License. Refer to rosettacode.org/wiki/Rosetta_Code:Copyrights for specific guidance. 20:03
I have written a lot of Raku entries for Rosettacode (probably around 600-800) but that specific one was not by me. 20:04
gfldex thundergnat: that is no reason not to blaim you :-> 21:06
smls hasn't been around for quite some time
thundergnat Well, you'll just have to get in line... :-)
gfldex @Anton Antonov#7232 you can find smls' e-mail (and may others) in github.com/rakudo/rakudo/blob/master/CREDITS 21:10
gfldex That file is basically The Public Phone Book For Awesome Individuals. 21:11
[Coke] .seen smls 22:26
tellable6 [Coke], I saw smls 2018-07-01T15:48:02Z in #perl6: <smls> lizmat: Heh, good point.
[Coke] it's been a while, aye.
guifa whoa, Comma IDE now shows like a little icon for projects based off of the first capital letter or two. Is there anyway to customize that? 22:48
guifa whoa, I'm getting segmentation faults when I tried installing a module on a different machine. What's the best way to track down those errors? 23:19
guifa well, I tracked it down, but it's weird, I can't seem to golf it. Theoretically, this should be the golf 23:59
my $MAX = 8; class Foo { has int64 @.bar[$MAX] }; my int64 @bar[$MAX]; Foo.new: :@bar
m: my $MAX = 8; class Foo { has int64 @.bar[$MAX] }; my int64 @bar[$MAX]; Foo.new: :@bar
camelia ( no output )