Live data from Hacker News

PowerShell is open sourced and is available on Linux

azure.microsoft.com

721–730 of 790 posts

Re: PowerShell is open sourced and is available on Linux

#721
post #322

Earlier quoted context omitted.

Its ecosystem isn’t. C# will never get accepted as an open source product. It only has open source code, it’s not actually ‘open-source.’ Compare it with Typescript, which—despite originating from Microsoft—is a truly open project, and getting love left and right. C# might be better than Java/JVM, but it’s not better enough. The culture/ecosystem barrier is so high that C# would have to be miles ahead, technically su…

That's not what Worse Is Better means . Did you read the Gabriel paper? /nitpick

I got it from Unix’s haters handbook.

Re: PowerShell is open sourced and is available on Linux

#722
post #644

Earlier quoted context omitted.

If we are not talking about interactive use then to distribute "robust" scripts, you could use nicer and richer Perl, Python eco-systems. For interactive use, the conciseness, the human-readability of input/output and the fault-tolerance to unrelated changes in the input/output formats provided by Unix shells are also preferable.

The motivation for PowerShell was to have something good at both. Why switch contexts when moving from interactive use to coded automation if you don't have to?

Because the requirements change depending on which one you're doing: quick shell automation isn't the same as the kind of automation you'd use perl/python for.

Re: PowerShell is open sourced and is available on Linux

#723
post #657
post #506

Earlier quoted context omitted.

After a number of years using PowerShell, my conclusion is the opposite: text "scraping" is just better for most cases. Normal shell usage means doing a lot of one-shot pipelines incrementally. This is just easier and faster to do when passing text around because you can look at it and not have to inspect some object for it's type and what attributes/methods it provides. Parsing the text is not the problem here (alth…

Passing CSV around can be a useful middle ground, if you're using utilities that all do proper escaping and allow newlines in strings etc., such as csvkit.

DSV is the default format for many unix utils, and AWK and cut parse it easily.

Re: PowerShell is open sourced and is available on Linux

#724
post #721

Earlier quoted context omitted.

That's not what Worse Is Better means . Did you read the Gabriel paper? /nitpick

I got it from Unix’s haters handbook.

Well, you clearly didn't get the full definition. Go read Lisp: The Good News, The Bad News, And How To Win Big

Re: PowerShell is open sourced and is available on Linux

#725
post #415

Earlier quoted context omitted.

> I've been using bash for 20 years, trained a few hundred RHCEs, and spent a large part of my life working for Red Hat and then IBM's dedicated Linux group Neat. Irrelevant. > So yeah maybe I don't know any better, but that's because I haven't encountered it before. Okay? > Piping objects to 'where' and 'select' is simply a better approach than scraping text. Why is it better? 'Simply'? Is this unique to powershell…

We've banned this account for repeatedly violating the guidelines. If you'd like to commit to only commenting civilly and substantively, you can email hn@ycombinator.com and we'll happily unban the account if we believe you'll do so.

So, if you disagree with an HN celebrity, you can get banned?

good thing my argument with tptacek happened before you came on-board.

Re: PowerShell is open sourced and is available on Linux

#726
post #494

Earlier quoted context omitted.

I'm not a huge fan of PowerShell but you're not really making a good comparison here. Bash is "just a shell" that executes commands with a few bits of syntactic sugar here and there to make it easier to string those commands together and perform some primitive logic. PowerShell is basically an interpreter that works more like a Java Virtual Machine. Consider the hypothetical example that you need to lookup 100 users…

I'm not so sure it results in a vastly faster execution, at least on OSes which don't need half an hour to spawn a new process. So, yes, of course it was needed for Windows, because there creating a new process is so expensive that sometimes you've got to mortgage your house to do it.

I was going to cover this topic (the cost of starting/forking a process) in my original comment but decided it would be a bit tangential since I was able to make my point without it.

On Windows the cost of forking a process is high whereas on Unix/Linux it's low but on both platforms every application has a nontrivial startup time that will be significantly greater than a native call within an existing process.

Re: PowerShell is open sourced and is available on Linux

#727

Earlier quoted context omitted.

I didn't call awk trivial, I meant to say that the prudent application of powerful tools makes quick work of otherwise intractable problems. Forgive my being frank, please, but I think that given the context of this conversation, it's appropriate: Most users don't HAVE non-trivial problems! There aren't features in sed nor awk, nor regular expressions in general that weren't put there for some specific reason in the…

I have no time for tool worship, language worship, and other sentiment like that. These are tools, not people. I'll use the best I can buy, borrow, or make until I see another better one comes along.

A corporation has no incentive to give you (let you keep forever) the best possible tools.

Re: PowerShell is open sourced and is available on Linux

#728

Earlier quoted context omitted.

Yes, this makes for much easier to read code for people down the road :) I think OPS folks (myself included) sometimes create things thinking nobody but them will use them, then an occasion arises to share, and you're stuck with something functional but horrible to read. It took just one such occasion for me to convert to writing everything from the perspective that 'other people may need to use this.'

There seem to be a few tools to do it for you automatically. ctrl+shift+a if you're using powershell studio for example. Or https://gist.github.com/DBremen/9db6632423d673ff18f6

This is cool, I'd not seen this before! Thank you for the link.

Re: PowerShell is open sourced and is available on Linux

#729
post #514
post #93

Earlier quoted context omitted.

As a note, there have been strongly-typed shell languages for Unix for some time. Scheme Shell[0], Turtle[1] and TCSH[2] leap to mind; but there's nothing preventing a developer from using Perl, Python, Lisp or any other language that allows itself to accept stdin as an interpreted script. 0: https://scsh.net/ 1: http://www.haskellforall.com/2015/01/use-haskell-for-shell-s... 2: http://www.tcsh.org/Welcome Edit: oh m…

I've never seen tcsh referred to as strongly typed. Could you elaborate?

I was mistaken, it's not.

    ~> @ i = 0 + "foo"
    @: Expression Syntax.
    ~> @ i = 0 + "1"
    ~> echo $i
    1

Re: PowerShell is open sourced and is available on Linux

#730
post #93

Earlier quoted context omitted.

As a note, there have been strongly-typed shell languages for Unix for some time. Scheme Shell[0], Turtle[1] and TCSH[2] leap to mind; but there's nothing preventing a developer from using Perl, Python, Lisp or any other language that allows itself to accept stdin as an interpreted script. 0: https://scsh.net/ 1: http://www.haskellforall.com/2015/01/use-haskell-for-shell-s... 2: http://www.tcsh.org/Welcome Edit: oh m…

0: scsh is a nice scripting language, however it's not meant for interactive usage (PowerShell is) See: http://www.alphanet.ch/~schinz/scsh-faq/scsh-faq_4.html#SEC3... Scheme is also dynamically typed. 1: It's the first time I see it, but from a cursory glance and some docs ( http://hackage.haskell.org/package/turtle-1.0.0/docs/Turtle-... ) I think it doesn't include simply calling external commands (I couldn't find…

I was mistaken about tcsh' type system. It's not strongly typed:

    ~> @ i = 0 + "foo"
    @: Expression Syntax.
    ~> @ i = 0 + "1"
    ~> echo $i
    1
Post reply on HN