macOS deprecating scripting language runtimes, including Python, Ruby, and Perl
developer.apple.com
developer.apple.com
(As RMS wrote in 1983, "Unix is not my ideal system, but it is not too bad. The essential features of Unix seem to be good ones, and I think I can fill in what Unix lacks without spoiling them. And a system compatible with Unix would be convenient for many other people to adopt.")
Whereas such features as "background tasks" were simply a natural consequence of the architecture of Unix, Apple didn't expose that on iOS. Now they've finally gotten around to designing the background task subsystem they really want, and it's not just an emergent property of the generic Unix way. It's built for protecting battery life and privacy. It happens to be built on Unix processes (right?), but that's just an implementation detail for them.
They've been gradually deprecating Unix for 20 years, and designing the OS they want. iOS and its App Store allowed them to kill off large sections of the old interface at once. I fully expect inside of 5 years for all of Apple's operating systems to drop "UNIX" certification and become almost unrecognizable as "Unix". They've got enough market clout now that people will port Ruby/Python/Perl to a non-Unix macOS, just as they port them to Microsoft Windows.
If I'm not mistaken, current best practice is to somewhat isolate third-party developer software anyway, using homebrew, a VM or other solutions (not sure about Docker - don't use it).
I can see where it would be an issue with developing for MacOS or iOS, but third-party web development doesn't really need anything that is installed on the system, and in my experience, it's actually better not to base it on the MacOS default packages.
Maybe I'm old-fashioned (feels weird to say that as a 25-year-old, but here we are), but I quite like not having everything be in a container all the time.
Correction: Homebrew usually installs its binaries in a way that doesn't interfere with the ones provided with the system. It will occasionally override or shadow them and things will break.
That's extremely rare, these days. When a conflict is possible, they just drop the new version in the cellar and tell you what to do if you really want to risk shooting yourself in the foot.
Just like WSL 2.0 (https://devblogs.microsoft.com/commandline/announcing-wsl-2/)?
Just as they ported them to MacOS Classic back in the day.
(This discussion, of course, has nothing to do with whether or not macOS adheres to Unix principles or compatibility.)
They've got enough market clout now that people will
port Ruby/Python/Perl to a non-Unix macOS, just as
they port them to Microsoft Windows.
Ruby on Windows is a nightmare.To be specific, Ruby itself (the core language and core libraries) are pretty good on Windows. Great choice for a scripting language, or whatever else you want to do.
But libraries like ActiveRecord, Rails and their myriad dependencies are very very hit or miss on Windows and there's not a lot of support when things go badly.
A lot of the issues are simple - like dead simple. Lot of gem authors don't bother to make things like file paths (forward slash vs. backslash) system agnostic. Or the gems depend on compiled binary stuff like Nokogiri or ImageMagick and those are always a bit of an adventure on Windows.
If MacOS drifts farther away from Unix they will cease to be the platform of choice for many developers currently using it today.
But none of this is surprising considering where RoR is coming from, I'm not sad or upset about it either :)
The same stuff with Node.
It's pretty easy these days.
The experience isn't as nice as macOS, but it's not terrible by any stretch.
Have the same stuff working on Linux and deploy anything without VM/WSL/telemetry/etc. Guess similar situation with macOS.
(sourceforge is the main link, probably best to visit with ublock origin enabled)
Apple isn't changing things just for the sake of change. They're removing 1970's-isms where they hold back the platform. Languages like Ruby/Python/Perl also clean house, from time to time, to remove old cruft. I can't imagine any legacy feature of macOS that Apple would want to deprecate which would make it more difficult to maintain a good port of Ruby/Python/Perl. These are regular general-purpose programming languages now, not just Unix scripting languages.
Yes, Unix has been one of the developer systems of choice for the past couple decades, but it wasn't always so, and it hasn't been the only one. I hear more developers than ever using and enjoying other systems like Windows (Powershell) today. Even Linux today is pretty far from traditional Unix. I just don't see perfect Unix compatibility as a necessary component like it was in 2001.
Depends on what level of the UI you're dealing with.
IIRC, HFS actually uses a ':'.
Mac OS X, initially released on 24 March 2001, uses '/', like other Unix-derived systems.
Also, like other unices, OS X uses '\n' as the line ending. Prior Mac OSs used '\r' as the line ending. Windows uses '\r\n'.
I haven't done Rails for a while, but when I did Rails (including ActiveRecord and all its other components) Just Worked o bWibdows (lots of the peripheral ecosystem of Rails and Ruby more generally was a nightmare, but Rails itself was great), and overall the Ruby (outside of Rails) experience on Windows has gotten better with Ruby installer + DevKit, which hasn't closed all the gaps but does mean that even libraries with C extensions frequently just gem install and work on Windows; I'd be surprised if Rails itself had gotten worse in this area.
People complain about doing Rails on Windows, and, while there's definitely extra friction, and I hate Windows in general, I have really good luck with RubyInstaller. I used to have a hard time with ExecJS, but now I just install Node (on either Mac or Windows), and I'm usually off and running.
Hell, not only VSC supports WSL. RubyMine can manage rbenv/rvm on WSL and more https://confluence.jetbrains.com/display/RUBYDEV/How+to+add+...
Running 'Pengwin' (Debian) Linux via WSL, RVM using Ruby 2.4.1 + Rails 5.1.7 and Ruby 2.6.2 + Rails 6.0.0.beta3
Today, everything works just as expected, right out of the box with no effort. This includes ActiveRecord (to SQLite, MariaDB, and PostgreSQL), including Node.js / Asset Pipeline, Prawn PDF and ImageMagick integrations, uploads to AWS, email integrations, capistrano-based deployments, Heroku Gem + integration, and so on.
It's gotten to the point where we spend more time helping OSX folks figure out occasional Homebrew weirdness, than we do helping Windows folks with WSL. Especially since WSL people can almost always just re-use any Ubuntu instructions verbatim.
Windows file APIs have always supported forward slashes in file paths, even before there was Windows. This goes all the way back to MS-DOS 2.0.
It hurts when I do this ... [punches self in face] ...
Nightmare? No. Suboptimal? Yes.
We're running some legacy rails 3.2 against oracle db on windows, and it works well enough. It sure is a lot more pleasant on linux, though.
Biggest challenge on windows is to get a c compiler working/get binary dependencies working. Other than that, you need a version manager (same for other platforms really, unless you're aiming to shoot yourself in the foot).
Ruby on windows is definitely not great, but "nightmare" is a bit much.
But that's my idea of a nightmare - when things are suboptimal and you're often scrambling for solutions on a second-class platform. When I say "often" I don't mean "every day", but in my experience it happened enough to make me swear off Rails on Windows forever.
Of course maybe 5.x is different. My experience was in the late 3.x and early 4.x days
They may or may not be moving off Unix, but this isn’t evidence of that.
You should check out what they’ve been doing for years with Swift Playgrounds on the iPad
Maybe not the best language for someone new but its widely available.
You can run almost any language from a web browser these days:
A lot of educational sites offer embedded interpreters like this.
It has never been easier to start to learn programming. The real challenge nowadays is maintaining attention...
https://swiftreviewer.com/2018/12/21/swift-programming-on-ra...
It could just as well still remain a one-liner. Every system Homebrew is installed on has Bash installed (not the latest, but still).
Instead of
> /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/in...
It could become
> curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/in... | bash
With the install script containing a payload containing the current Ruby script plus a Ruby interpreter. Still a "one liner".
Ironically, they are also moving from bash to zsh for default shell. Again not an unsurmontable challenge (just make sure the bang is correct in your scripts, bash will likely still be around somewhere in macOS for the foreseeable future) but another little hurdle to mind.
Personally I try to use #!/bin/sh as much as possible, and Fish as my default shell.
On the up side though, clang has made the C/C++/ObjC world a much better place.
(OK, I learned Logo in school when I was 7, but programming became way more interesting when I discovered AppleScript's APIs to control all the programs on my Mac).
And you think a one-click download and install of Ruby would have prevented that?
Not to mention Apple also has Swift, and Swift Playgrounds and so on for kids these days.
So I get what you are saying but I think we are in a new world here.
For Python folks, just install pyenv/pipenv and you can easily maintain `system` (Python), Python2.7x, Python3.7.3, &c as separate environments. For Ruby people it's rbenv.
What will be left? Will it still be "Unix" in any meaningful sense just for having a C compiler and running an old version of Bash? Microsoft Windows did that, too.
You don't have to be anti-unix to do that though, any reasonable organization would have done the same. I agree with the rest though.
They have a problem deprecating python2.7 as it is, the smartest deprecation is not to release a python3+ version at all.
You see a similar issue with python on Debian. Python 2.7 is still the system python for all of the Debian tree, and it is very challenging to migrate to a new version because of the huge impact it has.
That's not to say MacOS won't be a place where python is happy to run - just that Apple don't want to dictate a specific version of it in their releases (i.e. developers/users/applications should install one.)
Do you see that changing as macOS gets away from UNIX? That would probably be a bad hit on apple if Linux becomes then the de facto programming OS when Apple drops UNIX
> They've been gradually deprecating Unix for 20 years, and designing the OS they want.
It is already. Deployed any production service on macOS, of late? Windows and MacOS both, are now forced to run Linux compatibility layers (Docker, WSL...); the Mac one just happens to be thinner because of the choices made at NeXT back in the day.
That was never a real consideration where distros/vendors are concerned (UNIX or Linux). Just a nice-to-have goal for the command line userland (and even that, more back in the day).
You might be right about OSX and it's derivatives moving away from being so unix-like, but by itself this is just sensible housekeeping they would have to do at some point anyway. It's just not reasonable to expect them to include and maintain deprecated language runtimes indefinitely.
[1]https://developers.redhat.com/blog/2019/05/07/what-no-python...
I have a historical question and I wonder if anyone in this thread has the answer: why did RMS (and, presumably, by then his cycle) had to wait around for Linus Torwalds to write a kernel so they could have one for GNU? RMS in particular has a reputation as a legendary hacker. Was he not able to write his own kernel?
"Hello everybody out there using minix -
I'm doing a (free) operating system (just a hobby, won't be big and professional like gnu) for 386(486) AT clones. (...)"
GNU couldn't use MINIX due to the license (unlike minix 3), and as I recall, the bsd's were also in somewhat unclear license terms.
Gnu made the libc, compiler and various userland tools - but no-one did a" simple get it working"-kind of kernel, and then Linux came along.
I suppose part of this might be because in early gnu days, most gnu hackers used university Unix machines - not personal 80x86 for development.
If you bough sun hw you got Solaris. Only if you bought a pc clone would you be wanting a "real" os...
Getting your products into Universities is a great way to maintain market share. This is true for software like Matlab and even for banks where most students will keep banking with the same bank for decades.
I can have an Unix workstation while still being able to run Outlook, Excel and Powerpoint.
I don't want to use Windows and I don't want to use that pile of crap that LibreOffice is... The mac was a good compromise for me.
https://developer.apple.com/documentation/hypervisor https://github.com/moby/hyperkit
Does anyone actually use Docker on Mac?
Xhyve is more of a proof-of-concept than a production-ready tool.
What? We use it at work every day for local development, and my previous employer did as well. It has issues, definitely, but they have more to do with Docker than with xhyve.
I use it extensively. It is a desktop product however; it you aren't expected to put a swarm of MacBook pros into production.
Calling it “not serious” is quite wrong.
Sure, for development tasks.
Further, there's no decent solution for shipping a macOS container image to run in a VM. Linux, yes, Mac, no.
Finally, good luck getting your virtualized macOS app to interact reasonably with your main OS (no drag and drop, no OpenGL, etc.).
I would rather chroot.
IIRC the Docker implementation for OS X runs a tiny, carefully-configured Linux VM transparently in the background. This isn't that dissimilar from the Windows Subsystem for Linux from a user standpoint.
I've done plenty of Docker work on OS X; the only real weirdness is that you're running Linux in the containers and OS X outside. Eventually, though, before switching completely to a native Linux desktop, I moved deeper into the containers and would barely ever see the OS X command prompt any more.
All the interesting container stuff is on other platforms.
It might be out of fear, maybe because apple doesn't want macos to be virtualized.
It would be really nice to have say the current xcode in one container and a dev xcode in another. It would be nice to farm work out to a lot of machines.
or a dockerfile like: FROM macos:10.14
RUN installer xcode... RUN xcode-build myproject
Given that Apple is (or at least was) one of the biggest users of Mesos in the world and have invited me to interview specifically on the back of the operationalization of containers, I'm guessing that the staggeringly bright programmers they've got probably understand containers.
Just a little hunch, you know?
Maybe it's another "you're not the target market" kind of thing.
The point I'm getting at is that folks on other platforms have lots and lots of options and apple doesn't provide any.
The macOS EULA explicitly allows macOS to be virtualized if you do it on a Mac running macOS.
> It would be really nice to have say the current xcode in one container and a dev xcode in another.
This is the entire point behind xcode-select. I currently have Xcode-beta and Xcode on side-by-side on my machine, and they pretty much coexist.
- I think xcode-select just modifies a .plist.
They do offer a set of "primitives" for virtualization, which can be hooked into by third-party solutions like Docker if they want to do so.
it's not like installing python is any more complicated than any other piece of software that needs to be installed. Windows users have had no choice but to do that for decades.
You're saying this like it's a good thing.
If someone decides they want to run a custom ruby or python script the least difficult aspect of that decision is installing the interpreter. For example, I was dealing with someone yesterday who decided they wanted to learn how to write apps for Android. Without even seeing a single line of code (or even knowing which language they would have to learn!!) they had already successfully installed Android Studio and Jetbrains IDEA.
Without coming across as some gatekeeping greybeard, I think anyone who has even a glancing interest in programming would agree if you can't follow a one-line/click installation instruction you may want to find a simpler tool for the task than writing your own code from scratch.
The hardest part for lots of people in learning to program is getting over the idea that programming is for Special People, or possibly Wizards, who know lots of incantations which are beyond mere mortals. Please stop trying to convince them they're right.
Source: I've taught lots of marketing people, admins, call center techs, etc to program in PowerShell or system Python.
Installing the interpreter is nothing special. It should be taught as such.
I definitely understand that the installation process for things like python can be confusing to non-programmers, but I think this is a bit disingenuous. You don't have to learn a build system to install it; python was the first programming language I ever learned, and I used it years before I ever even had any idea what a build system is.
If you can't even download an installer and run it, then yeah, maybe not quite ready for programming either.
Please forgive my snark, but this would be exactly my thought process as a reasonably competent computer user who wanted to learn Python.
When I was six years old, learning to program involved turning on the computer and typing
10 print “hello”
run
That’s what I want for my kids. And there’s nothing even remotely like it in today’s world. $ echo "hello"
seems pretty much the same to me.Even on Windows you can open the browser console and do
> console.log("hello")
Just for teaching basic prints, variables, loops and functions, terminal bash on macOS/Linux or Javascript console work just as well as Commodore 64 BASIC.The problem is not that the environment is not available or setup is too difficult. The problem is that there's now way more competition from other shinies readily available (web, apps, games, videos). Even if you boot your home PC straight into a terminal, as soon as the kids find the way to a web browser it's game over. Even on 1980s home micros, if the kids got access to (pirated) games, practically none would volunterily keep on programming BASIC.
They previously deprecated Java runtime for similar reasons. And I can’t really blame them, roadmap is crystal clear now, they prefer to assign ressources to develop Swift/Swift UI and improve tooling for native code development.
Mind, there's still a command line and shell built-in, which I consider far more important.
I'm generally against bloating simple apps, but you'd never see this unless you opened a .py file (or .sh, .rb, etc), and if you open a .py file, you probably want syntax highlighting.
No? Oh well, I guess programming is hard, IT was right. Ok, back to excel...
You'd have to be very bored and unmotivated to not install a programming language if you had even the slightest motivation to program (IOW, not a normie consumer). I understand what you're saying, but I just don't see how this would be a huge barrier to entry.
This feels the same as when Microsoft removed QBasic from Windows 98. So many kids at home missed opportunities to be exposed to programming from them on, until a certain Terminal application appeared in Mac OS X and began to pique young curiosity again (mine included).
zsh/bash/ksh93, tcsh, awk, sqlite3, elisp (assuming emacs survives for now) and javascript console. I don't know why you'd want to limit things to pre-installed command line interpreters though.
> You have the shell itself, but that’s hardly enough to write anything cool.
What kind of cool things do you envision the curious beginner to write, using only the current preinstalled Python/Ruby/perl, that they can't do with the remaining interpreters that I mentioned?
What about the iconic 4th grader "greetings and cool things" script? Here's something like what it looked like for me (on the IBM PC in my classroom):
5 CLS
7 RANDOMIZE TIMER
10 PRINT "Hello there. I'm a computer. What is your name?"
20 INPUT G$
30 PRINT "Hello "+G$+". You are welcome to computer land."
40 PRINT "What would you like to do today?"
50 PRINT "1) Make noises"
60 PRINT "2) Make a maze"
70 PRINT "3) Exit"
80 PRINT "Enter your selection:"
100 INPUT S$
110 IF S$="1" GOTO 200
120 IF S$="2" GOTO 300
130 IF S$="3" GOTO 400
140 PRINT "Try again."
150 GOTO 40
200 SOUND 20+(RND*20000), RND*3
210 GOTO 200
300 SCREEN 1
310 IF RND>.5 THEN PRINT "/"; ELSE PRINT "\";
320 GOTO 310
400 PRINT "Bye."
That kind of stuff is perfect for Ruby and Python. I don't envision kids getting that far with shell scripts, awk, sqlite3, or elisp. They might with HTML and JavaScript, but that requires learning HTML as well as JS and is sandboxed in the web browser; it's also not as "Cool! Look what I can make the computer do!" as messing around in the terminal. (Note, I’m glad BASIC isn't as available anymore -- we're not getting kids into certain bad programming habits early-on, like use of GOTO. But BASIC would still be more approachable than shell scripting, awk, etc.) 10 SCREEN 9
20 CLS
30 COLOR 1, INT(RND*10)
40 SOUND 20+(RND*5000),.2
50 GOTO 30
The effect is rather striking, like someone must have really messed up the computer.My main gripe with Windows NT was that it would go back to the NT screen saver -- I couldn't get it to stay displaying my program, because there wasn't any true DOS mode.
clear
echo "Hello there. I'm a computer. What's your name?"
read G
echo "Hello $G. You are welcome to computer land."
while true
do
echo ""
echo "What would you like to do today?"
echo "1) Say something random"
echo "2) Make a maze"
echo "3) Exit"
echo "Enter your selection"
read S
if [ "$S" = "1" ]; then
say $( head -n $((7*RANDOM)) /usr/share/dict/words | tail -n 1 )
elif [ "$S" = "2" ]; then
for i in {1..3000}; do
if (($RANDOM>16384)); then printf '/'; else printf '\'; fi
done
elif [ "$S" = "3" ]; then
echo "Bye."
exit
else
echo "Try again."
fi
done
This doesn't seem much different than the BASIC example to me. I think only the lack of GOTO in shell scripts makes this look slightly more complicated (requiring either putting all the statements in the if ... elif parts or defining functions).I honestly don't see how a Python or Ruby version would be much better than a shell version for this. Perhaps you can show by example?
I still contend that Ruby and Python are far more accessible than shell scripting, because they are very popular, especially Python, cross-platform, and less arcane.
import os
import random
import sys
os.system("clear")
print "Hello there. I'm a computer. What's your name?"
G = raw_input()
print "Hello " + G + ". You are welcome to computer land."
while True:
print ""
print "What would you like to do today?"
print "1) Say something random"
print "2) Make a maze"
print "3) Exit"
print "Enter your selection"
S = raw_input()
if S == "1":
F = open("/usr/share/dict/words").readlines()
W = random.choice(F)
os.system("say {}".format(W))
elif S == "2":
for i in range(1, 3000):
if random.random()>0.5:
sys.stdout.write("/")
else:
sys.stdout.write("\\")
elif S == "3":
print "Bye."
exit()
else:
print "Try again."
It looks like a tossup to me, all 3 versions have their own share of magic that will confuse the beginner. I say this as someone who reads and writes a lot more python than bash daily.otoh, pointing people towards messing with system python... well, it's a trap. And they will get burned, and it will be a nightmare to straighten out.
In fact they probably don't even know what "deprecated" means.
It wasn't that long ago that Python 2.7 was the default on the Raspberry Pi. (That may still be true - I haven't checked recently.)
There's a huge ecosystem of Python 2.7 tutorials, introductions, and sample code out there. Very little of it is prefaced with "Of course you should use Python 3 now."
Compare that to "brew install python". Now you have the most up to date version, with the right permissions for your user, that you can always brew uninstall and reinstall later if you need a different version or a clean install.
That is the wrong way to do it. Just install pyenv/pipenv to manage different Python versions. It's dead simple to maintain system Python, Python 2.7x, and Python3.7.3 that way.
You can do that anyway, `python` is always Python 2 (except on Arch where `python` is Python 3 and the Python 2 executable is `python2`) and the Python 3 executable is called `python3`. `pyenv` is more for keeping multiple minor versions of the same major version (e.g. Python 3.6 and Python 3.7) around at the same time.
Actually, it doesn't have to be multiple minor versions, it can be any version–major or minor. It can even be Iron Python or Jython. Anyway, the point is that it's smart not to touch system Python on macOS. So when I run:
`$ pyenv versions`
My output is:
`system
`2.7.16
`* 3.7.3 (set by /Users/wyclif/.pyenv/version)
Dead simple and easy to use. Much better than overwriting and reinstalling when you need a different version for a specific project.
The alternatuve to the current decision is for apple to assign people to keep updating python and provide previous versions as packages like linux distrib does. But it has never been the way they do business.
What do you mean?
When you build and package things for production you should create an environment. This ensures the packaging the right versioning of requirements for build.
Say you build using the system version but use packages based on another version. It may work for you but probably won’t work elsewhere.
The problem comes about when someone does the following:
- creates python project
- pip install some_package
- import some_package
Turns out some package was already in the path but a different version
- proceeds to test and build with the assumption of some_package @ newer
- all tests pass
- ships project with requirements of some_package @ newer
Someone attempts to use the package but it doesn’t work.
That’s what doesn’t pass muster to me. Why should I work on my CSS styles in an environment with the production database? It will be much slower than just working on that package in my desktop environment with just enough scaffolding the code runs.
But maybe I’m not understanding your suggestion.
What does connecting to a production DB have to do with any of that?
The problem is doing something simple, like an installer. bash => zsh: fine. You can still install with the old /bin/bash. but for many cases a shell is not enough, and then you have to compile something statically for a trivial dynamic task. Which makes the download 10x larger. Not cool.
Better yet, offer a “developer setup” app that sets up the command line tools, homebrew, iTerm2, updated bash/zsh, and more.
Apple would do best to pave the cow paths developers have already worn into macOS, especially when it comes to command line utilities. A dev setup app would just make it quicker/simpler and pave the way for newbies to get into development.
Package managers are for software developers. They are comfortable installing them on their own.
Apple do a great job with the builtin Terminal.app
Not sure what you mean here, but I don't think that's something you don't get, or can't get, on Terminal.app. In fact, that's the default...
Projects and project parts are separated via spaces but I never want to have to find the right terminal for a process, instead I use a single window with animations disabled (to show immediately) and excluded from app switcher via settings so that it will only ever show up when i press alt-space no matter which space I'm on.
Together with tabs and native panes it works just great and requires very little setup
I think / hope Apple will do their own package system, maybe as part of the app store, for developer tooling like that. If only for improved security.
It sounds like what you're really asking for is something like Ninite for mac, which I think frankly is safer to stay as a 3rd party thing, rather than Apple getting super-involved in choices that are going to be very user taste specific.
Because iTerm2 is an excellent Mac app? I don't understand your aversion to favoring one tool over another: macOS itself is a tool that I prefer to use over Linux because it's nicer, just as iTerm2 is nicer than Alacritty.
If there's really demand for some kind of base developer toolkit, why not leave it up for a 3rd party to put together some kind of installer to set it all up for you?
Because a potentially interested 4th grader likely won't ever know such a thing exists.
And even if she did, the teacher likely won't let her download and install it from the internet. But if she asks for permission to run a "Install Command Line Tools" app in /Applications/Utilities/ and check the "Install homebrew" option (or "Install MacPorts" - I really don't care either way... perhaps provide options for both), that's far more likely to get a "yes".
I was only able to learn BASIC and the DOS command prompt because I was in a multi grade classroom, and an older boy (5th grader) whose mother paid for him to have programming lessons taught me on the classroom computer.
The teacher had no clue about any of that... she only knew I started spending “too much time” on the computer.
PS: also a quake-like mode.
I know homebrew and iTerm are pretty popular, and that there are other popular options as well. Why not list the top n in each category, in randomized order, with short descriptions and "learn more" links?
Every time I start work on a different Mac, it usually takes me at least 30 minutes to set it up. It would be nice to have a quick button to set up command line tools, iTerm2, homebrew, zsh, and git. Making such setup available from an app would not only speed up the process, it would also gives the dev environment visibility to newcomers and "first class" status from an IT perspective.
It's a script that installs all kinds of useful stuff and sets some - in my opinion - nice options. I just recently started a new job and I had a brand new Macbook Pro up and running (as in: ready to start working) in less than 30 minutes.
A good tip is to fork it and modify it to your liking. At a new computer you can then just pull down your version and install away.
The only default that's missing is Sublime Text.
Obviously these things are fixable but a whole lot of people are going to have to do a lot of work to workaround having _no_ scripting languages installed by default on a fresh Mac.
[0]: https://github.com/atomantic/dotfiles/blob/master/install.sh...
https://twitter.com/zbeekman/status/1136250914539483136
> Once Homebrew no longer has to support a macOS with a system ruby, we can even run with a considerably more up-to-date version, modulo concerns for supporting older linux(brew) OSes. We have a portable ruby that we can use to bootstrap things.
Which means you should start bundling the stuff you need to run your app, and, they’d like you not to use the same ancient batteries as they have previously made available, because, well they are ancient.
"they’d like you not to use the same ancient batteries as they have previously made available, because, well they are ancient" --> Right, I couldn't figure out if that's all they meant. Valid point or not, it doesn't seem appropriate to make it in the context of those notes. If you're going to make me bundle the language anyway, don't also give me a lecture about which version to use. :)
Apple used to ship an incredibly old version of OpenSSL because people used its API which was not ABI stable. Even getting rid of it was a nontrivial amount of work.
The lack of care about API&ABI stability in developer facing open source projects (interpreters, libraries, frameworks, commandline arguments) is still bizarre to me: why make your work hard to use/update? People ship out of date libraries because updating requires changes beyond just pulling a new binary requires more work than the gain will give them.
It’s part of why companies like Apple and Microsoft care so much about backwards compat: they want people running the most recent OS possible, and they don’t want people to avoid updates. Every time an update breaks something for anyone, they hold off updating in future.
On the other side, developers don’t want to invest time and money into a feature that they don’t think will work/cause their app to crash in future.
Compared to (former) Microsoft, I don't think Apple spends anywhere near the amount of effort MS does on backwards compatibility.
You can create a single .exe that will work on any Windows starting from Windows 95 - nearly 25 years. In that timespan, Apple changed CPU architectures twice, and their OS architecture once. If you're willing to restrict yourself to 32-bit Windows, which can run Win16 and DOS apps too, then it goes back to the early 80s.
It is true that Apple doesn't maintain backward compatibility for a long as Microsoft does, but that's not the same thing as not caring. They put the effort into making transitions as smooth as possible for users and developers and getting through them quickly.
Apple maintained 68k compatibility for years after it migrated to ppc. That's a completely different hardware architecture
It maintained classic compatibility for years after it moved to osx. That's a completely different kernel and basic system architecture.
It maintained PPC compatibility for a few years after transitioning to intel.
It supported 32 bit x86 for a number of years after the entire line was 64 bit capable.
Apple does care about compatibility, it just isn't as beholden to the past: it's much more willing to say "this is bad, so we're deprecating it, eventually it won't exist/work".
But they work to not break any software until the feature being used is actually removed.
It is considered a high priority bug if someone changes behaviour of a function or object in a way that isn't backwards compatible. All APIs are essentially statically vetted to ensure they don't change, including things like struct layouts and sizes.
That said, it kind of misses the point to respond to "Apple and MS care about backwards compatibility" in this context to say " I don't think Apple spends anywhere near the amount of effort MS does on backwards compatibility". The point is that if you care at all then libraries and services that are unwilling (or even hostile to) abi stability cannot viably be shipped in any publicly facing way as part of your platform.
To be fair, this is less an an issue with non-fragile ivars in Objective-C.
But yeah having most of the system apis being in a language that has built in dynamic resolution makes a world of difference in the difficulty of maintaining abi compat
struct APIFoo { int a_field; }
void do_something(struct APIFoo* argument);
later on we add a new field, and that becomes:
struct APIFoo { int a_field; int new_field; }
For API compatibility you just need the source level field names to remain, and to remain the same type. But for ABI compatibility - e.g a existing compiled program - the fields must remain in the same location, so you can only add members to the end, and you can't change the alignment or padding rules.
What remains is how the API implementation knows if the argument is the size of the old api, or the new one.
The Microsoft API idiom is to have a size field that you initialize to sizeof(APIFoo). This means when you recompile you code against a more recent version of the API you'll get a modern sized struct. My feeling has always been that this approach is more fragile, as you can unintentionally increase the struct without initializing the new members. Apple APIs that need it tend to use an explicit version number, so you have to explicitly say that you know which fields you want to update - as an example you can look up JSClassDefinition (IIRC) in JavaScriptCore.
The other thing that Apple APIs will do is use a linked-on-or-after check: basically the macOS and iOS include metadata about the system version that a library or application was compiled to target. This is generally used to control legacy behaviour to handle cases where some internal logic leaked across an encapsulation boundary but the behaviour that was leaked is simply too awful to retain in general, and in the worst of worst cases code may include explicit tests for what the current application is (you can see a bunch of these in the WebKit codebase). Microsoft accomplishes similar tasks using (I think they're called) compatibility shims.
You are right however that the actual objects you get returned in macOS and iOS APIs are basically all opaque objects - looking at the JSC example, the actual API objects are opaque: so JSClassMake() takes a pointer to a JSClassDefinition, and returns an opaque JSClassRef that provides the actual API object you use to create objects.
As for C++: I would suggest you look at the nightmare that is IOKit. That's right, the kernel driver APIs are in C++. Because NEXT wrote that code in the 90s, when C++ was considered the perfect solution to all problems (e.g. before people really understood how hard C++ makes ABI compatibility)
The difference is that after a while Apple is willing to deprecate things. Versus a lot of open source projects that don't guarantee any stability at all, even across minor version increments. That's the problem that makes them dangerous for platforms like macOS and iOS to expose them as public API (intentionally or unintentionally - my understanding is for instance that the system openSSL was accidentally exposed publicly - and that took most of a decade to remove from the OS, e.g. most of a decade of shipping an increasingly old Frankenstein branch of openSSL)
In fact it's so terrible the most popular JS projects are actually project to avoid writing JS or emulate features that don't exist in one JS implementation or another (typescript, babel, JSX, webpack, polyfills, etc)
And yeah, JS has some old crufty things, but it also has the ability to do things nicely now. No one is forced to use old syntax, and most new code does not, but because those features have not been unilaterally removed there has not been anything like the problems python3 has produced.
Seriously: what new syntax in python three necessitated breaking python2 compatibility? Even your string example is weird because JS allows arbitrary invalid ucs2/utf16 strings despite adding actual unicode compatible APIs.
However, software that neglects to update also tends to breakdown as libraries change to reflect new knowledge.
If you're developing software based on someone else's library you are implicitly accepting the demand to modify your software to maintain currency with those underlying requirements. It seems a bit far-fetched to expect that you only have to write the software once without having to maintain it.
You can make APIs that are ABI stable (literally that's the entirety of the Microsoft and Apple platform APIs, and plenty of open source libraries as well - Qt and GTK for instance). You can also explicitly choose not to (which I believe includes OpenSSL).
Basically if a library or application is not or cannot provide a stable ABI, it cannot be used be a platform where the default update model does not include the possibility of recompiling all software. Essentially such a model would require Apple and Microsoft to have the source for all apps, and be the primary/only distribution point for all of them as well - note that this is host most linux distributions operate: any given update can result in an arbitrarily large portion of all software for the system being recompiled.
If you're a FOSS developer with limited time and man power (and if you're lucky, limited budget) maintaining backwards compatibility is hard. So hard, that new features and bug fixes might have to take a back seat to it. Also, I'm almost certain that developers would rather be implementing new features, and fixing bugs, ahead of maintaining backward compatibility. It's much easier to show a new feature or a bug fix, than it is to show how backward compatibility was maintained.
Also, the big users of FOSS, projects like Debian (and Ubuntu) and Fedora, will rebuild their entire systems when new versions of software are released/integrated. This reduces the maintainer's requirements to keep ABI compatible.
Yeah, the ability to rebuild the entire system from source whenever you need it has resulted in those communities just not caring about a number of things that really do matter on proprietary systems; it's also part of why Linux doesn't have fat binaries (why bundle multiple architectures together when everybody can just grab or build each one themselves?).
/usr/bin/ruby -e ...Now, if they'd officially endorse one open-source packaging solution as an alternative, I'd be fully satisfied.
But your perception that it's dead is certainly symptomatic of an issue for the project.
[1] yes yes Monty Python
The only way to stop the OS from including out of date software and libraries is to not ship them if they don’t have stable abi.
That’s what Apple is doing: it can’t reasonably ship them and keep them up to date, so it is going to stop.
The app developer also now has a problem - their binary only works on one OS revision so they have to start shipping the same code, just compiled separately. The only safe solution is to ship with their own embedded version. Which is also the correct solution to the interpreters not being part of the platform.
If you are a developer, there are many ways to get the software you need for development. Apple is saying they’re just not going to provide it on client machines by default — which is probably fine because honestly, more often what happens is the version Apple has on the machine is old or missing newer parts anyway.
I guess you could argue Apple should make their own package manager, but they just don’t want to spend the time and energy on that when they want to focus on Mac and iOS software rather than UNIX software.
Also, what's the best way to install homebrew if you don't have a system-level ruby? The current installer is a ruby script. Is it possible to get some sort of ruby-bootstrap that can install homebrew and a homebrewed ruby?
They’re not removing the commandline (although moving to zsh? :-/), or banning interpreters.
They’re just not including them built into the os anymore.
As for the AppleScript and JavaScript questions:
Apple makes the runtimes for those, and makes sure they remaining binary compatible. Take a program that linked to (and used) the javascriptcore api to add js support. Something compiled 10 years ago will run without recompilation. Thats the bar for stability.
The installer is the only thing that uses the system one. Could be ported to ZSH or Python 3.
I should know the situation for Ruby as well... but don't remember anymore.
On the other hand, installing xcode is really a pain.
Good pratices != common practices.
Even the perl and ruby version installed is old, and nearly nobody uses perl or ruby at this day. Maybe perl is still used by some programs and scripts, for example TexLive relies on perl, or ruby is used for brew. But you better installing more updated version yourself so removing it is not a big deal.
There is no meaning to keep old script interpreters installed, if you want to use them you probably want to install a more modern version, if you don't need them it's better to not have them.
Let's not go overboard - 2.7 will get security updates and patches until the end of December.
> nearly nobody uses perl or ruby at this day.
Well, except for homebrew of course, the Ruby-based package manager nearly "everybody" uses...
Edit: 3.7.3, specifically.
You still need admin rights and an internet setup. Linux is still king.
Only problem is security: with multiple applications including their own dependencies, some of those dependencies will lag behind in their security updates. You can't just get a single fix for your Python run-time and fix it in all applications at once.
(Eralier versions of mbed build system needed python, JavaScript and one more)
Congratulations, Python 3!
And these days with smallish SSDs, I find myself desperately freeing up disk space surprisingly often. I’d rather not have every single app be 100+ MB when I know deep down that the things should be tiny.
But I miss the idea of shared libraries; not only can they potentially save memory and disk space, but it makes bug fixes easier because you can fix the shared library without having to update every app separately.
Expect package installers that make the whole thing easier and more secure (signed packages vs a curl | /bin/sh)
They already install their own local ruby today, but use the system-ruby as an entrypoint.
I'm not a big fan of brew however. Last time I checked it didn't seem to work well when switching between users.
Gives other languages a better standing too :)
problem solved?
It will be two lines of code and two minutes to install the interpreter you need, and you will no longer be tied to a global, possibly ancient system version.
Likewise, you won't have your own installed applications break on update because (for example) python2.7 was EoL and dropped from the OS.
Installing your own instance of python or ruby should be two lines and about two minutes assuming a decent internet connection.
There is no real loss here; no sane users would use the built-in versions due to their age. It has been preferable to download and install newer versions for a long time, this changes nothing.
And if it's fine to spend a tiny amount of effort to install WSL or Cygwin on Windows, then it's surely also no effort at all to install Homebrew or MacPorts (or other) — with the benefit of not working in a contrived, separate environment.
This comment betrays a fundamental lack of understanding of modern developer workflows in macOS and feels just slightly like a troll comment from someone who likely doesn't use macOS to begin with.
Well, plenty of people use macOS precisely because it was like a more consistent Linux out-of-the-box. Apple will lose a ton of mindshare; indeed, they are losing a ton of mindshare. They've been slowly deprecating things for years, now, and leaving the rest to rot, and open source developers are increasingly drifting away.
About 10 years ago macOS and Apple hardware started becoming the preferred kit for open source developers, and this showed--Apple kit was seen everywhere in Silicon Valley and eventually became the default kit given out by big software companies. That was all because of macOS' Unix personality. That's all going to change over the next several years.
I was surprised when WSL 1.0 debuted. By making Linux _native_ on Windows, it solidified Linux' position as the dominate server-side platform. I'm not at all surprised they're ditching it for WSL 2.0, which is just Linux in a VM with a networked filesystem, precisely what people have been doing for about 15 years, keeping it solidly second class--like running Windows on macOS.
When using macOS, nobody is thinking "fantastic, I can't wait to use these hideously outdated versions of things" — it's a straight trip to Homebrew or MacPorts to sort things out, always, because the built-in version is categorically never the version people write scripts against. Nobody could depend on such old versions of Perl, Python, and Ruby because they were so ridiculously out of date.
Deprecating things that should already have been deprecated is not going to stop people preferring the experience that macOS still affords to developers. I don't see how that's going to change, there's no evidence to support this; if macOS has been losing popularity amongst developers, the butterfly mechanism and Touch Bar on the MacBook Pros has more to answer for than macOS itself which remains solid, reliable, and the best way to get stuff done on UNIX without the interminable fiddlyness of Linux.
Also, I think your timing and causations back to front; the release of WSL didn't solidify anything, it was already well known that Linux was the dominant server-side platform long before. WSL was and is Microsoft's way of bringing Unix-style tooling and development to the desktop, something macOS had done long before. I'd argue that WSL is still a VM of sorts; underneath it all, it's still a slimmed down version of Ubuntu that remains separate from other Windows processes. That WSL 2 will properly move into a VM will make that existing separation clearer, I believe — and yet, I can't help but think Docker on Windows is a more attractive offering in terms of flexibility, anyway.
On top of this, the introduction of WSL in Windows 10 has made Windows a compelling option for many people who use macOS as a Unix that doesn't have the driver issues of Linux/*BSD and happens to support Microsoft Office, Adobe Creative Suite, and other commercial software packages. Provided that they are not hardcore Unix systems programmers, if they want a Unix-like userland with support for Microsoft Office and Adobe Creative Suite, why not try WSL? Despite my preference for macOS, I've used WSL on my work-issued computer as well as on my personal Dell XPS 15, and I must say, I'm very impressed with it. No more having to mess around with PuTTY or with virtual machines to do Unix work on Windows. While I am personally more productive in macOS than in Windows even with WSL, I know quite a few former Mac users who are very happy with Windows 10, thanks to WSL.
Now, software engineers who primarily work with Apple frameworks and technologies probably won't be satisfied with Windows. But software engineers who use macOS primarily as a convenient Unix with support for commercial software packages might want to give Windows 10 and WSL a try. Now, personally I'm still turned off by certain lingering "Windowsisms" (insert gripes about telemetry, ads, mandatory updates, and the UI here), but for many people Windows 10 is now a compelling alternative to the Mac.
There are many reasons that people choose to use a Mac, mostly when people say “Linux” in this context they mean: posix shell, and the ability to run most other posix software (eg most Linux commandline apps).
It’s not because it has every interpreter on earth installed by default. In fact as others have said the current status is that the system installs of python and ruby are old because updating them breaks software. The solution is to make them not part of the OS so if software does want to use an interpreter they don’t lock the shipping version again.
Linux doesn’t have this problem because it’s assumed that your update process comes from a central repository of all the apps so if you (say) update python you also pull recompiled updates of all the apps you have that depend on python. Software installation on a Mac is generally not all from one source, and even if it were Apple doesn’t have the ability to recompile other developer’s apps.
I recently switched to linux after 10+ years of MacBook Pros because I'm disappointed in the hardware quality post 2015. I used to die-hard argue that they were worth the price tag, but now I can't do so in good faith so I got a Dell XPS about 6 months back and love it. Cheaper and superior hardware. There is a bit of learning curve for using linux as an every day work machine, and there is a couple days of setup to get things working just right and achieve parity with OSX features I love (quick view, screenshots, keyboard shortcuts, etc), but once I got everything configured I have no complaints.
macOS is an evolution of NeXTSTEP and has its own way of doing things, based on BSD, Mach, Objective-C and Swift APIs.
If one was planning to kill off all non-approved software on an OS, what would you do first? Remove all the runtimes that can execute unapproved software of course. Then you are free to impose signing as a requirement for applications and a mandatory app store, and reap the 30% rent tax forever more.
Is Apple doing that? Of course, we can't tell. There are lots of good reasons to do this that aren't evil. The best evil plans are indistinguishable from good plans but just happen to have evil outcomes that are in your interest.