Thursday, May 29, 2014
And speaking of cool C things
Here's a package that brings Lisp macro syntax to C. Do want! (Run C::Blocks through that!)
C::Blocks and Devel::Declare
There are a couple of different ways to hook into the Perl parser and define a keyword that flags your own funky syntax - neither of which I'd heard of until encountering the absolute genius that is C::Blocks.
C::Blocks embeds C code right into your Perl, using a cblock { this is C here } syntax that is just incredibly groovy. It's way more inline than Inline. OK, so it's not production-ready yet, but still - it will be. And I'm going to do that same thing for HBScheme.
So anyway, C::Blocks uses the shiny new pluggable keyword API to do that (introduced in 5.12) - but Devel::Declare lets you do pretty much the same thing, but less elegantly and safely. The difference appears to be that the pluggable keyword is available from XS and expects you to return opcodes (that is, it's a real live hook into the interpreter) while Devel::Declare runs in Perl and returns strings that will then be interpreted by the Perl interpreter. I might be wrong about that, but I haven't really gotten into it yet.
Yet.
C::Blocks embeds C code right into your Perl, using a cblock { this is C here } syntax that is just incredibly groovy. It's way more inline than Inline. OK, so it's not production-ready yet, but still - it will be. And I'm going to do that same thing for HBScheme.
So anyway, C::Blocks uses the shiny new pluggable keyword API to do that (introduced in 5.12) - but Devel::Declare lets you do pretty much the same thing, but less elegantly and safely. The difference appears to be that the pluggable keyword is available from XS and expects you to return opcodes (that is, it's a real live hook into the interpreter) while Devel::Declare runs in Perl and returns strings that will then be interpreted by the Perl interpreter. I might be wrong about that, but I haven't really gotten into it yet.
Yet.
Tuesday, May 20, 2014
Article: Perl and Windows UAC
New article written on the Vivtek site, a little in-depth investigation of Windows UAC and how to manipulate it from Perl, along with the release of a CPAN module.
Tuesday, May 13, 2014
Marpa stuff
As I get further into Marpa, I'm starting to see there's a whole little world of cool stuff out there based on it. Here are a couple of bookmarks for later.
- A fantastic article on using Marpa to convert Excel spreadsheet formulas into Perl using AST transformations.
- Kegler's "Ruby slippers" parsing technique: essentially ways to trick a simple grammar into functioning within a larger whole by using invisible tokens and wishing the language were easier to parse. Marpa is ... well, it's beyond cool and into virgin territory.
- Another Kegler post on mixing declarative and procedural parsing that should come in handy here and there.
- Here's a gist showing a Marpa parser for CSS that uses a tokenizer external to Marpa - the key technique is in the loop starting on line 187, where we pass each individual token to the recognizer. Only after the token stream is complete do we read the value from the recognizer. (So for a series of sentences, do we have to create a new recognizer for each sentence? I think we actually do. That will be something for experimentation later.)
Thursday, May 8, 2014
Using a spreadsheet as data for templating
The Python copytext module takes a spreadsheet and loads it as a data structure for expression in a template; that's kind of a neat ... I'm trying to think of the phrase I want to use ... "dataflow component" seems to be as close as I can come tonight.
Anyway, this is kind of a neat idea and is probably a way forward for the Data::Table::Lazy module. Note also that D::T::L should directly know how to work with Excel and with Google spreadsheets for maximum fun and profit.
Anyway, this is kind of a neat idea and is probably a way forward for the Data::Table::Lazy module. Note also that D::T::L should directly know how to work with Excel and with Google spreadsheets for maximum fun and profit.
FreeLing
Another NLP package I'd never heard of. I gotta take another sabbatical week soon and get all this NLP stuff under control. Anyway, I found this one on a more-or-less random sweep through CPAN - I forget what I was searching on, but ran across Lingua::FreeLing2::Bindings. Perl bindings make me happy, so I think I'm going to poke around here as soon as possible.
Saturday, May 3, 2014
Irssi
So Irssi is a text-based IRC client that I believe I love already. I only hit IRC about every five years or so; maybe this time will be the time I stick there. It's very popular for software development groups.
Anyway, Irssi seems to embed some kind of Perl automation. I'm going to figure it out eventually.
Anyway, Irssi seems to embed some kind of Perl automation. I'm going to figure it out eventually.
Thursday, May 1, 2014
Marpa
So I decided to sit down finally and write the line parser for the new Decl, and since it was parsing, I decided not to unearth my old HOP-inspired parsing code but rather take the plunge and try Marpa, to avoid getting bogged down in parser issues.
I am in love.
It basically looks like Marpa can do anything related to parsing. It can even handle ambiguous parses! One of the test cases is literally "time flies like an arrow"!
But what doesn't yet exist (there's a partial beginning) is a tutorial set, a "Gentle Guide to Marpa". I think I'll write one.
I am in love.
It basically looks like Marpa can do anything related to parsing. It can even handle ambiguous parses! One of the test cases is literally "time flies like an arrow"!
But what doesn't yet exist (there's a partial beginning) is a tutorial set, a "Gentle Guide to Marpa". I think I'll write one.
Subscribe to:
Posts (Atom)