News for hackers. Stuff that matters.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by loosescrews on Wednesday December 09, 2020 @06:31PM (#25367042)
Do they? As far as I know, Go is the only mainstream language that supports static binaries with normal non-trivial programs. Rust for example depends on dynamically linked libc if you use the standard library. While you technically can statically link libc, it is unsafe with glibc.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by kibwen on Wednesday December 09, 2020 @07:20PM (#25367646)
I think the belief that Go does no dynamic linking whatsoever is outdated; I seem to recall that they recanted this approach on Mac and Windows since these platforms only offer a stable system interface via dynamically-linked libraries, and trying to re-implement all of it ended up being a lot of work only to end up with broken code after system updates. On Linux I think Go still tries to link mostly statically, but if you use parts of the stdlib (e.g. `net`) you'll still end up dynamically linking to libc unless you instruct it otherwise. If anyone more knowledgeable could speak up I'd welcome it.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by loosescrews on Wednesday December 09, 2020 @09:38PM (#25368955)
Go supports dynamic linking and most Go binaries will be dynamically linked. On Linux, this is mostly due to optional features which can be easily disabled. The optional features are all related to supporting rare and unusual system configurations and do not affect normal operation. Note that cross compilation with Linux as the target does not support dynamic linking, so all Go Linux binaries compiled on a non-Linux OS will be statically linked.

Regardless of how we scope it, Go is still the only mainstream language capable of producing statically linked Linux binaries without libc while still allowing full use of the standard library.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Thursday December 10, 2020 @02:34AM (#25370916)
C with musl does just fine.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by sim_card_map on Wednesday December 09, 2020 @08:17PM (#25368244)
This is correct.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by hetman on Wednesday December 09, 2020 @09:22PM (#25368818)
Rust has supported statically linking to MSVC and musl for a while now but also added static glibc support on Linux very recently:

https://github.com/rust-lang/rust/pull/77386

Re:Deno 1.6 supports compiling TypeScript to a single execut... by loosescrews on Wednesday December 09, 2020 @09:42PM (#25368995)
Is it possible to compile with statically linked musl with the pre-built Rust toolchain on a standard glibc based distribution?
Re:Deno 1.6 supports compiling TypeScript to a single execut... by SomaticPirate on Wednesday December 09, 2020 @10:31PM (#25369324)
Re:Deno 1.6 supports compiling TypeScript to a single execut... by saagarjha on Thursday December 10, 2020 @05:13PM (#25379495)
musl is generally not optimized for performance.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by mkj on Thursday December 10, 2020 @01:43AM (#25370582)
Yes, it works well. The main caveat I've found is you need the rustls feature of packages rather than openssl. Though perhaps that was more related to cross compiling for Arm.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Wednesday December 09, 2020 @06:43PM (#25367185)
Ada, FreePascal, C and C++ do perfectly fine.

Not everyone is using Linux with glibc linking issues.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by loosescrews on Wednesday December 09, 2020 @09:43PM (#25368999)
Using C and C++ without libc excludes the use of nearly all common libraries.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Thursday December 10, 2020 @02:30AM (#25370881)
glibc is the problem, other C and C++ standard libraries don't have any issues with static linking since these languages exist for about 40 years now.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by remexre on Thursday December 10, 2020 @02:03AM (#25370721)
libc's other than glibc don't have issues with being statically linked.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by mrkurt on Wednesday December 09, 2020 @06:37PM (#25367130)
Rust and Deno qualify as a "single executable" for what I need, but you're basically correct. It's not quite as dependency free as a Go binary.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by lucacasonato on Wednesday December 09, 2020 @06:48PM (#25367253)
We currently do dynamically link to glibc. But we could in theory support musl, which would remove our dependance on the glibc dynamic link.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by lock-free on Wednesday December 09, 2020 @06:54PM (#25367329)
That's why you statically link musl C