Re: coded size limits on Perl data types?

2016-09-13 Thread Darren Duncan
Thank you for this Timo, and to everyone else who replied. It did indeed address what I wanted to know. -- Darren Duncan On 2016-09-13 5:15 AM, Timo Paulssen wrote: I'll answer based on the data structures MoarVM uses internally: On 09/13/2016 05:13 AM, Darren Duncan wrote:> (Pretend the

Re: grammars and indentation of input

2016-09-13 Thread Theo van den Heuvel
As so often it turned out that the reason my program did not work was elsewhere (in the grammar). My approach worked al along. It was instructive to look at the examples you guys mentioned. Thanks Theo

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Bennett Todd
Well put. The clearest description of Python's approach I've read, explained it as a lexer that tracked indentation level, and inserted appropriate tokens when it changed.

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Bennett Todd
Hostile or not, thanks for your informative reply.

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Bennett Todd
Thank you, very much. Yes, I'm disappointed, but I'd rather know.

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Aaron Sherman
> > Having the minutia of the programmatic run-time state of the parse then > influence the parse itself, is at the heart of the perl5 phenomenon "only > Perl can parse perl" I don't mean to be hostile, but you're demonstrably wrong, here. (also it's "only perl can parse Perl" as in, only the

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Patrick R. Michaud
On Tue, Sep 13, 2016 at 10:35:01AM -0400, Bennett Todd wrote: > Having the minutia of the programmatic run-time state of the parse then > influence the parse itself, is at the heart of the perl5 phenomenon "only > Perl can parse perl", which I rather hope isn't going to be preserved in > perl6.

Re: Fwd: Re: grammars and indentation of input

2016-09-13 Thread Bennett Todd
Having the minutia of the programmatic run-time state of the parse then influence the parse itself, is at the heart of the perl5 phenomenon "only Perl can parse perl", which I rather hope isn't going to be preserved in perl6.

Re: grammars and indentation of input

2016-09-13 Thread Aaron Sherman
I don't see why optimization would frustrate this approach. You are doing the correct thing as far as I can tell, but with one exception. The current implementation (last I checked) was sometimes slow in binding values. You might need to force it between an assignment and passing a bound match as

Re: coded size limits on Perl data types?

2016-09-13 Thread Timo Paulssen
On 09/13/2016 03:12 PM, Timo Paulssen wrote:> If one big integer is allowed to be 14 gigabytes big (if we use the > default of 28 bits per "mp digit"; it's also possible to use 31 or > 60.), we can still safely say "limited only by memory" for now. Something else that makes this pretty difficult

Re: grammars and indentation of input

2016-09-13 Thread Brian Duggan
I've also recently been experimenting with parsing an indent-based language -- specifically, a small subset of Slim () -- I push to a stack when I see a tag, and pop based on the depth of the indendation. Here's a working example: https://git.io/vig93 Brian

Re: coded size limits on Perl data types?

2016-09-13 Thread Elizabeth Mattijsen
> On 13 Sep 2016, at 14:15, Timo Paulssen wrote: > > I'll answer based on the data structures MoarVM uses internally: > > On 09/13/2016 05:13 AM, Darren Duncan wrote: > > > (Pretend the actual hardware has infinite memory so we wouldn't run > > out of hardware first.) > > >

Re: grammars and indentation of input

2016-09-13 Thread Timo Paulssen
I haven't read your code, but your question immediately made me think of this module: https://github.com/masak/text-indented Would be interested to hear if this helps you! - Timo

grammars and indentation of input

2016-09-13 Thread Theo van den Heuvel
Hi all, I am beginning to appreciate the power of grammars and the Match class. This is truly a major asset within Perl6. I have a question on an edge case. I was hoping to use a grammar for an input that has meaningful indented blocks. I was trying something like this: token element {