Perl 6 language and compiler development | Logs at colabti.org/irclogger/irclogger_log/perl6-dev | For toolchain/installation stuff see #perl6-toolchain | For MoarVM see #moarvm
Set by Zoffix on 27 July 2018.
00:00 reportable6 left, reportable6 joined 00:24 BeastieBot joined 02:23 pamplemousse left, pamplemousse joined 04:46 pamplemousse left 05:29 robertle left 06:00 reportable6 left 06:02 reportable6 joined 06:56 robertle joined
nine Kaiepi: your commit 1a19c6605d doesn't make sense to me. $*SCHEDULER.cue({ ... }, every => Inf) should mean "once and never again", but we now run it every 1ms. This also breaks a spec test: t/spec/S17-scheduler/every.t:116 07:17
lizmat what repo is this 1a19c6605d you speak of? 07:46
robertle I am toying with the idea to abuse the rakudo compiler itself to get some information of what a piece of source code actually is, for syntax highlighting and perhaps linting. obviously I am way outside my competence here 07:55
nine lizmat: rakudo
robertle but I can do something like this: say nqp::getcomp('perl6').compile('say 3; say 4;', compunit_ok => 1, target => 'parse').MATCH.dump;
I realised that getting the QAST (target => 'ast') is of no use to me, because at this point there are no more file+line+position locations anymore (is this correct?) 07:56
so I want to use the parse stage. I believe that what I am getting back from the code below is the grammar match tree, but it's a bit hard to say
is there a way to figure out which "dump" I am calling in this example? that would help a lot 07:57
or what type I am calling it on
nine robertle: even the QAST should have annotations for file and line number 07:58
robertle: after all, we print those even in error messages at runtime so the information must be available :)
robertle that would be fab! I looked at the annotations, but could not find any location-related stuff in there. will do more digging there
I did dump_annotations on the QAST nodes I got back though, without much luck. will try harder 08:00
a more general question: is this a really stupid idea? Is there any better way to understand a perl6 code for highlighting or linting?
08:06 squashable6 left 08:10 squashable6 joined
|Tux| Rakudo version 2019.07.1-105-g082c09e0e - MoarVM version 2019.07.1-66-g654a136d1
csv-ip5xs0.712 - 0.730
csv-ip5xs-205.127 - 5.455
csv-parser21.615 - 21.830
csv-test-xs-200.431 - 0.432
test6.824 - 7.409
test-t1.682 - 1.766
test-t --race0.784 - 0.795
test-t-2026.475 - 27.913
test-t-20 --race8.840 - 9.145
09:27
10:28 ufobat_ joined 10:32 ufobat left 10:38 go|dfish left
Geth rakudo: 971d4bf635 | (Elizabeth Mattijsen)++ | src/core/Date.pm6
Make sure that months/years also pass the formatter
11:02
12:00 reportable6 left 12:01 reportable6 joined 12:26 robertle left 12:28 robertle joined 12:45 pamplemousse joined 13:04 vrurg joined 13:11 pamplemousse left, pamplemousse joined
robertle ok, I have been digging around in the QAST structure for a bit, but I totally don't get how this could store any sort of line/file/position information. is it possible that this is stored externally like in an elf debug info? 13:11
timotimo robertle: it's all stored in the .node parameter, that has the match object, but only for some qast types i believe 13:12
robertle also, any hints on where such information could be set or used would be rgeat. I looked at the QAST generation in Actions, and the Optimized but to no avail
timotimo look for the usages of method "linefileof" 13:13
robertle ah, is that lower-case node the match from the "parse" stage? 13:15
timotimo should be
robertle I had that thing earlier when I was experimenting with the parse rather than ast stage, but don't get it at all. what type is that even? .^name says "Perl6::Grammar", but of course it is not, it must be some match object, but I can't find the definition of it anywhere... 13:16
timotimo oh, it is the Perl6::Grammar 13:20
grammars are all their own match type
robertle really? I think my head hurts... 13:21
timotimo we used to have a distinction between match object and cursor, but they were consolidated
among others for performance reasons i think?
robertle but I think I got it now! so .from on that match gives me where in the file this node is, and the node type tells me what it is! awesome, I think this is actually going to work! 13:22
obviously the downside of this appproach for syntax highlighting is that you can't highlight something that isn't valid at all... 13:26
timotimo aye, comma has its own stuff to handle incorrect/partial code for that reason 13:32
vrurg timotimo: I wonder if it's generally possible to use AST from rakudo for syntax highlighting? Would need another actions and another AST, but shoulf be doable, I guess. 13:48
timotimo many parts of the grammar have the need for a World to also exist with definitions and such inside it 13:50
so it'll have to have those parts in the highlighting actions, too
robertle vrurg: so using a compatible but pretty much empty actions set would all one needs really, right? that was my hypothesis so far... 13:51
empty actions would also allow it to work for some errors in the code 13:52
vrurg The compiler might provide the support by having additional (possibly dynamically loaded) actions class.
robertle: I'm not an expert in rakudo grammar either. And possibly thinking almost the way you are. Though I'd say if you need pre-parsed syntax for an external editor you'd need actions class which would generate specialized AST tree for that. 13:54
Use of QAST for this purpose is pretty much overkill. But World relies on QAST in many aspects, so the problem is really not something easy to solve. 13:55
robertle hm, interesting. I was thinking I could just take the match tree from the existing grammar, and by type decide how I want to highlight. using an empty actions thing that does not create QAST and does not check things would make it faster and less forgiving
anyway, I'll do some more experiments but I am in way over my head...
vrurg robertle: As timotimo noticed, Grammar, Actions, and World are pretty tightly interweaved. 13:56
Now, the more I think about it the more it looks like it'd be really easier to dump out QAST than re-write Actions. 13:57
robertle but the actions ddo all sorts of checking that a highlighter probably doesn't want...
13:59 lucasb joined
vrurg robertle: yes and no. Consider Red where it EXPORTHOW 'model' keyword which is in fact a class. To highlight it properly you'd need to handle EXPORTHOW in first place. 14:00
And this is where Actions step in.
Many other places where correct parsing depends on symbol resolution. Think of `my \foo = $bar; say foo` for example. How do you know what `foo` in say is? 14:01
robertle yeah. oh my. 14:02
timotimo sadly, the Actions will abort compilation when it thinks compilation can't go on
robertle so what to do? surely there must be a way to highlight and lint a perl6 program...
for highlighting the other question is how far you want to go as well. I think comma tries really hard, but for most people it would be enough to know what a variable is, what a literal, and what just a symbol... 14:04
for linting purposes you need more, but then it's probably ok to be unable to lint broken code
whereas highliting should work much more for broken code 14:05
vrurg robertle: All I can tell: it's not something to be answered in a few words. :) Perhaps (again, not sure) it'd be possible to make Grammar/Actions warn on errors instead of bailing out when an option is set. But how easy would it be? And how much would you trust the results? A lot of things to think about. 14:08
robertle life would be too easy with a grammar like java's :) 14:10
vrurg robertle: don't mention the j* word when I'm around. ;) I'm idiosyncratic to it since the end of 90s... ;) 14:11
15:25 AlexDaniel is now known as testable9291 15:27 testable9291 is now known as AlexDaniel 15:34 robertle left 16:42 pamplemousse_ joined 16:44 pamplemousse left
Geth rakudo: nxadm++ created pull request #3092:
Bump the margin of performance test to pass on i386
16:48
rakudo: 193d4dc485 | (Claudio Ramirez)++ | t/08-performance/99-misc.t
Bump the margin of performance test to pass on i386
16:49
rakudo: bc45af3b85 | niner++ (committed using GitHub Web editor) | t/08-performance/99-misc.t
Merge pull request #3092 from nxadm/master

Bump the margin of performance test to pass on i386
16:49 travis-ci joined
travis-ci Rakudo build errored. Claudio Ramirez 'Merge branch 'master' of github.com:rakudo/rakudo' 16:49
travis-ci.com/nxadm/rakudo/builds/121784038 github.com/nxadm/rakudo/compare/e2...aaa5562611
16:49 travis-ci left 16:52 travis-ci joined
travis-ci Rakudo build errored. Claudio Ramirez 'Bump the margin of performance test to pass on i386' 16:52
travis-ci.com/nxadm/rakudo/builds/121784450 github.com/nxadm/rakudo/compare/9b...2fef024647
16:52 travis-ci left 16:59 mst joined 17:30 chloekek joined 17:39 travis-ci joined
travis-ci Rakudo build failed. Claudio Ramirez 'Bump the margin of performance test to pass on i386' 17:39
travis-ci.com/nxadm/rakudo/builds/121785101 github.com/nxadm/rakudo/compare/97...3d4dc48573
17:39 travis-ci left 18:00 reportable6 left, reportable6 joined, ChanServ sets mode: +v reportable6
Kaiepi nine: there was an additional function when i was writing that to deal with Inf, -Inf, NaN, and nums, but it looks like it got lost before it got merged 18:34
unless it was in the commit that changed that code beforehand 18:35
either way it didn't account for Rats so it needs changing anyway 18:36
yeah it was in the other commit 18:37
waaaait i see what you mean now 18:57
lol
19:07 BeastieBot left 19:08 BeastieBot joined
Kaiepi i'll get this fixed tomorrow, can't really do it today 19:14
19:17 robertle joined
nine ++Kaiepi 19:50
ugexe libuv is adding a uv_fs_statfs 20:16
21:09 lucasb left 21:17 chloekek left 21:28 MasterDuke joined 21:33 pamplemousse_ left 21:48 pamplemousse_ joined 21:59 tellable6 joined, ChanServ sets mode: +v tellable6 22:02 tellable6 left