Perl 6 - the future is here, just unevenly distributed

IRC log for #pdl, 2014-05-26

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

All times shown according to UTC.

Time Nick Message
02:48 bulk88 left #pdl
03:01 mohawk joined #pdl
03:08 mohawk joined #pdl
14:28 run4flat joined #pdl
15:24 run4flat sivoais, I just saw your question
15:25 run4flat tcc is a C compiler, not a C++ compiler.
15:25 run4flat It would be very, very difficult to extend it to handle C++ gracefully
15:25 run4flat However, if you could compile standard types with a C++ compiler and generated a shared library with "extern C" based shared symbols
15:26 run4flat those could easily be loaded and used using C::Blocks
16:21 mohawk joined #pdl
18:03 sivoais hmm, so C++ would still be as memory/storage intensive as I had feared. No way around it, I suppose
18:03 sivoais I released Data::TestImage <http://enetdown.org//dot-plan/posts/2014/05/26/data-testimage/>
18:16 vicash sivoais: there is no difference in memory usage patterns between C and C++. in both cases you have to allocate and deallocate memory as needed. if you're trying to reduce memory usage, you may want to use swap files by mmap'ing data instead of loading it in memory and copying it around
18:19 sivoais vicash: oh, my remark wasn't about about memory usage of the language. let me find my question in the logs
18:20 sivoais vicash: here <http://irclog.perlgeek.de/pdl/2014-05-22#i_8763034>
18:21 vicash sivoais: you could try using Template toolkit to generate C++ templates :)
18:22 mohawk C++ - shudder
18:22 vicash but yes, i have worked with tools that generate C++ code based on some data and you basically have to have some pre-designed templates that you will fill in
18:22 vicash MSFT used to do that with their MFC framework
18:22 mohawk sivoais, controlling the install by env vars? NOOOOOO
18:22 vicash using templates and virtual/pure-virtual methods
18:23 vicash the thing with templates is that every compiler treats them differently.. especially multiple template parameters .... gcc itself between versions is not compatible
18:23 sivoais mohawk: I could add other ways like @ARGS to the build script
18:24 mohawk that feels like it would be more idiomatic?
18:25 vicash sivoais: i must recommend instead you should use Object oriented C with structures and function pointers as methods.. it is easier to merge into tcc/C::Blocks, and does not have virtual table issues...
18:26 mohawk GObject is a great example
18:26 mohawk i think OO C is a good way forward
18:26 vicash mohawk++
18:27 sivoais I would, but the libraries I want to wrap are C++ with templates. The folks that wrote the libraries created their own SWIG version to handle that
18:27 vicash then sivoais: you should generate the Perl interface using SWIG
18:27 sivoais That's why I started wrapping Leptonica (pure C) before trying ITK
18:28 vicash otherwise you will end up getting stuck maintaining a C wrapper to their C++ interface which is a bad idea in the long run
18:28 vicash if thye have a swig file, they will maintain it, and you just use that
18:29 sivoais well, it's not a simple SWIG file... it's a SWIG file with lots of language-specific code
18:29 sivoais But I'll look into seeing if I can do something with that first!
18:29 vicash they must be swigging java then
18:29 vicash because java has the worst C/C++ compatibility.. C# and other scripting languages are much more simpler
18:30 sivoais Java, Python, and Tcl. But I think Tcl was and now Python is their main target
18:31 vicash is this a graphics library ?
18:32 sivoais Image/volume
18:32 sivoais processing
18:32 sivoais There's VTK which is for volume rendering, but that doesn't use templates
18:32 mohawk sivoais, this might be a crazy idea, but have you spoken to the devs and seen what they think about the best way to integrate with perl?
18:32 mohawk there might be a simple answer
18:33 sivoais haha, I guess I could do that, but I haven't had too much luck on their mailing list
18:34 sivoais but that was with other questions, not binding stuff
18:37 vicash sivoais: you could create your own API for the stuff, and then have the required templates be wrapped in C and handled accordingly.. this way you wrap only those that are necessary... you could also dynamically generate the code, build into a library and load when the class object is created...
18:38 vicash that's what CUDA and OpenCL do. they compile the code into bytecode once and then store it in a cache somewhere and just reuse it unless the code changes
18:39 sivoais hmm, OK. That project is a while off, but I'll keep that in mind
22:30 mohawk by the way, a tool i have learned of that does GObject OO C generation: vala
22:31 mohawk you may know of it already

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