5 ms·
What scripting languages come out of the box on Debian 12?
- z3t4 2y agoWhat about compilers? What is an OS without a compiler?
- deleted 2y ago[deleted]
- ziotom78 2y agoIt's called “Windows”
- flohofwoe 2y agomacOS and Linux too though? As far as I'm aware, most Linux distros need the build-esssentials (or equivalent) package installed, and on macOS the Apple Clang toolchain also isn't pre-installed. Both is quite similar to installing the "MSVC Build Tools" (MSVC command line toolchain without the Visual Studio IDE).
- pjmlp 2y agoAnd all commercial UNIXes, mainframes, micros, embedded OSes, game consoles. Turns out not every deployment scenario needs a compiler, and it is still an opportunity to make money outside the FOSS world.
- hnlmorg 2y agoCompilers are generally separate packages rather than part of the base install.
- pjmlp 2y agoAn opportunity to make money, commercial UNIXes eventually started selling their compilers as well, a practice started by Sun.
- deleted 2y ago[deleted]
- supriyo-biswas 2y ago> Knowing that a language is installed by default on the most popular Linux distribution can simplify certain concerns considerably The author laments the decline of such knowledge, but the proliferation of containers, combined with the marketing efforts of the large cloud providers has reduced the number of people who work with servers directly. I should say that this knowledge can be useful in certain niche situations, though. For example, I recently learned that GitHub Actions pulls in a basic set of utilities by using complicated distro detection[1], and Gitlab runners similarly pulls in a Docker image with git just to clone a repository! Instead, the proper way to address this situation would be to compile static binaries, that, by their very nature, become distribution agnostic. The only reason I assume this wasn't pursued, I assume, would be that the developers working on this weren't even aware this was an option. It's the reason I've been maintaining a small set of packages[2] that I mount into every CI container for my personal projects. I'm also quite hopeful about the cosmopolitan project[3] that builds fat binaries which can bridge this gap, although as I discovered, some containers even lack tools like gzip (which cosmopolitan depends on), so maybe static binaries it is. [1] https://www.youtube.com/watch?v=9qljpi5jiMQ https://www.youtube.com/watch?v=9qljpi5jiMQ [2] https://github.com/supriyo-biswas/static-builds https://github.com/supriyo-biswas/static-builds [3] https://github.com/jart/cosmopolitan/ https://github.com/jart/cosmopolitan/
- hnlmorg 2y ago> Instead, the proper way to address this situation would be to compile static binaries, that, by their very nature, become distribution agnostic. Thats only true if you do not depend on glibc, which some statically compiled binaries still do. And even then, you’d have to rule out anything that requires newer sysalls or platforms that don’t offer stable ABI guarantees (Linux is actually the edge case here in that most kernels offer no guarantees). It’s certainly doable though.
- arccy 2y agoit's not really static if you depend on glibc... things can still break, e.g. when compiled on too new glibc it fails to run on older versions.
- regularfry 2y agoA reminder that interpreters installed with the OS are for the OS, not for you. Plan on installing your own so that you can control versions, libraries, and packages. (Yes, this post is about "in extremis" dev where you may not be able to do this. Still.)
- rini17 2y agoNonsense. Bash is for the OS not for you too? Python's standard library covers most scripting use cases, even HTTP networkingand it's stable you can write script and forget. No need to "control" stuff. For example I am using minimal python script + cron for updating letsencrypt certificates in misc linux distros. Everywhere it's system python out of the box without any additional dependencies or virtualenvs.
- xarope 2y agoThat's why I learned REXX in ye-olde days, because it came installed as default on IBM systems (and not Perl, which was my de-facto prior to). Then python. Nowadays Go(lang). Still trying to decide if it's worth going to Rust for script'ish type work, I have a feeling it's not quite the right choice.
- p_l 2y agoPython versioning is BS enough and with enough systems problematic enough that for scripts that have to assume widest range? I torture them with POSIX sh.
- flohofwoe 2y agoAt least on macOS, Apple strongly discourages depending on the builtin scripting languages, and AFAIK python is no longer preinstalled (instead installing Xcode for the first time will slip a python3.9.x and pip3 into your /usr/bin). Of course you can depend on zsh/bash, but then the Apple UNIX tools are BSD flavoured, not GNU flavoured like on Linux, so Linux shell scripts will also quite often not work out of the box on macOS.
- 2y ago
- hnlmorg 2y agoWould ‘bc’ also count? You can do scripting in it albeit more for mathematical functions. I can’t recall if it’s part of Debian base though.
- hiAndrewQuinn 2y agoI totally forgot about `bc`! That should certainly count, I remember it having way more under the hood than a "mere" calculator program normally would.
- fanf2 2y agoHow about ex? (headless vi)
- enriquto 2y ago> 5. sed, if you count that (I do) If they count sed, they should definitely count vimscript !
- pjmlp 2y agoThis is the reason why I mastered enough vi to be dangerous, back in the day, Emacs / XEmacs were usually an additional package, while any sort of commercial UNIX had vi on its default install. Being sent down into the field, rescuing whatever random server used by a customer, meant being able to use whatever was there, and between ed and vi, better vi.
- m1keil 2y ago> I don’t know why I don’t hear this point get more airtime among people when discussing the pros and cons of Python/Perl as scripting languages. But it is. Perl and awk one liners are very common. Bash is used everywhere you have the (controversial) `sudo curl .. | bash -` install method. Ansible, if I'm not mistaken, requires python3 installed on remote hosts. If your environments are homogeneous enough, and you don't have a large matrix of operating systems, you should definitely use this advantage. The troubles start when you have very heterogeneous environment, custom or hardened Linux distros and etc. It might seem like this is not being utilised as much nowadays, but I suspect it's because the "classical" Linux sysadmin roles are rare and you don't hear about it as much.
- hiAndrewQuinn 2y agoHaving recently started to experiment a lot with the BSDs (mostly Free, a little Open), which often don't come with even Bash out of the box (usually still Perl though), I can definitely relate to this. The more complex your workplace's OS ecosystem, the harder it gets to write anything which will truly run everywhere, unless you go all the way down to POSIX shell.
- m1keil 2y agoYep. I assume everyone already knows that, but shellcheck is great help if you need to go all the way down to POSIX since it will detect /bin/sh shebang and warn about any non-compatible bash-ism.
- em500 2y agoWhere does the expectation come from that Bash should come ootb with BSD? Or anywhere else outside of mainstream Linux distributions with GNU userland? Bash is the standard Bourne/Korn-like shell for the GNU project, which was envisioned as a FSF Unix clone/replacement. BSD and other Unix-like systems pretty much always had their own separate userland, with often different syntax than the GNU tools. I think the odd one out was really Apple, which ran Bash as the standard shell for many years (a choice they probably regret), while most the rest of the userland was largely from BSD.
- counterpartyrsk 2y agoPerl 5? What version? Perl has been on that major version for some 20+ years, right?!
- Calzifer 2y agoAnd will likely remain with that major version for the next 20 years since Perl 6 became Raku. https://en.wikipedia.org/wiki/Raku_(programming_language) https://en.wikipedia.org/wiki/Raku_(programming_language)
- maleldil 2y agoThere will be a Perl 7[1], essentially Perl 5.32 with a new name. [1] https://www.perl.com/article/announcing-perl-7/ https://www.perl.com/article/announcing-perl-7/
- fanf2 2y agoThey gave up on that plan. https://blogs.perl.org/users/psc/2022/05/what-happened-to-perl-7.html https://blogs.perl.org/users/psc/2022/05/what-happened-to-pe...
- alganet 2y agoMore interestingly, it would be nice to see their reverse dependencies: $ apt-cache rdepends --installed sed sed Reverse Depends: xml-core fuse3 Anyway, sh, awk and sed are there because it is mandatory: https://en.wikipedia.org/wiki/List_of_POSIX_commands https://en.wikipedia.org/wiki/List_of_POSIX_commands Perl and Python seems to support a lot of OS userland. If you have GNOME, you probably have the gjs command too. It's a JavaScript interpreter.
- contrarian1234 2y agoWhen did Python join the list? I remember I used to use Debian instead of Ubuntu b/c a minimal install didn't include Python
- dugite-code 2y agoAccording to this it's been shipped buy default for at least 11 years now: https://unix.stackexchange.com/questions/24802/on-which-unix-distributions-is-python-installed-as-part-of-the-default-install https://unix.stackexchange.com/questions/24802/on-which-unix...
- contrarian1234 2y agoThat's probably only true on a full install. Something like Gnome or KDE will obviously drag in Python. But a minimal install with something like fluxbox would not
- gorgoiler 2y agoCuriously, I get why Go doesnt include the source code in its binaries — presumably a hangover from the long standing tradition of source for me but not for thee, as well as sever constraints on resources meaning source-included would be a frivolity — but are there compiled languages where it is an option to include the source? The only one I can think of is TypeScript where it builds source maps to help debug the underlying JavaScript without having to see it.
- usrusr 2y agoHad the same thought recently. But it would be easy enough to make a "go script" frontend that checks for a compiled version, checks the source against a hash stored with that compiled version and shortcuts to the binary if everything matches, (re)creating it if not.
- forrestthewoods 2y agoMy opinion is that source code should be packaged up with debug symbols. I'm also a fan of breaking out debug symbols from the exe although that's a separate topic.
- hiAndrewQuinn 2y ago(This page will briefly be down, as I add my new X profile at https://x.com/hiAndrewQuinn https://x.com/hiAndrewQuinn to its frontpage. Give it maybe 2-3 minutes from the time of this comment. God bless Hugo for being so fast to recompile. EDIT: Nevermind it was more like 30 seconds!)
- globular-toast 2y agoUnfortunately the Python 3 debacle kind of ruined standalone Python scripts. At least for a while. Have distros gone back to having "/usr/bin/python" available (as opposed to "python3" or something else)? I bet there's still loads of system in the wild without a "/usr/bin/python", though.
- Calzifer 2y ago> Have distros gone back to having "/usr/bin/python" available (as opposed to "python3" or something else)? Debian provides two packages python-is-python3 and python-is-python2 to restore the /usr/bin/python.
- maleldil 2y agoScripts should be using `/usr/bin/env python3` anyway, so they work inside virtualenvs and other scenarios where `/usr/bin/python` isn't the Python you want.
- yjftsjthsd-h 2y agoWhat's wrong with explicitly using "python3"? I guess maybe in theory you could maybe write a script that was compatible with both 2 and 3 but that sounds needlessly masochistic, and if there were ever going to be a python4 you wouldn't want to accidentally switch to it automatically either.
- toolslive 2y agom4?
- nbabitskiy 2y agoЯ 333