News for hackers. Stuff that matters.
Re:macOS deprecating scripting language runtimes, including ... by DividableMiddle on Wednesday June 05, 2019 @08:36PM (#20110484)
This has been a topic brought up internally at Apple many times over the past decade. Glad to see it finally moving forward. Although I see the benefits to having a system-version of these packages.. if you're doing anything serious for production then the environment should be containerized.
Re:macOS deprecating scripting language runtimes, including ... by Waterluvian on Wednesday June 05, 2019 @09:20PM (#20110719)
Python and pip just being there is a huge advantage for newbies. I really think that part of programming is constantly ignored because all the decision-makers are not newbies.
Re:macOS deprecating scripting language runtimes, including ... by dcosson on Thursday June 06, 2019 @12:59AM (#20111720)
It's honestly terrible for newbies. If they try to use it, there's no pip included. So then they easy_install all their libraries which installs things into different places than most python devs will be used to. Or they easy_install pip first. But even still, everything is installing to system paths, so when they try to install things it fails with permission errors. They find a stack overflow post that says just "sudo" everything and they go to town. And there's no way to reset anything when it gets borked either because it's the system install.

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.

Re:macOS deprecating scripting language runtimes, including ... by adrianN on Thursday June 06, 2019 @02:35AM (#20112116)
So you're saying Apple should adopt brew as default package manager and install all system tools using brew? I could get behind that, but just dropping everything without replacement makes it harder for first-time programmers.
Re:macOS deprecating scripting language runtimes, including ... by Fnoord on Thursday June 06, 2019 @03:40AM (#20112371)
That, with analytics off by default. Also, Homebrew depends on Ruby, and Apple just ditched that
Re:macOS deprecating scripting language runtimes, including ... by ch4s3 on Thursday June 06, 2019 @07:55AM (#20113612)
Homebrew installs it’s own ruby when necessary.
Re:macOS deprecating scripting language runtimes, including ... by wyclif on Thursday June 06, 2019 @03:06AM (#20112239)
you can always brew uninstall and reinstall later if you need a different version

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.

Re:macOS deprecating scripting language runtimes, including ... by dcosson on Thursday June 06, 2019 @08:35AM (#20113896)
Yes but I’ve never seen someone new to programming that bothered trying to figure out pyenv or similar. Even a lot of moderately experienced devs don’t bother with it. I guess it’s hard to realize the benefits of keeping environments organized until you’ve been burned by it.
Re:macOS deprecating scripting language runtimes, including ... by willio58 on Thursday June 06, 2019 @03:49AM (#20112420)
Wrong way? I’ve used this method successfully for years.
Re:macOS deprecating scripting language runtimes, including ... by wyclif on Thursday June 06, 2019 @06:11AM (#20113072)
Sure you can do that, but why would you want to install and re-install different versions of Python depending on what you needed at the moment? Pyenv manages all that nicely. You can have 2x and 3x side by side without having to reinstall and uninstall anything.
Re:macOS deprecating scripting language runtimes, including ... by Sean1708 on Thursday June 06, 2019 @08:41AM (#20113952)
> You can have 2x and 3x side by side without having to reinstall and uninstall anything.

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.

Re:macOS deprecating scripting language runtimes, including ... by wyclif on Thursday June 06, 2019 @08:24PM (#20120521)
`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.

Re:macOS deprecating scripting language runtimes, including ... by xapata on Thursday June 06, 2019 @03:35AM (#20112350)
Or conda, which I prefer to pipenv + pyenv.
Re:macOS deprecating scripting language runtimes, including ... by toyg on Thursday June 06, 2019 @08:00AM (#20113647)
Homebrew is not perfect though - it doesn't handle multi-versions (e.g. 3.7 and 3.8 running in parallel), which were working fine with Apple's Framework mechanism. Pyenv is superior in that respect (although it's fundamentally a hack). But I agree that brew does a better job for newbies than Apple's system python.
Re:macOS deprecating scripting language runtimes, including ... by AlexeyBrin on Wednesday June 05, 2019 @09:28PM (#20110759)
AFAIK, macOS comes with Python 2.7 and without pip. For any serious, modern, Python development you need to install Python 3 yourself.
Re:macOS deprecating scripting language runtimes, including ... by Waterluvian on Wednesday June 05, 2019 @09:44PM (#20110831)
Again the word "serious" is there telling me people are absolutely aloof to the kinds of new developers there are and what it's like to be a non programmer.
Re:macOS deprecating scripting language runtimes, including ... by AlexeyBrin on Wednesday June 05, 2019 @09:48PM (#20110851)
What newbie will start with Python 2.7 at this point in time? Most books and tutorials are updated for Python 3. The default Python 2.7 interpreter from macOS is useless for newbies, it does more harm than good by confusing them.
Re:macOS deprecating scripting language runtimes, including ... by Wowfunhappy on Wednesday June 05, 2019 @10:44PM (#20111141)
Apple could solve this problem by including python3 with macOS...
Re:macOS deprecating scripting language runtimes, including ... by Twisell on Wednesday June 05, 2019 @11:19PM (#20111280)
They sure could, but is it worthy to maintain an alternative package and deployment system for which you have no use yourself? Will employees be careful and committed to something useless for their jobs?

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.

Re:macOS deprecating scripting language runtimes, including ... by Wowfunhappy on Thursday June 06, 2019 @12:04AM (#20111483)
I agree overall, but I do think it's a little sad that you can no longer open a Terminal and start writing Python. I think this legitimately matters in terms of increasing overall tech and programming literacy.

Mind, there's still a command line and shell built-in, which I consider far more important.

Re:macOS deprecating scripting language runtimes, including ... by unilynx on Thursday June 06, 2019 @01:07AM (#20111750)
Its not like the rest of the terminal is friendly to newbies. An online ‘jsfiddle’ like environment suitable for newbies (with a bit of inline syntax hints without turning into a full IDE) would be more useful to get people to start playing with programming
Re:macOS deprecating scripting language runtimes, including ... by Wowfunhappy on Thursday June 06, 2019 @10:18AM (#20114778)
Separately from including python, I've always thought it would be nice if TextEdit had some built-in syntax highlighting, that activated automatically for the right file extensions.

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.

Re:macOS deprecating scripting language runtimes, including ... by jodrellblank on Thursday June 06, 2019 @02:16AM (#20112040)
You can open https://repl.it/languages/python3 and start writing Python.
Re:macOS deprecating scripting language runtimes, including ... by Godel_unicode on Thursday June 06, 2019 @02:43AM (#20112155)
with open("~/Documents/important.csv", "r") as f: f.read()

No? Oh well, I guess programming is hard, IT was right. Ok, back to excel...

Re:macOS deprecating scripting language runtimes, including ... by amasad on Thursday June 06, 2019 @03:06PM (#20117933)
You can just drag and drop the file on repl.it and it'll just work :)
Re:macOS deprecating scripting language runtimes, including ... by Godel_unicode on Friday June 07, 2019 @12:20AM (#20121640)
Gee, thanks. My point was about discoverability and being able to Google for "read csv with Python", not whether experienced programmers can hack things together.
Re:macOS deprecating scripting language runtimes, including ... by amasad on Friday June 07, 2019 @01:34AM (#20121909)
Majority of our users are hobbyists and novices
Re:macOS deprecating scripting language runtimes, including ... by IshKebab on Thursday June 06, 2019 @12:43AM (#20111654)
Presumably someone said that about python 2 back in the day and that turned out to be a pretty bad decision.
Re:macOS deprecating scripting language runtimes, including ... by Wowfunhappy on Thursday June 06, 2019 @04:42PM (#20118939)
Isn't this the same as saying, we should never include any software, lest it become outdated someday?
Re:macOS deprecating scripting language runtimes, including ... by c256 on Thursday June 06, 2019 @01:20AM (#20111814)
Apple could solve this problems by including homebrew with macOS...
Re:macOS deprecating scripting language runtimes, including ... by kccqzy on Thursday June 06, 2019 @02:57AM (#20112198)
The young, bored but smart kid in an elementary or middle school tinkering with her computer and finding something to do. She doesn't need a book or a tutorial to tell her the "right" way. She experiments, only guided by her curiosity.
Re:macOS deprecating scripting language runtimes, including ... by em500 on Thursday June 06, 2019 @05:31AM (#20112904)
There still Swift Playground, Safari JS console, not to mention old fashioned zsh/bash/ksh to tinker with. The part where the removal of the default macOS Python/Ruby/perl (which don't even have autocompletion) kills her curiosity seems far fetched.
Re:macOS deprecating scripting language runtimes, including ... by TimTheTinker on Thursday June 06, 2019 @11:55AM (#20115740)
What command-line programming language interpreters are left when those are removed? You have the shell itself, but that’s hardly enough to write anything cool.

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).

Re:macOS deprecating scripting language runtimes, including ... by em500 on Thursday June 06, 2019 @03:45PM (#20118327)
> What command-line programming language interpreters are left when those are removed?

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?

Re:macOS deprecating scripting language runtimes, including ... by TimTheTinker on Thursday June 06, 2019 @04:14PM (#20118639)
> 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.)
Re:macOS deprecating scripting language runtimes, including ... by em500 on Friday June 07, 2019 @07:10AM (#20123365)

    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?

Re:macOS deprecating scripting language runtimes, including ... by TimTheTinker on Friday June 07, 2019 @02:04PM (#20127155)
You do have a point - that's not too bad, but to my eyes it's still more arcane than Python and Ruby (spoken as someone who has written less than 30 shell scripts in my life).

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.

Re:macOS deprecating scripting language runtimes, including ... by em500 on Friday June 07, 2019 @03:53PM (#20127987)
For my own curiosity I did the simplest Python version I could think of to see how it would compare:

    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.
Re:macOS deprecating scripting language runtimes, including ... by TimTheTinker on Thursday June 06, 2019 @11:26PM (#20121399)
Another of my favorites -- this was fun in middle school (years 6-8) when I had a spare minute or two to sit down at a random computer (maybe in a computer lab).

    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.

Re:macOS deprecating scripting language runtimes, including ... by em500 on Friday June 07, 2019 @07:17AM (#20123396)
How would you do this on macOS with just the built-in Python or Ruby?
Re:macOS deprecating scripting language runtimes, including ... by TimTheTinker on Friday June 07, 2019 @01:44PM (#20126979)
I have no idea... I just wanted to share something fun I did around 25 years ago.
Re:macOS deprecating scripting language runtimes, including ... by wyclif on Thursday June 06, 2019 @03:09AM (#20112249)
The point is that Python 2.7x is being EOL'd now. The Python that person will likely encounter in the very near future will be Python3.
Re:macOS deprecating scripting language runtimes, including ... by pieter_mj on Thursday June 06, 2019 @05:02AM (#20112782)
per the link, macOS won't include any scripting languages by default in the future. So the bored user will be less likely to stumble upon an intresting programming language on their macs.
Re:macOS deprecating scripting language runtimes, including ... by wyclif on Thursday June 06, 2019 @06:10AM (#20113063)
I don't know if that follows. I think it's likely that Apple will include a new installer upon setup that is essentially a one step 'click to install XCode Developer Tools and the following languages:' then has a list of options including Bash, Python, Ruby, Perl, &c. But all that is conjecture because we don't know what they're going to do yet.

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.

Re:macOS deprecating scripting language runtimes, including ... by AmericanChopper on Thursday June 06, 2019 @03:48AM (#20112416)
Why would a new programmer want to start with a deprecated language?
Re:macOS deprecating scripting language runtimes, including ... by TheOtherHobbes on Thursday June 06, 2019 @05:02AM (#20112783)
Because they don't know it's a deprecated language.

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."

Re:macOS deprecating scripting language runtimes, including ... by AmericanChopper on Thursday June 06, 2019 @06:18AM (#20113105)
I bet they know how versions work though, and that 3.7 is higher than 2.7. I just googled ‘Python tutorial’ and only one of the results on the first page was for python 2. The first result was ‘The Python Tutorial — Python 3.7.3 documentation’. If some non-programmer was going to start learning python, they’re most likely going to start with google. I can’t see them digging deeper into the results because they want to learn an older version of the language.
Re:macOS deprecating scripting language runtimes, including ... by x0x0 on Thursday June 06, 2019 @03:35AM (#20112349)
otoh, helping people start by just typing python is great!

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.

Re:macOS deprecating scripting language runtimes, including ... by lapnitnelav on Thursday June 06, 2019 @06:24AM (#20113129)
Yeah you'd be better off having a proper clean install of Python + virtualenvwrapper as your starting point.
Re:macOS deprecating scripting language runtimes, including ... by benatkin on Wednesday June 05, 2019 @09:55PM (#20110881)
Not true. It's better for them to install it themselves so they know exactly what they're using, and so they type python for python 3 and not python3.
Re:macOS deprecating scripting language runtimes, including ... by Bonooru on Wednesday June 05, 2019 @11:43PM (#20111382)
I'm gonna disagree on this one. When you're just starting, the installation process can be nontrivial and the terminal window is scary. Having less friction there makes it easier to start and build some confidence. Once you have some idea of what you're doing, you can realize that you want different versions of the language.
Re:macOS deprecating scripting language runtimes, including ... by daveFNbuck on Thursday June 06, 2019 @12:01AM (#20111473)
I think this is a better argument for Apple providing a package manager with the operating system so that installing python is as easy as typing "brew install python3". Then it'll be just as easy for newbies to learn less standard languages.
Re:macOS deprecating scripting language runtimes, including ... by IshKebab on Thursday June 06, 2019 @07:39AM (#20113515)
What's more scary? Copying and pasting two lines into the terminal, or working out why the hell pip doesn't work.
Re:macOS deprecating scripting language runtimes, including ... by banachtarski on Thursday June 06, 2019 @12:31AM (#20111608)
If you have a tough time installing software that has maybe a dozen words or so of instructions in a clear easy-to-read format... you really have no business learning to code until you learn how to use your computer first.
Re:macOS deprecating scripting language runtimes, including ... by erik_seaberg on Thursday June 06, 2019 @02:00AM (#20111990)
Always ask for python2 or python3. "#!/usr/bin/env python" probably won't ever be able to detect and run both, so no matter what you wanted there will always be systems on which you won't get it.
Re:macOS deprecating scripting language runtimes, including ... by loktarogar on Wednesday June 05, 2019 @11:39PM (#20111365)
no. it's better for newbies to learn programming rather than fight with operating systems trying to set up an environment to learn programming in
Re:macOS deprecating scripting language runtimes, including ... by benatkin on Thursday June 06, 2019 @01:13AM (#20111777)
If you follow a python 3 tutorial when your computer has python 2 installed on it, that's a terribly annoying way of fighting with your tools. I've seen it happen. I'd rather they don't risk it and just start fresh.
Re:macOS deprecating scripting language runtimes, including ... by sametmax on Thursday June 06, 2019 @02:57AM (#20112200)
Not only pip is not provided, but virtualenv neither.

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.

Re:macOS deprecating scripting language runtimes, including ... by arvinsim on Wednesday June 05, 2019 @09:25PM (#20110737)
Learning how to install Python and Pip should be part of the learning process for newbies.
Re:macOS deprecating scripting language runtimes, including ... by Bjartr on Wednesday June 05, 2019 @09:32PM (#20110776)
Learning how to install and configure development environments is an important skill in general, but I'm not convinced having those skills as a prerequisite for exploring programming as a newbie is at all valuable.
Re:macOS deprecating scripting language runtimes, including ... by benatkin on Wednesday June 05, 2019 @09:56PM (#20110884)
It is valuable if they start out with python 3 instead of python 2.
Re:macOS deprecating scripting language runtimes, including ... by Bjartr on Thursday June 06, 2019 @10:32AM (#20114887)
I'd say that depends on what kind of newbie we're talking about.
Re:macOS deprecating scripting language runtimes, including ... by drak0n1c on Thursday June 06, 2019 @01:08AM (#20111760)
On macOS the best config-free entry to programming is Swift and Swift Playgrounds. Everything else can have config and shell hell for further more advanced learning purposes.
Re:macOS deprecating scripting language runtimes, including ... by saagarjha on Thursday June 06, 2019 @04:50AM (#20112726)
You still have to download Xcode, of course.
Re:macOS deprecating scripting language runtimes, including ... by SeanLuke on Wednesday June 05, 2019 @10:33PM (#20111081)
I'm sure that my kids will certainly love to hear that they have to learn Unix in order to learn a build system in order to try out Python. It's all part of the "learning process for newbies."
Re:macOS deprecating scripting language runtimes, including ... by saghm on Thursday June 06, 2019 @12:18AM (#20111549)
> learn Unix in order to learn a build system in order to try out Python

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.

Re:macOS deprecating scripting language runtimes, including ... by photojosh on Thursday June 06, 2019 @12:57AM (#20111706)
Good grief. What's wrong with going to www.python.org/downloads/ and clicking the big button at the top that says "Download the latest version for Mac OS X"?

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.

Re:macOS deprecating scripting language runtimes, including ... by jasonkester on Thursday June 06, 2019 @02:05AM (#20112005)
He’s right though.

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.
Re:macOS deprecating scripting language runtimes, including ... by em500 on Thursday June 06, 2019 @03:07AM (#20112243)
Open Terminal

    $ 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.

Re:macOS deprecating scripting language runtimes, including ... by zelos on Thursday June 06, 2019 @05:57AM (#20113018)
Teaching bash scripting as an introduction to programming? Surely there are laws against that kind of cruelty?
Re:macOS deprecating scripting language runtimes, including ... by em500 on Thursday June 06, 2019 @06:55AM (#20113279)
It's certainly not any worse than BASIC on 1980s home micro's. (IMO it's not any worse than Python either.)
Re:macOS deprecating scripting language runtimes, including ... by Fnoord on Thursday June 06, 2019 @03:49AM (#20112423)
When you were 6 years old is a different time from now. You probably did not have an always-on connection. There was probably no such thing as Web 2.0. Computers were more difficult to use. Google did not exist. The Internet was perhaps still taking off...
Re:macOS deprecating scripting language runtimes, including ... by skocznymroczny on Thursday June 06, 2019 @07:04AM (#20113322)
And then I remember that there wasn't much more to offer, because most "fun" functionality involved POKE'ing 'random' memory addresses.
Re:macOS deprecating scripting language runtimes, including ... by bshipp on Wednesday June 05, 2019 @09:31PM (#20110773)
Installing the version you need when you want to run a script is arguably easier for newbies than all the error messages arising from an out of date implementation originally included with an OS.

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.

Re:macOS deprecating scripting language runtimes, including ... by SeanLuke on Wednesday June 05, 2019 @10:36PM (#20111105)
> Windows users have had no choice but to do that for decades.

You're saying this like it's a good thing.

Re:macOS deprecating scripting language runtimes, including ... by bshipp on Thursday June 06, 2019 @01:33AM (#20111870)
It's not a good thing or a bad thing. I'm saying it's not a thing at all.

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.

Re:macOS deprecating scripting language runtimes, including ... by Godel_unicode on Thursday June 06, 2019 @02:53AM (#20112181)
Lots of people on just this thread, who have far more than a glancing interest, have expressed their disagreement with this exact idea.

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.

Re:macOS deprecating scripting language runtimes, including ... by arvinsim on Saturday June 08, 2019 @09:22PM (#20136359)
On the contrary, not teaching people how to install the interpreter just perpetuates the idea that it is beyond the ken of mere mortals. And that only "Wizards" should do it.

Installing the interpreter is nothing special. It should be taught as such.

Re:macOS deprecating scripting language runtimes, including ... by rurban on Thursday June 06, 2019 @12:44AM (#20111657)
The problem is not doing anything serious. Of course this would need an updated language runtime.

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.

Re:macOS deprecating scripting language runtimes, including ... by tlrobinson on Thursday June 06, 2019 @12:54AM (#20111696)
It seems like there’s an opportunity for a lightweight statically-linked scripting language. Something between Go and Python.
Re:macOS deprecating scripting language runtimes, including ... by rurban on Thursday June 06, 2019 @07:32AM (#20113467)
The standard toolkit for this is perl. It's used in automake, most gnu utils and git. python and ruby bring nothing new to the table, besides being newbie friendlier.
Re:macOS deprecating scripting language runtimes, including ... by erikpukinskis on Wednesday June 05, 2019 @11:43PM (#20111385)
> if you're doing anything serious for production then the environment should be containerized.

What do you mean?

Re:macOS deprecating scripting language runtimes, including ... by __full_pint on Thursday June 06, 2019 @12:34AM (#20111620)
I’m not OP but:

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.

Re:macOS deprecating scripting language runtimes, including ... by erikpukinskis on Thursday June 06, 2019 @01:24PM (#20116773)
But you wouldn’t want to develop in that environment, right? You do integration testing in it, but development should largely happen in small modules, with unit tests and test data, no?
Re:macOS deprecating scripting language runtimes, including ... by __full_pint on Thursday June 06, 2019 @03:36PM (#20118235)
Of course you do that type of testing.

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.

Re:macOS deprecating scripting language runtimes, including ... by erikpukinskis on Thursday June 06, 2019 @03:42PM (#20118299)
Right, that’s why you do integration testing (manual and automated) but are you saying therefore you should do all development inside a production environment?

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.

Re:macOS deprecating scripting language runtimes, including ... by __full_pint on Thursday June 06, 2019 @06:21PM (#20119812)
OP was referring to containerizing your environment for package development.

What does connecting to a production DB have to do with any of that?

Re:macOS deprecating scripting language runtimes, including ... by ynx on Thursday June 06, 2019 @01:04AM (#20111738)
at the very least, virtualenv (for Python) to isolate the library dependencies from the system libraries.
Re:macOS deprecating scripting language runtimes, including ... by new_realist on Wednesday June 05, 2019 @08:41PM (#20110508)
Does OSX offer reasonable container technology? chroot?
Re:macOS deprecating scripting language runtimes, including ... by pram on Wednesday June 05, 2019 @08:51PM (#20110562)
macOS has a native hypervisor framework, Docker and xhyve uses it.

https://developer.apple.com/documentation/hypervisor https://github.com/moby/hyperkit

Re:macOS deprecating scripting language runtimes, including ... by new_realist on Wednesday June 05, 2019 @09:16PM (#20110697)
A hypervisor is not exactly a container. Definitely not in the Linux sense. It may be more secure, but it is also slower.

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.

Re:macOS deprecating scripting language runtimes, including ... by markstos on Wednesday June 05, 2019 @09:18PM (#20110708)
How much slower?
Re:macOS deprecating scripting language runtimes, including ... by jackfraser on Thursday June 06, 2019 @12:15AM (#20111530)
Not much slower than, say, Hyper-V or Virtualbox or other hypervisors that live alongside a general purpose desktop OS. Remember, they're using the same Intel chips and VT-d and such as anything else; as long as you have enough CPU power it's going to run fine.

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.

Re:macOS deprecating scripting language runtimes, including ... by tele_ski on Thursday June 06, 2019 @09:32AM (#20114333)
Our build time on Linux container is 8 minutes, but it's a few hours on macOS using docker containers. I haven't dug into it but the hypervisor seems to be single threading the normally multicore compile.
Re:macOS deprecating scripting language runtimes, including ... by wyufro on Thursday June 06, 2019 @03:44AM (#20112387)
Primarily disk access is a lot slower, even with Hyper-V. Eg. Compilation suffers from this. But tasks that don't use the disk too much shouldn't be that bad.
Re:macOS deprecating scripting language runtimes, including ... by TehCorwiz on Wednesday June 05, 2019 @10:19PM (#20110991)
Measurably slower than a LXC container, but still much faster than a full VM.
Re:macOS deprecating scripting language runtimes, including ... by bpye on Wednesday June 05, 2019 @09:14PM (#20110693)
Qemu has a backend too if I'm not mistaken?
Re:macOS deprecating scripting language runtimes, including ... by AceJohnny2 on Wednesday June 05, 2019 @08:58PM (#20110596)
In other words, nothing serious.

Does anyone actually use Docker on Mac?

Xhyve is more of a proof-of-concept than a production-ready tool.

Re:macOS deprecating scripting language runtimes, including ... by RussianCow on Wednesday June 05, 2019 @09:02PM (#20110625)
> Does anyone actually use Docker on Mac?

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.

Re:macOS deprecating scripting language runtimes, including ... by enneff on Wednesday June 05, 2019 @09:08PM (#20110652)
But doesn’t Docker on Mac run a Linux VM? I don’t think it uses any of MacOS’s isolation features.
Re:macOS deprecating scripting language runtimes, including ... by frizkie on Wednesday June 05, 2019 @09:14PM (#20110695)
Re:macOS deprecating scripting language runtimes, including ... by dwaite on Wednesday June 05, 2019 @09:02PM (#20110626)
> Does anyone actually use Docker on Mac?

I use it extensively. It is a desktop product however; it you aren't expected to put a swarm of MacBook pros into production.

Re:macOS deprecating scripting language runtimes, including ... by brianwawok on Wednesday June 05, 2019 @10:42PM (#20111136)
Unless you want to run CD to the App Store? So fun....
Re:macOS deprecating scripting language runtimes, including ... by jackfraser on Thursday June 06, 2019 @12:15AM (#20111537)
Ah, but if the XServe had not died and datacenters had racks of these things, there'd no doubt be a production quality implementation by now. Shame.
Re:macOS deprecating scripting language runtimes, including ... by jen20 on Wednesday June 05, 2019 @09:03PM (#20110635)
Xhyve is but one of the options for fronting hypervisor.framework.

Calling it “not serious” is quite wrong.

Re:macOS deprecating scripting language runtimes, including ... by abhorrence on Wednesday June 05, 2019 @09:01PM (#20110622)
I use Docker on Mac, and know many others who do as well.
Re:macOS deprecating scripting language runtimes, including ... by markn951 on Wednesday June 05, 2019 @09:02PM (#20110628)
I personally know of at least 3 or 4 engineering teams of 30+ developers who use it daily.
Re:macOS deprecating scripting language runtimes, including ... by konart on Thursday June 06, 2019 @08:30AM (#20113866)
>Does anyone actually use Docker on Mac?

Sure, for development tasks.

Re:macOS deprecating scripting language runtimes, including ... by m463 on Wednesday June 05, 2019 @10:04PM (#20110912)
I think apple fundamentally does not understand containers.

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

Re:macOS deprecating scripting language runtimes, including ... by eropple on Wednesday June 05, 2019 @11:29PM (#20111322)
> I think apple fundamentally does not understand containers.

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?

Re:macOS deprecating scripting language runtimes, including ... by m463 on Thursday June 06, 2019 @01:26AM (#20111838)
The devops guys need to spread the love to the OS group and ship it with the OS.

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.

Re:macOS deprecating scripting language runtimes, including ... by saagarjha on Thursday June 06, 2019 @12:57AM (#20111705)
> apple doesn't want macos to be virtualized.

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.

Re:macOS deprecating scripting language runtimes, including ... by eropple on Thursday June 06, 2019 @11:00AM (#20115182)
Can you run them simultaneously? I've never tried.
Re:macOS deprecating scripting language runtimes, including ... by plorkyeran on Thursday June 06, 2019 @03:35PM (#20118224)
Yes, but there are some issues. For pure macOS development it's usually fine, but anything touching the simulator breaks if multiple versions of Xcode try to use it at the same time. I quickly got in the habit of always exiting Xcode before starting a different version.
Re:macOS deprecating scripting language runtimes, including ... by m463 on Thursday June 06, 2019 @01:30AM (#20111859)
- "allows" not the same as supports.

- I think xcode-select just modifies a .plist.

Re:macOS deprecating scripting language runtimes, including ... by saagarjha on Thursday June 06, 2019 @01:39AM (#20111895)
It changes a symlink at /var/db/xcode_select_link, and all of the development tool stubs that Apple has placed consult this to see which binary to run. This is pretty much the officially supported way to switch between multiple copies of Xcode.
Re:macOS deprecating scripting language runtimes, including ... by toyg on Thursday June 06, 2019 @08:08AM (#20113704)
Containers lose a lot of appeal once you leave the server, and Apple have explicitly abandoned the server market.

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.

Re:macOS deprecating scripting language runtimes, including ... by Gaelan on Thursday June 06, 2019 @12:36AM (#20111627)
I imagine you could get pretty far with sandboxing+chroot, but it wouldn’t be docker. You’d definitely be able to prevent stuff in the container from getting out, but I’m not so sure you could reproduce docker’s “VM-like” (I.e. the inside of the container is ~identical to a normal Linux machine, with no need to make stuff compatible) quality.
Re:macOS deprecating scripting language runtimes, including ... by wedn3sday on Wednesday June 05, 2019 @08:44PM (#20110524)
Singularity recently released a (non-fully featured, but still useful) mac version.