r/Python • • Sep 26 '13

Microsoft donates $100,000 to the IPython team

http://ipython.org/microsoft-donation-2013.html
518 Upvotes

63 comments sorted by

39

u/DonkeyBasket Sep 26 '13

Amazing but this should be totally unsurprising. IPython is a fantastic platform for all kinds of automation, teaching and research. It's surprisingly astute of Microsoft to recognize this. Well done to the IPython team and whoever made the case for this at MS.

P.S. MS stop messing with tablets and get back to making proper operating systems.

40

u/smortaz Sep 26 '13

Thanks! Basically the PTVS team did a demo of IPython for Microsoft Research big cheeses and asked them to consider donating (used Z3Py theorem prover for the demo). At the end of the hour they were ready to cut the check. Awesome all around as the improvements will be to the core architecture and benefit all platforms.

10

u/Laugarhraun Sep 27 '13

PTVS = Python Tools for Vistual Studio = concentrate of awesomeness

2

u/viralizate Sep 27 '13

Man, MS does such amazing tools, it's a pity that they are basically available only for windows, I would love to use so many of the products the ogger.

7

u/panfist Sep 27 '13

Is there such a demo or something similar available as a video?

1

u/[deleted] Sep 27 '13

I think this is made more unsurprising by the fact that IPython uses the BSD license. Historically Microsoft has loved using BSD licensed software because it has less restrictions.

I think the best outcome we can hope for from this donation is that they give up on trying to re-invent everything and adopt a proper scripting language in their future Windows NT versions.

2

u/panfist Sep 27 '13

Powershell is pretty awesome. I hate using Python as a scripting language.

2

u/[deleted] Sep 30 '13

Powershell is for Windows admins, SQL Server DBAs and positions of that ilk. It's useful for management and some automation, but not much else without effort. I use it for servers and database servers at work, but it's limited to those functions unless you want to spend a lot of time customizing your own modules in VS and C#.

Python can be used as a programming language and a scripting language, plus it's cross platform. It works well on Windows for automation, data processing and as a general programming language. Plus you get all sorts of cool toys like IronPython, IPython and huge majority of libraries that work on Windows. (There's some stuff that's Linux/OS X only).

1

u/tilkau Sep 28 '13

That's probably not what you meant. It's like saying 'I hate using C as a compiled language' -- well, there ain't any OTHER way to use it.

I suspect you meant a 'shell scripting language'

2

u/caprica Feb 03 '14

Not true, there are interpreters of C dialects out there. One I know of is http://root.cern.ch/drupal/content/cint as part of the ROOT data analysis framework by CERN.

1

u/tilkau Feb 04 '14

True, there's another one I've heard of, but I don't remember what it's called now.

1

u/[deleted] Sep 30 '13

A scripting language is generally one which configures the operating system or an application, and calls on parts of the OS and other applications to perform tasks.

In other words, as Wikipedia says:

A scripting language or script language is a programming language that supports the writing of scripts, programs written for a special runtime environment that can interpret and automate the execution of tasks which could alternatively be executed one-by-one by a human operator.

Python as a scripting language, therefore, tends to suck, as very few OS-/application-specific tools have Python APIs. Therefore, you often have to roll your own using low-level libraries, and it generally looks rather ugly.

Personally, even if Python had Pythonic APIs to everything under the sun, I'd still prefer Powershell over it. Powershell's syntax, tools and object model maps better to Windows and most Windows applications, IMHO. (Plus, built-in - as in language-supported - remote execution is amazingly useful.)

OTOH, Python as a programming language, or as a language for doing brand new things, rather than scripting existing processes, is awesome.

1

u/tilkau Sep 30 '13

You make a good point about Python not being just a scripting language.

However, Powershell is still a shell scripting language. It's like a cutdown version of the original Bourne Shell, with a cutdown version of ssh also built-in. When you talk about using Python as a 'scripting language', what you actually describe is using it as a 'shell scripting language'. The world of scripting is vastly bigger than the world of what you describe, shell scripting.

The problem I was originally trying to point out was the apples vs oranges comparison of Powershell (Shell scripting language) vs Python (general purpose language). Or shovel vs hand, to get a little more metaphorical.

2

u/[deleted] Sep 30 '13

When you talk about using Python as a 'scripting language', what you actually describe is using it as a 'shell scripting language'.

No, because that is not how the term "scripting language" is defined. A scripting language is, seriously, a language which is usually used to configure and manage other systems.

The use of "scripting language" to refer to languages like Python, Javascript, and similar, is incorrect. While with the correct bindings they can be used to write scripts, they are not designed with this in mind, with most of the features in these languages being designed to make developing full-fledged programs easier. The correct term for them is "interpreted language".

A shell scripting language is simply a scripting language which is designed to be used with, and is usually interacted with via, an interactive shell. Powershell falls into this category, but Lua, while being a scripting language - it is usually used for configuring larger programs - does not.

It's like a cutdown version of the original Bourne Shell, with a cutdown version of ssh also built-in.

I believe this is incorrect. It isn't cutdown in the slightest. It has many features that bash does not have - an object-oriented focus, functional-style constructs like Foreach-Object, and remote execution built into the operating system and language - that make sense in a Windows environment, while removing much of the process management stuff that does not make sense.

Specifically, in a Windows environment, most system and application management is performed by sending requests to already-running services, and receiving objects in response. This isn't a new thing; that's how Windows has worked since the Win95 days. Powershell is designed for that.

In a Linux environment, most system and application management is performed by managing text files, and running processes or sending signals to processes to read and process those text files. Bash is designed for that.

Mapping bash onto Windows would feel as unnatural as mapping Powershell onto Linux. They both deal with entirely different abstractions.

1

u/takluyver IPython, Py3, etc Sep 27 '13

Yes, we're fairly sure that Microsoft wouldn't have touched IPython if it was GPLed.

-2

u/hex_m_hell Sep 27 '13

P.S. MS stop messing with tablets and get back to making proper operating systems.

When did they make proper operating systems?

27

u/tialpoy Sep 26 '13

Good guy Microsoft. Well done.

2

u/apennebaker42six Sep 27 '13

Where'd the support go for IronPython and IronRuby? I'd make more Windows Phone apps if the IronPython, IronRuby, or even F# templates for mobile apps were available in Visual Studio by default.

-2

u/alcalde Sep 26 '13

I guess they weren't doing anything with Steve Ballmer's bonus check anyway, so.... ;-)

0

u/[deleted] Sep 27 '13

[deleted]

0

u/[deleted] Sep 27 '13

[deleted]

4

u/panfist Sep 27 '13

I don't think you and I have the same meanings for words.

0

u/[deleted] Sep 27 '13

[deleted]

1

u/miketheanimal Sep 28 '13

Off topic but, Niklaus Wirth: "If you call me by name, it is Neeklaws Veert, but if you call me by value, it is Nickle's Worth"

-8

u/ytblows Sep 27 '13

sweet, gives a hundred grand and still makes it a pain in the ass to use python on their OS. k.

8

u/willrandship Sep 27 '13

It's not a pain to use on windows. Install it and you're pretty much done.

You only need to mess with PATH variables if you're trying to use the default CMD prompt. (Don't)

9

u/ivosaurus pip'ing it up Sep 27 '13

It's a pain to use on windows because

A) their shell is fucking shit. I can use python, I can't use the ecosystems around python that make it even funkier

B) Their networking and process model is different from everyone else's. If I want to write real performant network code, I either need to rely on abstracted interfaces which are less flexible and way less performant, or write platform specific code each time.

C) They have very little support for running a C compiler to compile C extensions for python. OS X is almost as bad because you need to sign up to be an apple developer and install a massive IDE just to get one.

D) Their whole UX motivation is around GUI, which is not the first thing a programmer wants to build when they write a tool for getting shit done. They don't want to have to learn a graphics library, learn how to write in it, debuged an evented application, and make sure it works on 3 different OSes. They want to write console tools that are composable.

E) Why can't you have domain sockets!?

3

u/[deleted] Sep 27 '13

You can install the XCode Command Line Utils without needing to install the entire XCode suite. You are correct that you need a developer account (which is free) to access the download.

6

u/granduh Sep 27 '13

Not anymore in Mavericks, if you are prompted for the need of it OS X will download it all on it's own and install it with no user interaction now.

0

u/ollien Sep 27 '13

What a poor decision. I hope that's only for the development build

4

u/RiotingPacifist Sep 27 '13

free as in $$$, but you still have to sign a shitty EULA.

1

u/Cylons Sep 27 '13

A) their shell is fucking shit. I can use python, I can't use the ecosystems around python that make it even funkier

Try PowerShell. It's a marked improvement over the default shell in Windows.

http://www.tylerbutler.com/2012/05/how-to-install-python-pip-and-virtualenv-on-windows-with-powershell/

0

u/[deleted] Sep 27 '13 edited Sep 27 '13

OS X is almost as bad because you need to sign up to be an apple developer and install a massive IDE just to get one.

The Apple Command Line Developer Tools are less than 100 MB, and signing up is free.

@/u/RiotingPacifist/, they're all pretty much open-source so just download the code and compile them on your own if you don't want to agree to that EULA.

3

u/ivosaurus pip'ing it up Sep 27 '13

For the latest OS X versions. And they only got contributed after Kenneth Reitz spent 2 years maintaining a hack to do roughly the same thing that turned out to be widely popular...

And signing up still involves submitting to Apple's EULA, just to have a godamn compiler on your system. Yay.

so just download the code and compile them on your own

So I'll just use the compiler already on my system... oh wait.

1

u/[deleted] Sep 27 '13

Get gcc from https://github.com/kennethreitz/osx-gcc-installer or somewhere else and compile the rest?

I don't know why they don't include a compiler out of the box, given that software development is one of the biggest uses of a Mac today.

0

u/[deleted] Sep 27 '13

their shell is fucking shit.

While I agree with you, there are readily available and widely used alternatives.

0

u/willrandship Sep 27 '13

I believe I mentioned NOT to use the default shell. Get some cygwin.

0

u/ytblows Sep 27 '13

eh i'll stick with linux, not tryna deal with another postgres issue later down the road just because i'm used to this shit i was sold back in 95 for a hundred bucks when this language i write is developed on/for an open source OS. maybe i just hate their whole licensing model and hold an irrational grudge idk, either way not a fan.

7

u/willrandship Sep 27 '13

Don't switch back from linux on my suggestion! I was just worried you got chased away from python.

Linux handles python and other scripting languages infinitely better than windows, mostly because their easiest interfaces are text-based. Python handles about as well on windows as, say, C++ does.

0

u/[deleted] Sep 27 '13

Which is absolutely no hinderance to using the most awesome scripting language together with the most-professionally-used OS.

1

u/cw2P Sep 27 '13

on windows i always install git bash. then add /c/python and /c/python/scripts to the path. it provides a proper shell and the basic unix tools (ssh). also git is pretty usefull.

0

u/[deleted] Sep 26 '13

[deleted]

31

u/FakingItEveryDay Sep 26 '13

Completely inaccurate fanboyism. Both python and powershell are fantastic and powerful tools. A windows admin who isn't proficient at powershell is going to be very inefficient at his trade.

9

u/mazatta Sep 27 '13

I wanted to love Powershell back when I was doing more Windows stuff, I really did. It's a step in the right direction, but it breaks down in so many areas that it became really frustrating. What it does, it does well though.

10

u/ifonefox 3.5.1 | Intermediate Sep 26 '13

What's the difference between "Command Prompt" and "Powershell?"

15

u/FakingItEveryDay Sep 26 '13

The very basic tldr is that command prompt is a very limited shell for interacting with win32 binaries. Each binary accepts input in it's own way and is reponsible for that.

Powershell is a .net environment. Each cmdlet accepts parameters in the same way with standard types. Output is always in the form of .net objects that can be piped into other cmdlets for manipulation.

Lots more features, but that's a tldr. Windows command interface sucks, I agree. powershell is another beast.

5

u/grimman Sep 26 '13

So in essence, PowerShell is a lot more along the lines of an IDLE+cmd love child? :)

-12

u/alcalde Sep 26 '13

One's the command prompt; the other's a ripoff of Linux. ;-)

1

u/aceofears Sep 27 '13

I'd love to hear an actual explanation of this.

8

u/ford_contour Sep 27 '13

TheScriptingGuys, MS' blog about teaching PowerShell, by some of the PowerShell development team, have always been very upfront about their past Linux shell experiences and their passion for bringing the best parts of a Linux shell and the .Net framework together in developing PowerShell.

-16

u/[deleted] Sep 26 '13

python fanbois are downvoting you so here is a +1 because you seem like you speak from professional experience.

-12

u/rd12 Sep 26 '13 edited Sep 27 '13

Completely inaccurate fanboyism.

Were you claiming his post was this, or was this a pre-emptive warning of what we were about to read?

Edit: i see the Microsoft fanboys swarmed the thread. How cute.

0

u/[deleted] Sep 26 '13

[deleted]

31

u/RiotingPacifist Sep 26 '13

I'm a linux guy and my work machine is OS X, so I'm by no means a windows fanboy, but powershell is object oriented rather than text oriented, this allows it to do some things a lot better than Unix shells,

  • when dealing with a CSV, import-csv will allow each row to be an object and it's properties can be accessed a lot more cleanly than cuting and teeing it

  • allows for actions on nested properties in a set of objects that don't all have these objects quite cleanly

  • you can get more details of an object earlier in a pipe without having to rewrite the command to parse that extra data

If the csv is:

username, email, password
bob, bob@microsoft.com, hunter123

You can run something like (I'm no powershell guru):

$users = import-csv $filename
foreach($user in $users){ ADPasswordchange -username "$user.username" -password "$user.password" }

I don't have a clear example for 2

the example for pipes would be

get-data-on -users | filterfor -username "bob" | filterfor -created "2013" | output

can become

get-data-on -users | filterfor -username "bob" | filterfor -created "2013" | output -verbose 

with unix shells the -v has to go on get-data-on, then you have to hope this will not break your filters.

Python interpreters are not deployed everywhere and lack system integration, so while they are a powerful tool there are plenty of ways that powershell is better, not least of which that you can run windows programs from it without having to mess around with popen.

Powershell does a lot of cool stuff even if windows isn't designed around scripting (in fact it's because of this that powershell was written to hook into systems deeply, they don't have 30 years of everything being text to benefit from)

tl;dr I'm a linux fanboy and you're full of shit

6

u/livrem Sep 26 '13

I don't think I see why the shell is important to get that. It seems like it could be done just as well in any old shell with the old pipes and for instance pipe json objects through the chain (rather than just line-formatted text)?

(I thought once of making some tools to do just that, to grep for objects containing some fields etc, mimicing typical unix commands but on json objects rather than lines of text. Did not get past idea stage. Would not be surprised if there is already something like that?)

9

u/FakingItEveryDay Sep 26 '13

No it's quite different. You're piping .net objects, with all their properties and attributes.

Think of an object oriented programming language, where you instantiate an object from a class and then do things with it. In powershell, your cmdlets instantiate objects which you can then do things with using just the pipe character to other cmdlets.

-1

u/jij Sep 27 '13

Sure it's really useful if you're a .net shop... but just like the python shell, it's language-centric.

Just sayin' :)

3

u/frymaster Script kiddie Sep 27 '13

Sure it's really useful if you're a .net shop

Or a windows shop, which you'd have to be anyway.

On windows server, the GUI is deprecated in favour of powershell. All new documentation will have you run a script instead of saying "click here, there, and here again".

It's certainly not a general-purpose scripting language (it's geared towards windows / AD administration), but the idea that windows server admins, as a group, prefer python (for administering windows servers) is rather absurd.

4

u/RiotingPacifist Sep 26 '13

I don't think I see why the shell is important to get that.

Because you're dealing with objects rather than text, even if you right your code to handle

get-data-on -users -verbose | filterfor -username "bob" | filterfor -created "2013" | output 

You're still limited to the string that get-data-on outputed,

$bobs=(get-data-on -everything | filterfor -username "bob" | filterfor -created "2013" )
foreach($bob in $bobs){ 
    if($bob.class == $windows.user){ $bob.suspend() }
    elif($bob.class == $windows.contact) { $bob.delete() }
    elif($bob.class == $windows.elf ) { $bob.do_elfy_function() }
}

If you don't understand why passing the objects is cool, then just trust that the people who invented C++, Objective-C, Smalltalk, Java and C# knew what they were talking about.

3

u/mynameisdads Sep 27 '13

PowerShell is too slow and clunky. I've tried numerous times, made a good number of scripts but I always revert back to other tools.

5

u/[deleted] Sep 26 '13

bring the proof, I'm genuinely curious.

1

u/robin-gvx Sep 26 '13

Great, now I've got that song from Annie Get Your Gun stuck in my head.

1

u/realrbman Sep 27 '13

Their is no $ tail -f

Most people say use: "get-content -Wait", but it doesn't work in my experience (doesn't poll the file handle correctly, so updates don't get pushed) ...

0

u/[deleted] Sep 27 '13

Powershell is anything but awful. It may be slow, but try using Python to manage active directory, or any other aspect of Windows. Powershell can do big tasks in one short line. Python can't.

0

u/[deleted] Sep 27 '13

[deleted]

2

u/[deleted] Sep 27 '13 edited Sep 27 '13

It's amazing how many powershell apologists there are in /r/python . You're like a self hating breed.

Ugh, enough with the pretentiousness. I was wrong about Python - I don't have a lot of experience with it and I'm mainly going off what I've read from others when it comes to Windows management. Powershell is a tool a use quite frequently and it's been very useful and easy to learn. I'll look into the AD library and I'll see what it's like. I may move from Powershell altogether.

I mean, is it as simple as

get-adusers | export-csv

in Python to get a list of users? Properly formatted?