Hacker News new | ask | show | jobs
by satyenr 2355 days ago
C, C++, D, Nim, Haskell, OCaml, Rust, Swift, Objective-C, Crystal..... the list goes on. Many of the languages have a native code implementation in addition to an interpreter or a byte code compiler — e.g. Common Lisp (SBCL), Scheme (Chicken Scheme), Kotlin/Native.....
1 comments

I was looking for languages which produce binaries which are self contained (in terms of being statically linked OR dynamically linked with few dependencies) close to what go produces, out of a default build process.

I guess with musl C, C++ and Rust can do that though it is a bit of work.

OCaml seems to link only to non OCaml stuff dynamically, which fits the bill too.

Why does default build process matter? Once you haven figured it out and automated it (say, using a makefile), it doesn’t matter whether you’re using a default build process or not.

Also, the likes of Haskell let you build binaries dependent only on OS provided libraries whereas the likes of Nim compile to C. You might want to play with the short listed languages to get an idea. A simple Hello World will tell you what they link with by default. Anything beyond that is up to you.

I was actually wondering with all these new languages like zig, Odin and v are there any that produce dependency free binaries.

I've done some work in rust, c++, and nim before. But looking at some of the comments here and rethinking the pros and cons it seems a fully self contained binary might be more trouble than it's worth and some dependency is fine as long as an easy to use packaging and deployment process is found.

Sorry the question was a bit vague. I don't think I explained well what I was looking for.