Err, I mean size and alignment. On Sat, Jul 2, 2011 at 8:03 AM, Phyx <[email protected]> wrote: > It's all done by the tool itself. It uses hsc2hs to calculate the > offset and size of the structures, but generating the actual > structures is done inside the tool itself. > > Regards, > Tamar > > On Sat, Jul 2, 2011 at 1:05 AM, Yves Parès <[email protected]> wrote: >> This is interesting, >> From what I can see, you can automatically mashall haskell datatypes into C >> structs. >> >> Are there portable libraries that do that ? Or do you do this by yourself ? >> >> >> 2011/7/1 Phyx <[email protected]> >>> >>> What is it? >>> ======== >>> >>> A preprocessor and library which allow you to create dynamic libs >>> from arbitrary annotated Haskell programs with one click. It also >>> allows you to use the generated lib in C, C++ and C# just by including >>> the generated header files. >>> >>> At a minimum it can be considered the inverse of c2hs. >>> >>> Where to get it? >>> ============ >>> >>> You can get it from Hackage >>> (http://hackage.haskell.org/package/Hs2lib) or by using cabal >>> (cabal install Hs2lib). >>> >>> Documentation, Mailing List, Source, etc >>> ======================= >>> >>> Go to http://mistuke.wordpress.com/category/hs2lib/ for information. >>> >>> What's New? >>> ========= >>> >>> - Currently Supported: >>> >>> * Generates Marshaling information for arbitrary data types. >>> Types with kind other then * have to be fully applied. (e.g. Maybe >>> String). >>> A specialized Marshaling instance is then generated for each of >>> these instances. >>> * Generates FFI exports for any function you mark, with FFI compatible >>> type >>> * Properly supports marshaling of lists. [Int] >>> * Supports Ptr, FunPtr and StablePtr. Which introduces the possibility >>> to have caches/sessions. >>> * Supports Callbacks via Higher order functions (everything is auto >>> generated from the function type) >>> * Re-exports existing exports found in source file >>> * Honors existing Storable instances found for types it needs >>> * Avoids unsafePerformIO as much as possible, except for in one >>> specific instance. >>> * Generates Initialization functions for you >>> * Hides unnecessary exports using a DEF file >>> * Allows you to override default type conversions (e.g. String –> >>> CWString) >>> * Provides helper includes for C, C++ and C# (placed into wherever >>> cabal places extra includes. %AppData%\cabal\Hs2lib-0.4.8 for windows) >>> And more >>> >>> Details >>> ===== >>> >>> A more detailed documentation will follow in the next few weeks. >>> >>> Why 0.4.8? >>> -------------- >>> >>> This project has been in development for a very long time. Nearly two >>> years on and off. >>> It was developed mainly to facilitate the creation of Visual Haskell >>> 2010. This is just the first public >>> release of this tool. >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> [email protected] >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> >
_______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
