3 ms·
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
by oblio 6y ago
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).
- pjmlp 6y agoJava 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.
- oblio 6y ago> 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-have-a-linker/ https://www.joelonsoftware.com/2004/01/28/please-sir-may-i-h... (which I agree with)
- pjmlp 6y ago> 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.
- oblio 6y agoI 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.
- pjmlp 6y agoThe 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.
- oblio 6y agoIt 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 ;-)
- strzibny 6y agoRuby 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-packer/ https://nts.strzibny.name/making-a-ruby-executable-with-ruby...