Hacker News new | ask | show | jobs
by sapek 4181 days ago
You need Haskell only to build the Bond compiler. Once you do that, you get a native, stand-alone executable for your system (you don't need Haskell to run the Bond compiler). You use the Bond compiler as part of build process for programs using Bond. Programs using Bond don't have any Haskell dependency.
2 comments

Just to emphasize(so that my comment dont get misunderstood somehow) that this tool is really good and well designed, so thank you for sharing with us!
Im sure there's no problem to distribute it in binary form, the problem would be in the source code distribution, giving you add the dependency on the GHC compiler for everybody/dev that need to build the program.

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)

You're being downvoted because your point is nonsensical. First, GHC is not the same as requiring Java, since you don't need it to run the code. If you replaced Java with C++ your first comment would be more accurate. Second, complaining you need a compiler for Haskell to compile the source code version...you might as well complain you need a C++ compiler to compile your code. I know I don't have a C++ compiler installed, so how is installing GHC any more onerous than installing G++?
>First, GHC is not the same as requiring Java, since you don't need it to run the code

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)

> end-users probably wont care about compiling code.. otherwise a c/c++ compiler is ubiquotous

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.

No, I'm a long-time Linux user. I don't install G++ because I don't need it (I work in Haskell and Python) and I try not to install unnecessary packages or remove them when I'm finished. You do generally need gcc (or clang) in Linux, but not all distros distribute g++ in their gcc.

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.