News for hackers. Stuff that matters.
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.