Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2014-05-22

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

All times shown according to UTC.

Time Nick Message
12:32 run4flat jberger, it's tenuously working!
12:33 run4flat https://github.com/run4flat/C-Blocks
14:51 mohawk joined #pdl
15:50 Mithaldu run4flat: what's the difference to C::Inline?
16:30 mohawk do you mean Inline::C?
17:17 perigrin C::Inline is the RPN version.
18:48 * run4flat looks up C::Inline
18:50 run4flat Mithaldu, I couldn't find a C::Inline on CPAN, so I am going to assume you mean Inline::C
18:50 run4flat First, there is the difference in the low-level handling of the C code
18:51 run4flat with Inline::C, your code is placed into an XS file, the C function declarations are parsed, and XS wrappers are auto-generated
18:51 run4flat then, the XS module is compiled using your standard compiler and loaded via a "use" statement
18:52 run4flat With C::Blocks, I use the keyword interface to add a few keywords, like cblock
18:52 run4flat after you say "use C::Blocks", the parser starts looking for those keywords
18:53 run4flat as soon as it sees one, my code takes over. It has the parser pull in everything in the enclosing block
18:53 run4flat compiles it in memory, and inserts an op in the Perl op tree at that location to execute the code you specified
18:54 run4flat It does not use any of Perl's ParseXS machinery because it just builds an op
18:54 run4flat In short, you can write your C code directly into your Perl
18:55 run4flat see the synopsis contained in the README file: https://github.com/run4flat/C-Blocks
18:55 run4flat furthermore---and this is where things get really cool---you can declare functions, structs, etc, in clex or cshare code
18:56 run4flat those declarations are visible to later cblocks *without* having to reparse that code
18:56 run4flat So, if you have 10 small cblocks that each use the perl.h API, you only need to parse those header files once
19:53 perigrin w/ 50
19:54 run4flat perigrin, huh?
19:54 perigrin typo
19:54 * run4flat nods
20:03 run4flat mohawk, do you have any round tuits?
20:04 run4flat Mithaldu, do you have any round tuits?
23:05 sivoais run4flat: what denomination of round tuits :-P
23:06 sivoais Also, can this machinery be used for C++? I don't know how coupled it is to tcc.
23:08 sivoais I ask because the main (only?) way that C++ template bindings are generated for libraries I've seen are by pregenerating a templates with certain types.
23:14 sivoais e.g., Python's ITK bindings for itk::Image<PixelType, Dimensions> when PixelType = unsigned char and Dimensions = 2
23:15 sivoais maps to the following in Python: itk.Image[ itk.UC, 2 ] which returns an actual class itkImagePython.itkImageUC2
23:48 sivoais actually, that might not be as feasible. The symbol tables in C++ are going to vary across compilers
23:56 mohawk perigrin, ha ha!

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