News for hackers. Stuff that matters.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Wednesday December 09, 2020 @06:46PM (#25367225)
Same here, the static linking hype feels real strange, given that was the only option we used to have back in the day, and having access to dynamic linking on 16 bit platforms felt like liberating.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by simias on Thursday December 10, 2020 @06:36AM (#25372563)
I don't really see the hype, I think it's just the intersection of a few factors:

- Languages like Rust which have an ecosystem that evolves very quickly (and uses complex symbol mangling schemes that would break all the time) wouldn't fare very well with dynamic linking in the first place. What good is dynamic linking if you need a different version of your .so file for every binary?

- Dynamic linking is not quite as useful today a it was in the past. Code size is not usually very significant, either on cold storage or in RAM. Actually for RAM it's cache usage that matters most, and static linking can usually be more efficient here through LTO.

- Over the past ~2 decades a new generation of developer arrived and many of them (in my experience) barely use "low level" compile-to-machine-code languages. They often specialize in scripting languages or languages that require a framework. Some of these developers are now learning Go or Rust and for them the idea of shipping a single ELF binary that packages the entire app might be seen as a novelty or maybe even as an innovation.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by eeZah7Ux on Sunday December 13, 2020 @10:03AM (#25407007)
> Dynamic linking is not quite as useful today a it was in the past

Linux distributions need to be able to backport security fixes to shared libraries, test them and deliver updates to all users quickly.

With static linking it becomes practically impossible.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by oblio on Thursday December 10, 2020 @02:50AM (#25371006)
PHP, JavaScript, Python, Ruby, even Java and C# didn't (don't?) have a mainstream way to create a single binary with unused code and unused dependencies removed.

Dynamic linking was cool because you could use system dependencies which people don't want to use because you can't rely on them, especially for cross platform apps and also for efficiency, RAM (which people stopped caring about) and, disk space (this boat sailed a loong time ago) and compilation (we have 10000x as powerful computers now).

Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Thursday December 10, 2020 @04:07AM (#25371498)
Java has had static linking support since around 2000, for embedded deployments.

C#, yes it has been mostly dynamic.

PHP, JavaScript, Python, Ruby, don't count, they are scripting languages, bundled with an interpreter.

Still, Python and Perl bundlers exist since around 2000 as well.

Compiled languages like Basic, Pascal, Modula-2, Ada, Eiffel, Modula-3, C, C++, Haskell, OCaml, SML, .... all started in days where static linking was the main option.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by oblio on Thursday December 10, 2020 @04:14AM (#25371557)
> Java has had static linking support since around 2000, for embedded deployments.

Yeah, but for non-embedded deployments i.e. 99% of Java code out there?

> Still, Python and Perl bundlers exist since around 2000 as well.

I don't know the Perl one, but the Python ones definitely aren't mainstream. They're finicky and relatively hard to use and definitely not distributed with the Python distribution, which would make them ubiquitous and well supported.

> Compiled languages like Basic, Pascal, Modula-2, Ada, Eiffel, Modula-3, C, C++, Haskell, OCaml, SML, .... all started in days where static linking was the main option.

Every language in the olden days had static compilation support :-))

That's why we had articles such as these: https://www.joelonsoftware.com/2004/01/28/please-sir-may-i-h... (which I agree with)

Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Thursday December 10, 2020 @04:29AM (#25371664)
> Yeah, but for non-embedded deployments i.e. 99% of Java code out there?

100% of commercial JDKs have support for AOT compilation, what you are getting nowadays on OpenJDK is the free beer version of it.

> I don't know the Perl one, but the Python ones definitely aren't mainstream.

They surely were mainstream on Windows back in .com days, specially via py2exe and ActiveState tooling.

> Every language in the olden days had static compilation support :-))

Many of which are still mainstream languages.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by oblio on Thursday December 10, 2020 @04:32AM (#25371686)
I know you're aware of this, but 70% of the languages in your list are niche languages and especially for web development they weren't that popular.

It was (is?): PHP, Javascript, Java, Python, Ruby, C# or nothing.

Especially the dynamic languages are extremely popular, primarily with smaller companies and startups.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Thursday December 10, 2020 @05:11AM (#25371987)
The whole point of my discussion doesn't have anything to do in which field the languages are popular.

Zope and AOL Server teached me that those dynamic languages are really only good for OS scripting tasks anyway, but that isn't the subject of this thread.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by oblio on Thursday December 10, 2020 @07:08AM (#25372803)
It is the point of the thread :-)

For many developers, maybe the majority, those languages are their objective reality. They haven't used anything else, they might not ever use anything else.

So things which extend the range of their tools are very much appreciated.

They're not going to shun their existing programming languages because other people don't like them and they're not going to switch to OCaml or to commercial Java compilers, either ;-)

Re:Deno 1.6 supports compiling TypeScript to a single execut... by strzibny on Thursday December 10, 2020 @09:50AM (#25374215)
Ruby has some options too, one of them being ruby-packer. Here's[0] how I used it to generate single executables.

[0] https://nts.strzibny.name/making-a-ruby-executable-with-ruby...

Re:Deno 1.6 supports compiling TypeScript to a single execut... by gouggoug on Thursday December 10, 2020 @03:14AM (#25371152)
I imagine dynamic linking solved a problem for a long time that no longer is: binary size.

With internet speeds of today and immense storage sizes, the main attractiveness of dynamic linking vanished.

Re:Deno 1.6 supports compiling TypeScript to a single execut... by pjmlp on Thursday December 10, 2020 @04:04AM (#25371471)
Not everyone is blessed with such connections, without data caps.
Re:Deno 1.6 supports compiling TypeScript to a single execut... by simias on Thursday December 10, 2020 @06:28AM (#25372511)
Even then, in general code size is not a significant part of an application's size, various assets are. I'm working on a 10k lines rust application with 74 direct and indirect dependencies and the resulting static binary is less than 3MB in size (less than 1MB xz-compressed). That would've been a significant amount of storage in the 90s but it's almost negligible nowadays.

And given that shared libraries need to be installed and updated separately and they have to ship the entire code of the library (whereas a static binary can be link-time-optimized to get rid of unused code) it might not always be a win in terms of total bandwidth.