| ▲ | adamnemecek a day ago |
| Looking at things like this ``` let result = try await Subprocess.run( .name("ls"),
arguments: ["-la"],
output: .string(limit: 4096)
)print(result.standardOutput)` ``` reminds me that macOS could really use something like powershell (I know you can run powershell on macOS) where you pass around structured data, rather than the endless parsing and reparsing. This is mostly a feature of the shell but you do need some language infrastructure to accomplish it. |
|
| ▲ | dadoum a day ago | parent | next [-] |
| To me the secret sauce behind powershell is the .NET infrastructure, which allows much more runtime introspection than the usual compiled programming languages, allowing a lot of flexibility without being too wonky. Unfortunately the Windows team seemed to not be on board with this vision, and thus it cannot achieve its full potential. The objective-c runtime may have been a good alternative here too, but I don't think Apple is encouraging its use anymore (and Objective-C is not the right language for that, neither is AppleScript imo). |
| |
| ▲ | steve1977 a day ago | parent [-] | | You can also access COM from PowerShell, which basically opens up a lot of the Windows world to it. And both .NET and COM and the object-oriented history of Windows is probably also why PowerShell will never really feel "at home" on UNIX platforms, for better or worse. |
|
|
| ▲ | bbkane a day ago | parent | prev | next [-] |
| They should adopt Nushell! It would be seen as very "Apple"- a brave great somewhat non interoperable user experience upgrade |
| |
| ▲ | adamnemecek a day ago | parent [-] | | I was a big fan of Nushell for some time but has the same problems as unix shells. I have this CLI tool that manages a lot of things for me (a big one is downloading and cataloging arxiv papers, it downloads them and tags them with metadata and gives each PDF a proper filename based on the author's name and publication year). I tried building this in Nushell but it became eventually so painful. | | |
| ▲ | bbkane 11 hours ago | parent [-] | | I'm sorry, what are the same problems you're referring to? I ended up leaving because: - it was unstable and kept changing (less of an issue now) - I still need to know bash due to its ubiquity - it was worse than python for data crunching scripts (ide tooling + my familiarity) This was several years ago so I'm curious about a more recent perspective | | |
| ▲ | adamnemecek 10 hours ago | parent [-] | | There is some unstability yes. For me the larger problems were the lack of types which in practice meant that I was running into the same problems as with bash. | | |
|
|
|
|
| ▲ | drfloyd51 a day ago | parent | prev [-] |
| So you mean the ability to run a shell from code
And receive structured data back? |
| |
| ▲ | adamnemecek a day ago | parent [-] | | Something like that yes. The endless parsing and reparsing that you need to do in the unix shells is such a pain. | | |
| ▲ | steve1977 a day ago | parent [-] | | It's both curse and blessing. Of course it gives you ultimate freedom, but like with programming languages, I personally prefer the guardrails that a type system provides. | | |
|
|