Hacker News new | ask | show | jobs
by akoeplinger 4089 days ago
There's already a PowerShell implementation for *nix: https://github.com/Pash-Project/Pash
1 comments

It depends on what one's definition of "is" is. From the top of the link:

  An Open Source reimplementation of Windows 
  PowerShell, for Mono.
Mono is not *nix and PowerShell provides direct access to [nearly?] the entire Windows OS.

More from the project page:

  Status

  Alpha. This project is useful in certain constrained 
  applications, e.g. the NuGet Console in Xamarin Studio.
I just wanted to point out that there's nothing that inherently ties PowerShell to Windows (as expected, it's just a shell after all).

> PowerShell provides direct access to [nearly?] the entire Windows OS

PS has access to the .NET Framework which abstracts the OS APIs, not really to Windows directly.

There's also chatter that MS is already working on porting PowerShell to CoreCLR/.NET Core (the cross-plat, open-source version of .NET).

The abstraction layer is 'thinner' with Windows. With *nix we're dealing with serializing text with regexes or parsers or both coming in and deserializing to text on the way out.

It's a bit of a Turing tarpit when it comes to non-inherency.

Couple of points:

1. PowerShell reimplements older commands as aliases, e.g. ls is an alias for Get-ChildItem. You'd not be relying on existing shell functionality.

2. I don't know much about it, but wouldn't the upcoming Linux IPC improvements being made to support kdbus do away with needing to handle message passing in the way you describe?

PowerShell's get-childItem returns something on which get-methods can be called. How will the improved IPC create an easy systematic way of creating meaningful responses to "get-methods" system-wide?
dbus makes use of a type system to describe messages passed over it. kdbus is an implementation of dbus at the lowest level of the OS. The IPC improvements to support kdbus will be made at the kernel level. At a higher level, systemd will make use of these same processes, so it's not purely internal to the kernel. Therefore, there's no restriction on building an object-oriented approach to interfacing with the OS, which is what PowerShell uses.

Perhaps my logic is off, or my view is missing key information, but from my novice perspective it seems to make sense.

If you're interested, this page has more information on the type system used in dbus: http://dbus.freedesktop.org/doc/dbus-specification.html#type...