DEV Community

Cover image for Apple wants to remove scripting languages from macOS

Apple wants to remove scripting languages from macOS

stereobooster on August 31, 2019

Scripting language runtimes such as Python, Ruby, and Perl are included in macOS for compatibility with legacy software. In future versions of mac...
Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

"Scripting language" has always struck me as a weasel word. It lacks a formal definition, but is applied liberally to any language which a developer deems "not a real programming language" (whilst turning up their nose in bourgeois disgust.)

If they mean "interpreted language," that's something specific, but it would also mean dropping Java.

And...legacy? Since when is Python "legacy"? It's one of the most popular application development languages today, fer cryin' out loud. (On that note, Ruby and Perl aren't even remotely "legacy" either.)

I have a theory what's going on, though...I think Apple is just trying to "encourage" (force) developers to use their in-house languages, and build more Apple-only software. It's the whole walled-garden game again.

But then, I started boycotting Apple products four years ago, when they started explicitly blocking Linux from being able to communicate with iDevices. (And yes, tech support confirmed this.) Dirty pool is just their game.

Apple lovers: come to Linux! There's freedom on this side of the garden hedge. ;)

Collapse
 
ben profile image
Ben Halpern

I agree with this sentiment. I really need to get on the Linux train.

Collapse
 
codemouse92 profile image
Jason C. McDonald

Both Ubuntu and MATE can be customized to look like macOS, just FYI. ;-)

Thread Thread
 
xendke profile image
Juan Xavier Gomez

elementaryOS is worth a try too!

Thread Thread
 
mandaputtra profile image
Manda Putra

Is elementaryOS run smooth on 4Gb RAM? last i tried was version 0.2.2 so many glitch, how much RAM do you had?

Thread Thread
 
zorexsalvo profile image
Zorex Salvo

Yes, elementaryOS (0.4 Loki) ran smooth on my 4GB machine.

Collapse
 
jefftriplett profile image
Jeff Triplett (he/him)

This is a really good point. As a Python developer, the very outdated system Python is a pain and is troublesome for everyone. I gave up years ago on Homebrew's Python3 even and switched to pyenv and never looked back. I suspect this isn't a unique annoyance for Python.

Collapse
 
wrldwzrd89 profile image
Eric Ahnell

Homebrew could work around the lack of pre-installed Ruby by updating the installer to include the proper version of Ruby where Homebrew expects to find it - thanks to using an install script, Homebrew isn't actually the worst off. What gets hit especially hard are command-line programs that DON'T use installers, written in one of the affected languages.

Collapse
 
thorstenhirsch profile image
Thorsten Hirsch

As long as homebrew works your scripts are fine, because you can do "brew install ruby" (or rbenv if you need more control).

Collapse
 
stereobooster profile image
stereobooster

yeah exactly my point, but homebrew itself is written in ruby

Thread Thread
 
maniflames profile image
Maniflames

Homebrew's creator commented on this on Hacker News. Unfortunately I can't find it but the solution is basically that they will add ruby to their installation process. A homebrew forum leader addressed it here.

Actively maintained projects will be fine. The ones who aren't will break unless you install the runtime you want yourself.

Collapse
 
yaser profile image
Yaser Al-Najjar

Lame move from Apple, pretty Apple-ish though.

Collapse
 
jwkicklighter profile image
Jordan Kicklighter

This actually brings MacOS much more aligned with Linux philosophy. Most distros don't have tons of scripting languages installed by default, really just Python if I remember correctly. Bring your own toolset is much preferred in my opinion.

Collapse
 
yaser profile image
Yaser Al-Najjar • Edited

Yep, but Python is pretty important cuz I'm pretty sure there will tools needing that (even inside the OS).

Update: seems like Automator uses it

Thread Thread
 
jwkicklighter profile image
Jordan Kicklighter

There's nothing to say a new release of Automatic won't bundle a python interpreter or give you a prompt that installs it (much like how Xcode installs CLI tools). That sounds like what Apple is urging devs to do, so I'd assume they will do the same with their apps.

Collapse
 
gcorrel profile image
gcorrel

What's their major purpose then? Or what are they aiming to achieve with that? Ridiculous to me.

Collapse
 
ltvan profile image
Van Ly

Why is this a lame move? By removing factory outdated packages, you can use the version that you want without afraid of conflicting issues.

 
ben profile image
Ben Halpern

Good points. I have a soft spot for pre-installed Ruby because it helped me get started with Ruby development using campus machines back in the day.

Typing irb on any Mac and hacking on some Ruby is a pretty nice feeling.

Collapse
 
jeikabu profile image
jeikabu

Doesn't seem like a huge deal to me.

I don't use all those languages, but the bundled version was usually an older one. More often than not you couldn't use it, and I just ended up installing the latest anyway.

Pretty sure most (if not all) have macOS installers.

They're not saying those languages are legacy, they're saying (other) legacy software is dependent on those pre-installed runtimes.

Seems to me like they're just not going to provide a decrepit version by default anymore. They're not pre-installed on all Linux distros or Windows. Seems like a sane thing to do to me.

Collapse
 
jeikabu profile image
jeikabu • Edited

Python 2.7.10 (2015)
Perl 5.18.4 (2014?)
Ruby 2.3.7 (2018)

So, not that old- especially Ruby.
I guess the point is the title makes it sound like Apple is "banning" scripting languages, which is not the case.

Collapse
 
3rror profile image
Gianluca Andreotti

Homebrew can't be easily rewritten in some other languages without denaturalizing it.

Homebrew is composed by the core tools and the formulas and while you can remake the first ones in some other languages, the problem lays with the last ones.

Formulas are written in Ruby, using a DSL combined with shell commands: you can check yourself with a simple brew edit wget.
This is different from usual Linux package managers who often rely on (almost) plain shell scripts. Because building instructions are Ruby code, Homebrew can often understand what the code is doing and not just merely executing it.

This characteristic is probably one of the advantages of Homebrew over other package managers and you can't easily replicate it if you rewrite it in other "more native" languages.

In the end, I think this move from Apple is a good thing: many Unix tools shipped with macOS are very old. For example, the bash version in Mojave is from 2007 (for license reason). Python and Ruby are also not at their latest version forcing many software like Homebrew to not use many optimizations and features. Moreover, many developers who use these languages need multiple versions of them, and they install them with tools like rbenv or pyenv.
I think is a good thing letting the community finds and provides the best way to install these interpreters instead of keeping old tools around and letting them rot for ages.

Collapse
 
moopet profile image
Ben Sinclair

This will be slightly annoying for my job, where I have to use a Mac, I guess. But since almost everything I do runs inside docker containers which don't have this problem, I don't really care.

Apple can do whatever they want with their OS. It's not a development platform, it's a consumer desktop environment, and getting rid of obsolete versions of software makes sense, right? So they should ditch the version of bash they use that's from the 12th century. Except they can't because newer versions use licenses they don't like.
So rather than maintain semi-recent versions of software that's better served by containers, or old versions because of political reasons, just get rid of them. Most of the users won't notice.

Collapse
 
jwkicklighter profile image
Jordan Kicklighter

This is exactly what I was thinking. Please get them out of my way so I don't have to remove them or try and get them out of my PATH. If you're going to install Homebrew, it's not much harder to also install Ruby or have the project do so for you. Linux distros don't come with tons of scripting languages, you have to install most of them if you want them.

Collapse
 
daoswald profile image
David Oswald

Scripting languages may mean interpreted, and those include Javascript, HTML, Bash, Python, Ruby, Perl, make, awk, sed, Regexp engines embedded in grep, vi(m)'s config language, ... the list goes on and on and becomes esoteric at times. It's unclear to me why some might be chosen for elimination and not others. But I hope they go down this path while simultaneously producing ever worse keyboards; I need more people in my organization to push back and select a Linux based laptop for the good of those of us who have resisted the org's desire to optimize for IT rather than for those of us producing the code that provides the services we sell. Devs with Macs are almost cliche. I'd love for that to not be such a ubiquitous way of life.

Collapse
 
ltvan profile image
Van Ly

I don't know what all you are arguing about. They just remove preinstalled out-dated packages, which, as a dev, everyone prefer not to use and always installing a replacement like rbenv, python3. Homebrew already did check if ruby isn't available, then download it, as for old MacOS and Linux system.

Collapse
 
wrldwzrd89 profile image
Eric Ahnell

I would know - my "mass_scale2x" Python CLI program, which isn't published, is one of them. Fortunately, the issue is fairly easy to solve, since a published version would ALREADY have this problem by reliance on Python 3, which macOS does not include.

Collapse
 
erikusaj profile image
Erik Ušaj • Edited

Common internet generation skip reading problem, some of us cannot read as expected:
"bundle the runtime within the app."

Simple as that.

if (myApp.reliesOnScriptingLanguage && myApp.targetOS==macOS) {
buildScript.bundleRuntimeInstsller = true
}
else
{
buildScript.bundleRuntimeInstaller = false
}
buildScript.build()

Of course leave Runtime version hell to end users.

imho. Homebrew already installs some Ruby runtimes on Linux.

Actually:
"homebrew will pull in a temporary ruby binary to install itself (as it already does on linux and has done on older macOS versions"

Source: discourse.brew.sh/t/mac-os-depreca...

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Not bundling Python 2.x certainly makes sense, but that doesn't mean they should be dismissing bundling Python 3. Updating the runtimes is the only thing that makes sense...every other UNIX-like system does exactly that.

The issue, I believe, comes to when you have to ship to the end-user. In my experiencing, installing runtimes on Apple is not a piece of cake by default. A lot of non-tech-savvy users won't be willing to follow a long process to get some weird thing called (say) "Python" installed, just so they're able to run software. It's not like on Windows, where you only have to run a simple installer script...unless something has profoundly changed in the past year on the Apple ecosystem?

Now, sure, you can bundle the runtime, but this is an additional Apple-targeted packaging step that can be a pain in the butt for the developer.

It's practically impossible (although not technically) for Apple to block these languages from the platform altogether. The way I see it, this is the strongest action they can cook up a psuedo-justification of, wherein they discourage use of the language.

Collapse
 
jokeyrhyme profile image
Ron Waldon

I, for one, welcome this move

One of the difficulties with getting started as a Python or Ruby developer on macOS is coming to terms with globally installed interpreters and packages, and how these can clash with those in your projects

It also means there won't be future compatibility problems with interpreters being end-of-life'd, as in the case of Python 2.x

Collapse
 
sur0g profile image
sur0g

Does all the macs there lack for 30m disk space? 😂

Collapse
 
ltvan profile image
Van Ly

Just download ruby if not found. They already did that.

Collapse
 
gnsp profile image
Ganesh Prasad

Including shell scripts ?
In any case this move doesn't seem to make any sense, does it ?

Collapse
 
mustapha profile image
Mustapha Aouas

Thanks for the heads up. This move shows how little consideration they have for non iOS (or macOS) developers. Pretty lame and sad 😔

Collapse
 
shellking profile image
shellking

Comes down to the old adage - 'control the ENTIRE stack'
This way nothing can harm what you release(permit) ....

Collapse
 
aamonster profile image
aamonster

Mwa-ha-ha.
Did they rewrite xattr (and maybe other system tools) to avoid python already?

Collapse
 
wagyourtail profile image
wagyourtail

I think javascript is kinda important... also there are a bunch of good programs coded in python ie. Blender

Collapse
 
darthhack profile image
DarthHack

Pretty amusing that AppleScript isn’t included in the list of legacy scripting language runtimes as it is probably the only one which actually is a legacy scripting language.

Collapse
 
motss profile image
Rong Sen Ng

Rust could be a good fit.

Collapse
 
aghost7 profile image
Jonathan Boudreau

I think what they'll have to do is bundle the interpreter along with homebrew. Either that, or they'll have to rewrite the homebrew installer (not the entire cli) in a different language.

Collapse
 
jokeyrhyme profile image
Ron Waldon

The Linux version of Homebrew already downloads Ruby when it needs to, so they'll probably enable that functionality in the macOS version

Collapse
 
mrlarson2007 profile image
Michael Larson

Yes they get in my way too. I need newer version of Python then the one that is installed by default.

 
ltvan profile image
Van Ly

I don't understand what you mean yet?