{"@context":"https://w3id.org/codemeta/3.0","@type":"SoftwareSourceCode","identifier":"pkg:hackage/protobuf-native","name":"protobuf-native","description":"\n\nprotobuf-native uses the code generated from protobuf for C++\nin Haskell.\n\n\n\n[Index]\n\nPackage maintainers\n\nFor package maintainers and hackage trustees\n\nCandidates\n\n\n\nprotobuf-native uses the code generated from protobuf for C++ in Haskell\nto go between Haskell and protobuf data structures.\n\nIt makes use of Template Haskell to assist in generating the interface\nbetween protobuf and your data structures.\n\nObjects have finalizers so you never need to worry about memory management.\n\nprotobuf is a Template Haskell splice that takes the file path to a\ncompiled protobuf object file and the name of the data type you want to\nbuild bindings to.\n\nThe data type must:\n\nFor example, if we have a Person protobuf structure in the file person.proto:\n\nFirst we run protoc --cpp_out=. person.proto then compile the person.pb.cc\nfile. Unfortunately, at this point, you need to mangle the C++ header file as\nper the Protobuf Mangling Guide below, ideally this would be automated.\nDo not re-run protoc unless you want to re-mangle the file.\nAlways check these files in to source control.\n\nThen we can write two Haskell data structures to represent these types:\n\nIf you get any of this wrong, you will get a compiler error.\n\nNote that NameT is the type of the name field in PersonT. With data\nkinds you may get confusing error messages here.\n\nNow we can:\n\nThe C++ are ForeignPtrs with finalizers, so you do not need to free anything.\n\nWorking with Cabal requires extra build steps. See this project's Setup.hs\nfor an example on how to run protoc and clang++ in the build phase.\n\nThe property above is used by QuickCheck to test the library works.\nThe tests are located in tests/Tests.hs.\nNamely, for all types in Protobuf the following property holds:\n\nBy profiling the tests you can verify the library does not leak memory.\n\nThis is a temporary measure until we make a post-processor for protobuf header\nfiles.\n\nThis is an inline function that must be un-inlined.\n\nGo to the header file and search for that function name (in this\ncase clear_firstname). You will find two occurances:\n\nRemove the inline from both of these.\n\nGo to the header file and find set_lastname and remove the inline. It may also\nlook like an field name, such as:\n\nRemove the inline from:\n\nWhen dealing with a string setter, you only need to un-inline the std::string\nfunction. I.e.\n\nThis is currently another work around that is fixable.\n\nIf your problem has performance constraints you may want to consider using this\nlibrary. When working with large protobuf files, you may want to write file\niterators / network operations in C++ and process the data in Haskell.\nThis library lets you only pay for converting the parts of the data\nstructure you need. You can, for example, iterate over a large file 20\nelements at a time and only pull out the components of the protobuf structure\nyou need to pass to Haskell.","version":"1.0.0.1","softwareVersion":"1.0.0.1","license":"https://spdx.org/licenses/BSD-3-Clause","codeRepository":"https://github.com/nicta/protobuf-native","issueTracker":"https://github.com/NICTA/protobuf-native/issues","url":"https://github.com/nicta/protobuf-native","keywords":["bsd3","data","library","program","Propose Tags"],"programmingLanguage":{"@type":"ComputerLanguage","name":"Haskell"},"maintainer":[{"@type":"Person","name":"MaxwellSwadling"}],"author":[{"@type":"Person","name":"MaxwellSwadling"}],"copyrightHolder":[{"@type":"Person","name":"MaxwellSwadling"}],"dateCreated":"2014-10-15","dateModified":"2014-10-16","datePublished":"2014-10-16","copyrightYear":2014,"downloadUrl":"https://hackage.haskell.org/package/protobuf-native-1.0.0.1/protobuf-native-1.0.0.1.tar.gz","applicationCategory":"hackage","runtimePlatform":"hackage","developmentStatus":"active","sameAs":["https://hackage.haskell.org/package/protobuf-native"],"https://www.w3.org/ns/activitystreams#likes":7,"https://forgefed.org/ns#forks":5}