Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • My theory is that XML related technologies (XLST, SOAP, etc) are just more popular in projects which are using non-scripting languages (C/C++, C#, Java). There are many reasons why. For example: writing custom parsers in generally harder, cannot use languages itself to specify configuration. These languages are generally just more heavyweight and cannot be quickly adapted for many tasks which we kind of get for granted in scripting languages. So they "outsource" things like configuration, templating and RPC
    --

    Ilya Martynov (http://martynov.org/ [martynov.org])

    • Practically the only time I have to touch XML in Perl is when interfacing with somebody else system.

      True. That's the situation I routinely find myself in. We work with many outside groups and XML is the de facto data interchange format.

      With Bermuda, I would have found this much easier to handle if we had proper introspection. I could write a quick "stub" of a Bermuda island file like this pseudo Perl 6 code:

      print YAML <<"END";
      class: $class
      name: $class.key
      for: iPlayer   # allow different uses for the same class
      elements:
      END

      for $class.HOW.properties('public') -> {
          next unless my $accessor = $property.accessor;
          my $property_name = $property.name;
          my $accessor_name = $accessor.name;
          my $type = $property.type // 'string';
          if !$accesor.signature.returns('SCALAR') {
              $property_name .= '*';
          }
          print YAML <<"    END";
          - $property_name
          - type: $type
            method: $attribute_name
          END
      }

      And then the programmer could go in an convert elements to attributes, add arbitrary attributes, or customize it to their heart's content. Or just take the default and run with it. Right now we have to do it the hard way :/

      • Perhaps while you are waiting for Perl 6, you should look at MooseX::Storage [cpan.org], it doesn't have an XML backend, but thats mostly cause we haven't had the need for it (if you can choose a schema it would be trivial).

        - Stevan

        • That does look very interesting. I had also thought that in later stages of Bermuda, I'd want to have optional Moose hooks. They shouldn't be too hard to add :)

          • Actually it seems that Bermuda is somewhat redundant with MooseX::Storage (ignoring the fact MX::Storage only works with Moose classes for the moment). I wonder if pooling our efforts might not make sense? Interested?

            - Stevan

            • Not just yet. For one thing, I refuse to release this until I feel much more comfortable with the design. I've screwed up with this in the past and I'm not anxious to code myself into a corner. I also am being strongly driven to solve an immediate need at the BBC, so I do need to stay focused on that right now.