by sapek · 11y ago · 0 comments
Im working on something that can have a lot of dependencies in thirdparty libs, so i need to minimize the dependency side-effects.. so despite the fact i like this more than protobuf, i'll have to stick with it (cap'n proto had to rewrite from haskell to c++ because of this).
PS: Oh no, The haskell inquisition downvotes (as expected)
I think you dont read what i've wrote, or more likely, im explaining it poorly(not a native, sorry) . This can be a binary to compile and create source code, but also and often can be embedded to be used as a library.. im guessing you are using Windows because you've said you dont have a c compiler at hand.. but Windows are most a end-user thing, and end-users probably wont care about compiling code.. otherwise a c/c++ compiler is ubiquotous
Im not complaining about the tool, but about the use as a library, which is something this also aim to be, and C is a better aim at that because can be embedded in any language.. given the compiler is in haskel i cant access the AST for instance, i cant embed in my binary, but have to call another external binary instead.. but at least have a runtime to embed.. this may be ok for some.. but i was just saying that, despite the protocol language being very good, i couldnt use it instead of protobuf because i would have a more limited api and my end program/ goal would lose power and flexibility.
This is a pretty technical explanation, it could be coded in Brainf*ck.. nothing against the lang in itself.. is just that it limits the use case of this tool(as compared with protobuf)
ghc is pretty ubiquitous these days. Any serious linux distro will have a package so it's one line (apt-get install ghc or similar). Even on e.g. a mac it's no harder than installing ruby or python.
> given the compiler is in haskel i cant access the AST for instance, i cant embed in my binary, but have to call another external binary instead
You could write Haskell. It's a pretty nice language.
More to the point, Haskell does have a C FFI and allows you to build a library that exposes a C interface that C programs can link against. I don't know whether the authors have done that here, but the functionality is available.
I don't think you really understand what GHC is. GHC can compile Haskell down to C or Assembly, and has an FFI to make Haskell embeddable in C. The runtime for GHC is not like the runtime for Java or other VM/Interpreter-based languages...Haskell can be compiled and embedded to turned into a shared library to be distributed with your code.