Re: need to do some xml manipulation

  • From: Dimiter 'malkia' Stanev <malkia@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Sat, 02 Jun 2012 21:59:28 -0700

Build systems is the thing I want to make right for myself.
I don't care about generating .sln, .vcproj, etc. for people, I only care to be able to compile (command-line that is).

Something that builds everywhere.. I've started doing something myself, but nothing's finished. I want to be able to customize and build for a lot of platforms. And no, not the way I'm doing it now through a bunch of .sh for linux/osx, and batch files for Windows - I'm basically collecting what different cases I need to support.

And not the autoconf way though. I don't want the build to be dependent on what's installed in the system. Maybe Makefiles would cut it at the end, who knows. I thought of using busybox as a core for building, and code everything in ASH. I've got it compiled for OSX, someone else for Windows (mingw), and it's already out there for linux.

There is premake, and I'm also looking into it. Also ninja, redo and tup, and many others. Gyp too.

I've looked at CMAKE, but I don't like it - the syntax turns me off. If it was proper s-expression (I love lisp), then yeah, but it's very awkward.

Maybe something lua-ish is proper. I should've looked more into lake.

Ah...

On 6/2/12 9:49 PM, William Adams wrote:
Little sparks, and we see all this activity.

Maybe data from rohit.com can be combined with the new ffi reflection stuff to create some rapid runtime driven interop goodness. I think it would be dramatically funny if all that was needed to communicate with a library was the .pdb and a little bit of Lua glue. that would be a very fun and easy world to live in I think.

It's also good to see several XML projects laying out there. I like the ones where it's direct Lua code, but that's just my preference, because I can't figure out all the myriad build systems that projects tend to use.

-- William

=============================== - Shaping clay is easier than digging it out of the ground. http://williamaadams.wordpress.com http://www.thingiverse.com/WilliamAAdams https://github.com/Wiladams

------------------------------------------------------------------------
Date: Sat, 2 Jun 2012 21:33:05 -0700
From: malkia@xxxxxxxxx
To: luajit@xxxxxxxxxxxxx
Subject: Re: need to do some xml manipulation

I had to use XML, I've found this wonderful Windows tool called API Monitor (rohitab.com), that can trace by injecting any process, and it knows (in xml form) about almost all windows functions (sadly OpenGL excluded) - this includes structs, functions, etc.

I've started on reimporting this...

But anyhow, as I've never used XML before in my life, or at least never parsed, I've reused expat. I had expat already precompiled, as Apache APR needs it, and put some ffi bindings for it:

https://github.com/malkia/ufo/blob/master/ffi/expat.lua

Here is an example of how to use it:

https://github.com/malkia/ufo/blob/master/samples/Windows/api.lua
https://github.com/malkia/ufo/blob/master/samples/Windows/apis.lua

it's work in progress.

I'm not sure how the guy behind the project got all this info, but I suspect it's done using the diasdk (from Microsoft). It can read plenty of info from the pdb.

It might be the way to go with Windows for massive import of libs.

If someone can transfer these xmls into ffi for WIndows that would be great. I might do it, but I'm at heavy crunch at work (shipping a game), so don't have much time.

Cheers!

Here is the awesome tool I was trying to rip it's data

http://www.rohitab.com/apimonitor

It might get useful for lots of Windows folks.
On 6/2/12 5:11 PM, William Adams wrote:

    This isn't exactly an announcement, but for those of you who might
    be doing any XML manipulation, I've added some native lua
    'parsing' to the Laphlibs: https://github.com/Wiladams/LAPHLibs

    It's called luxl.lua

    If you're familiar with things like pico xml and tiny xml, it
    stems from that.

    My criteria were things like:
    Do no allocations
    Deal with straight 0 based buffers (like coming off the net)
    Be a pull model parser
    Expose an iterator model

    I say it's not a 'parser' because a real XML parser is quite a
    beast.  Luxl can scan through a lot of simple xml files, the kind
    that are typically found while doing quick exchanges of data, and
    the like.

    My particular needs are dealing with XSD, and SAML, but it works
    find for lots of other things.

    If you need more robust validation parsing, you could build atop this.

    The benefit I see to such a thing is that there's no interop.  I
    don't have to carry along a .c file and worry about how to build
    the same on all sorts of other platforms.  It's small (less than
    400 lines), and relatively simple to use:

    At any rate, give it a try if you like.

    =============================== - Shaping clay is easier than
    digging it out of the ground. http://williamaadams.wordpress.com
    http://www.thingiverse.com/WilliamAAdams https://github.com/Wiladams



Other related posts: