« first day (2862 days earlier)      last day (1612 days later) » 

12:00 AM
Thanks to both of you
 
 
3 hours later…
2:49 AM
It'd be pretty cool to have something like swig to prep LibraryLink libs...
@Feeds There's a reasonably interesting discussion of the new compiler, LibraryLink, and MathLink in this
Definitely worth skimming to see how people inside WRI view the three
 
3:47 AM
Trying to come up for a name for my framework for making packages / handling dependencies. Currently it is just PackageFramework but I'm wondering if anyone has a spicier name.
 
 
4 hours later…
7:49 AM
@b3m2a1 Wolfpack?
2
 
 
7 hours later…
2:50 PM
@b3m2a1 I've never used swig before, but I have been thinking along these lines myself. I've hacked together my own system, where I precede a given c++ function with a comment styled in a particular way (similar to a doxygen comment I think, but again I've never used that system). Then when I build my paclet it scans the files for those comments and writes the C and WL wrapper functions.
The C-code generation is very much based on Szabolcs' LTemplate, but modified somewhat
Here is an example of the template, along with the C and WL code, pastebin.com/6DiqJh39
I also make heavy use of JSON, so that I can easily transfer data structures like Associations, ragged arrays, heterogeneous lists, etc, back and forth to c++
It's fairly easy to set it up with a new library, I had set up a link to the Ghent Quantum Chemistry Package but got distracted and haven't revisited it
frankly I haven't had much interest in this auto-library link approach, so I'm the only one to use it
 
3:36 PM
Jeepers, discretizing 3D graphics really takes about a thousand years if you object has any kind of complexity
 
 
2 hours later…
5:30 PM
@JasonB. Where does the need for serialization come in? I was pretty sure LibraryLink operated mostly in a shared memory domain?
 
5:57 PM
I was just about to make a Q/A for how to use PropertyValue and SetProperty on one's own objects, but it turns out I already made it last year...
3
Q: Custom Property interface on my own objects

b3m2a1I know I can use the Property interface for things like Graph but I want to use it for all of my objects. This includes: SetProperty PropertyValue PropertyList RemoveProperty Can I define it in some efficient, non-memory-leaky way for any object I want?

 
6:09 PM
 
6:22 PM
@b3m2a1 any time you want to send information to the library that isn't one of the pre-defined data types. You can a list of integers just fine, but what about a list of strings? You certainly can't send an association to the library and access the values by their keys.
 
@JasonB. I see. But for like big arrays and what not you do that in the shared memory space, right?
I think I was imagining that you serialized the state for a call into JSON
But it makes sense to serialize like small stuff like keys into JSON and then deserialize them on the other side
 
for arrays of a known type you use the normal library link passing
but for something as simple as passing a list of strings to the library, you could either use MathLink to call back and get the data, or serialize it to a json string, pass it as a single UTF8String, then deserialize in the library
the json version is faster
 
Yeah I can imagine. I've worked with MathLink and there are too many intermediate calls.
I think @Szabolcs also saw the same thing vis-a-vis JSON outperforming MathLink, but that was for even simpler stuff.
 
Using json is so easy I was getting lazy and using it basically as an OptionValue on the library side
like the function to generate 3D coordinates for a molecule, on the c++ side the function takes so many parameters there is a struct for all the options. To create that struct before calling the function I was just passing an Association via JSON, rather than creating a function with ~12 arguments
but this is adding some (small) overhead, and so I'm now going through and reversing that
the overhead is small though, the Developer`WriteRawJSONString function is very fast
except when you pass it a huge numeric array obviously
I don't want to come off as an evangelist for using json in the library. I think more important is the idea of making it very easy to write a thin LibraryLink wrapper to an existing C++ library
I recommend LTemplate to anyone who is looking to do that
 
 
1 hour later…
 
1 hour later…
9:03 PM
Small question - does anyone know how to make UpdateInterval work with Dynamic[CurrentImage[]]? Having absolutely no luck
 
9:17 PM
@CarlLange Same here, it seems like it was not built to support that option.
If your goal is to get an image every n seconds, there are other ways, of course.
 
@C.E. Oh yeah? I need the webcam image - what other ways are there?
 
@CarlLange e.g. SessionSubmit@ScheduledTask[img = CurrentImage[], Quantity[2, "Seconds"]] and then Dynamic[img]
 
@C.E. Oooh, that's perfect, thank you!! Then I can have two separate timers as well, that's exactly what I was looking for
 
Maybe ImageCapture[FrameRate->...]
 
@andre314 Sadly ImageCapture has its own problems, and I want to do things like save the image every n seconds as well as update more frequently. But thanks for the thought, and it does basically work
 
 
2 hours later…
11:01 PM
One thing I always come back thinking about is what would one make different in implementing a front end nowadays.
 

« first day (2862 days earlier)      last day (1612 days later) »