V Forum

[ log in ]

Is it a statically compiled language?

tobyjwebb 2019-04-18 06:38
Is this going to be a statically compiled language like Go, or will the binaries depend on external libraries?
medvednikov 2019-04-18 11:59
There's a libc dependency, so not quite like Go.
medvednikov 2019-05-03 22:57
Actually I just found out that as of Go 1.12, binaries are dynamically linked to libc on macOS, Solaris, and Windows.

Also, if you do networking, libc is used on Linux as well.

Using libc is preferable to unstable and undocumented raw syscalls.

Everything other than libc is linked statically, so I would say the answer to your question is yes.
tobyjwebb 2019-05-03 23:35
Wow! Didn't know that...
iangudger 2019-06-23 17:01
macOS, Solaris, and Windows have unstable syscall ABIs. Linux is different. The Linux syscall ABI is considered to be part of the compatibility surface and therefore very stable as Linux takes breaking compatibility very seriously. Also, in my experience, the libc documentation applies to the backing syscalls pretty well.

The net package in Go only uses libc as a fallback for a few edge cases in DNS resolution. In normal usage of the Go net package on Linux, libc is linked in, but not used. Disabling cgo for the Go net package on Linux will not result in a change in functionality or behavior for most users and is done automatically for cross compiling.

There are a lot of reasons not to use libc. Is Go going to remain the only language that allows full use of its standard library without it?
medvednikov 2019-06-23 22:58
That would align with the philosophy of V, so I would say it will definitely happen, but only for Linux.

Do you know if FreeBSD's syscall API is stable as well?



Powered by Vorum, open-source blogging/forum software written in V