Perl 6 - the future is here, just unevenly distributed

IRC log for #marpa, 2017-07-12

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:34 idiosyncrat joined #marpa
00:35 idiosyncrat Demat!
01:49 ilbot3 joined #marpa
01:49 Topic for #marpa is now Start here: http://savage.net.au/Marpa.html - Code paste/run: https://f.perlbot.pl/#marpa - Jeffrey's Marpa site: http://jeffreykegler.github.io/Marpa-web-site/ - IRC log: http://irclog.perlgeek.de/marpa/today - Youtube channel: https://www.youtube.com/channel/UCYKVfGBtfTqbs1JdYq-dc5g
05:08 cheako joined #marpa
05:10 cheako Is there an online DSL tester, like ideone?  I've tried several perl testers and found they all lacked the marpa-r2 module.
05:12 cheako Is there a library or pre-made DSL?  I'm looking to parse shell scripts and it would help if there is already a DSL for this.
05:14 cheako I'm glad there is an irc log, I'll check the web and jump on if I am available to respond.
06:56 ronsavage joined #marpa
06:59 ronsavage cheako: Hi. The closest I could think of in my Favourites is the manual for Bash: http://www.tldp.org/LDP/abs/html/index.html. Also check my Marpa.html page for a set of Marpa-based modules for various languages, which would be a starting point if you wish to write your own.
11:56 sirdancealot joined #marpa
15:14 kook joined #marpa
16:12 cheako joined #marpa
17:13 cheako joined #marpa
17:41 cheako ronsavage: Thanks for hints.  This is my first time doing anything with lex, so I'm not sure where to even begin.  I think the idea is to tackle the language's tokens in order of precedence.  For bash that would be \ and # I think.  comments should be straightforward, but I'm confused entirely of how to represent the \ operator.
17:44 lucs cheako: I believe perlbot.pl should have Marpa::R2 in its list of supported modules, but maybe the site maintainer didn't get a chance to add it yet.
17:44 lucs I'll ask him.
17:45 idiosyncrat cheako: On level of difficulty, parsing bash will be very very hard.
17:45 idiosyncrat That's my guess.
17:46 cheako dang
17:46 idiosyncrat Much harder than, say, C language.
17:47 cheako I'm trying to write a beautifier that is able to split and combine lines.  I thought compiling to some internal representation would be the ideal method.
17:47 idiosyncrat In that case, your beautifier can
17:48 idiosyncrat 1.) get by with recognizer only some of the syntax;
17:49 idiosyncrat s/recognizer/recognizing/
17:49 idiosyncrat 2.) fail "softly" when it does not really recognize syntax, by beautifying according to a reasonable guess.
17:50 idiosyncrat That makes it a much easier problem than fully duplicating the parsing of the bash shell.
17:57 cheako https://perlbot.pl/p/wu9xox   No Marpa::R2 , at thus time.
17:57 cheako s/thus/this/
18:14 cheako idiosyncrat: Are u saying I should ignore \?  I don't think that's an option.
18:16 cheako \ is basically a synonym for quote the next char, except for when at end of line.
18:16 idiosyncrat I encourage people to use Marpa for everything, all the time. :-)
18:17 idiosyncrat But I am pointing out the level of difficulty.  If the time you wish to invest won't produce the result you want, you've certainly got to take that into consideration.
18:17 cheako I see.
18:18 idiosyncrat A bash beautfier in Marpa::R2 is do-able, but it's not a small project.
18:45 cheako Even the journey of 1,000 miles, begins with the first step.  The current bash beautifier is a few regexs in a python script and hasn't changed much in 6 years.
18:46 idiosyncrat As a said, parsing for a beautifier can be much easier than parsing for semantics.
18:47 idiosyncrat At a minimum it should be possible to copy the  Python beautifier as Marpa::R2, which might be a way to start.
18:48 idiosyncrat Regular expressions can be translated into BNF, and custom hacks can simply be reproduced using external lexing and events.
19:17 idiosyncrat left #marpa
19:44 lucs cheako: Just spoke with the site maintainer (simcop2387):
19:44 lucs Marpa::R2 is now usable from perlbot.pl, even though it won't yet appear in the "Supported modules" list.
19:45 lucs (he needs to tweak that part to have all the supported modules appear)
20:12 kook joined #marpa
20:36 cheako joined #marpa
20:46 cheako lucs: Thanks :)
22:44 ronsavage joined #marpa

| Channels | #marpa index | Today | | Search | Google Search | Plain-Text | summary