7 ms·
Parsing – REBOL Users Guide
- QuantumAphid 10y agoMore than a decade later, Rebol (and its newer offspring Red red-lang.org) are still in regular use on my team. A cool thing about Rebol's (and Red's) PEGs are that they can easily parse and process the diverse datatypes of its parent source. REBOL Parser in 10 Lines http://www.rebol.net/cookbook/recipes/0042.html http://www.rebol.net/cookbook/recipes/0042.html And: http://blog.hostilefork.com/why-rebol-red-parse-cool/ http://blog.hostilefork.com/why-rebol-red-parse-cool/ "But even more impressively, it can work on the symbolic structure of code itself. While Rebol and Red are both like Lisp in being homoiconic, when you see something like PARSE applied on code itself... you know you're looking at something very cool."
- throwaway7645 10y agoCould you please go into agonizing detail on your team's use of REBOL? I've never been more excited for a language than Red/RedSystem, but hear so little in the wild on it or its older brother. All the parse examples I've seen have been pretty basic, but I hear it is powerful.
- oofoe 10y agoI can't answer for QuantumAphid, but I have used REBOL (v2) extensively for graphics post-production utilities for my old studio. It was the only way that I could provide programming services for all the departments I had to support. Of course I wrote a number of simple utilities, but I also did several large and comprehensive applications with complete user interfaces. I could staple together a fully styled interface with custom widgets in an afternoon compared with (at best) several days for equivalent functionality with other toolkits. Most of my large programs communicated with our production management database using XMLRPC. The GUIs including things like a full graphical Avid-style editorial timeline, a multi-panel interface for managing data on the review playback system, one that mimicked the playback system interface (complete with reflections and drop shadows) to make the operator feel at home... Even one with a wise cracking virtual assistant that guided the operator through the task. All of these were operational and bug free in a fraction of the time that would have been consumed by Python/wx. Just as important as simple and flexible GUIs were the built in parsing, binary and image processing. I could make a shot slates (images with text noting the shot number and production) quickly and easily because anything you could show in the GUI could be exported as an image. I did complete stereo audio processing for Editorial inside REBOL with no external libraries -- it was simple and fast. When I later had to replicate this utility in Python I finally threw up my hands and shelled out to sox. In general, these tools were rock solid, fast, easy and attractive to use. So it's a great language, and Red seems like it will be a worthy successor. The learning curve to use it effectively is a bit steep because it has many differences from ALGOL derived languages. But once you figure it out, you'll never want to give it up!
- throwaway7645 10y agoAwesome! Thanks for the long post. I'm primarily a Python user, but recognize it as for what it is (reasonably easy to learn and equally limiting scripting tool). I think Rebol is pretty cool, but have been waiting for the speed that Red promises.
- draegtun 10y agoZOE is an interesting example of Rebol 3 usage in the wild - https://www.atronixengineering.com/zoe https://www.atronixengineering.com/zoe NB. Above isn't parse specific.
- QuantumAphid 10y agoI work in marketing for a major corp. My teams manage 100+ ecommerce sites in 15 languages; we send out millions of marketing/promo emails each month; we manage product-search taxonomies, geographic hierarchies, keywords, etc. Even though large databases are our workhorses, we also transform tens of thousands of text content files (XML primarily) and validate data across plumbing junctions-- ETL jobs, SOA, web APIs and so-forth. My teams are business users-- web-savvy marketers, designers and data analysts -- i.e., a semi-technical group. Some can write javascript and/or SQL, but they aren't programmers. We need very simple, short, readable scripts. Most languages require regular expressions, which are not a good fit for my teams unless the task is fairly basic. Rebol's Parse DSL is probably the best regular expression replacement I've found in my career. We basically have no need for RE's ever. Rebol (and Red) have plenty of other uses -- and we've built some nice desktop GUI apps. But our main needs are around data-munging/wrangling -- scanning tens of thousands of files and/or webAPIs and parsing/extracting/transforming that data to make our many haystacks needle-free. For us, Rebol/Red have the simplest tools that work well for this job. I imagine in the future, with greater emphasis on knowledge worker roles (such as data analysts), we may see the emergence of even simpler languages than available today-- My $.02 -- I just don't think R/Python/Ruby/Perl are quite simple enough for semi-technical staff and non-programmers.
- throwaway7645 10y agoVery interesting. Thank you. I'm an engineer that can program with traditional tools just fine, but i have a lot of analysis and data munging in my job as well and am always on the search for better tools. Anything to save me time and present an edge.
- draegtun 10y ago>> Rebol and Red are both like Lisp in being homoiconic With regards to this I do like Hostilefork's companion blog post regarding macros - http://blog.hostilefork.com/rebol-vs-lisp-macros/ http://blog.hostilefork.com/rebol-vs-lisp-macros/ (HN comments - https://news.ycombinator.com/item?id=11587952 https://news.ycombinator.com/item?id=11587952)
- rebolek 10y agoRed [1] is language based on Rebol that among other things improves PARSE dialect [2] [1] http://www.github.com/red/red http://www.github.com/red/red [2] http://www.red-lang.org/2013/11/041-introducing-parse.html http://www.red-lang.org/2013/11/041-introducing-parse.html
- wcummings 10y agoReminds me of perl6. Why don't more languages support grammars like this? Fun example: https://github.com/perl6/perl6-examples/blob/master/categories/interpreters/lisp.pl#L34 https://github.com/perl6/perl6-examples/blob/master/categori...
- throwaway7645 10y agoUsually they do through a PEG library if you search for that. Lua has a nice one and Python a few ok ones. They aren't native to the language like Rebol and Perl6 though.
- wcummings 10y agoYeah, I meant natively.
- throwaway7645 10y agoOh, yea. P6, Rebol, Red...any lisp with a little work.
- draegtun 10y agoAnd Perl5. Here are two examples of grammar engines built out of perl regex... * Regexp::Grammars - https://metacpan.org/pod/Regexp::Grammars https://metacpan.org/pod/Regexp::Grammars * Parse::RecDescent - https://metacpan.org/pod/Parse::RecDescent https://metacpan.org/pod/Parse::RecDescent
- throwaway7645 10y agoYea, not native which is what the poster ended up meaning, but I hear that one you linked from Damian Conway is great.
- draegtun 10y agoNo external library is used in these modules just Perl5 native regex engine. NB. I think thats also same for Parsec (built out of Haskell's parser combinators) BTW - Damian created both of them, Regexp::Grammars was his replacement for his Parse::RecDescent.
- jgalt212 10y agoThe designer of REBOL, not surprisingly, is a pretty interesting and impressive fellow. https://en.wikipedia.org/wiki/Carl_Sassenrath https://en.wikipedia.org/wiki/Carl_Sassenrath