Unified Rust-based tooling (LSP, linter, formatter) for PowerShell #27604
Replies: 3 comments 3 replies
-
|
This is certainly something that would be an interesting to see happen. I think this is something that you should add to one of the PowerShell Community calls as a discussion point as this isn't a small change & lots of work & whilst aspirational I worry that this would displace current engineers that have built those tools so far in the languages that they are currently in. FWIW, I've previously floated the idea of rewriting some of PowerShell's internals in F# as opposed to C# but that definitely wasn't something that was likely to ever happen, even with all our new #AssistiveTechBuddies / AI Agents that can help in these bigger often unrealistic engineering projects. I get the FYI I also added this for discussion in the PowerShell Discord Server |
Beta Was this translation helpful? Give feedback.
-
|
Why does it have to be Rust? C# can get 99% of the way there just fine performance wise, Rust isn't some magical "everything is fast" language. And as much of a fan as I am of F#, C# is generally better performance wise because F# has its own required constructs that add allocations and overhead, so the argument for F# would be more around determinism (which you can do in C# as well) Theoretically, but it hasn't replaced TextMate in vscode yet. When it becomes an option we'll definitely explore it in PSES. Not to be a naysayer, but as someone who actually has done this work now day in day out for years, there are definitely opportunities to improve, but just saying "rewrite everything in rust" is doomed to failure IMHO. There's also nothing stopping you from doing it yourself! Script Analysis, syntax highlighting, etc. can be relatively extrinsic to PowerShell, you can make a custom LSP in Rust that does all that stuff. |
Beta Was this translation helpful? Give feedback.
-
|
I'm not convinced that Rust is so much better than C# that it's worth a rewrite, but even if it somehow was, it still has an accessibility problem. I think many of the people who'd be interested in contributing to PowerShell and PowerShell tooling come from the PowerShell world. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
About
This is just a suggestion, a topic for discussion.
Please correct me if I've written anything wrong.
Suggestion
Improve the PowerShell authoring experience by creating a new unified PowerShell tool in Rust to act as LSP, linter, formatter, and as base for IDE extensions.
Context
PowerShell tooling for LSP, lint and formatting is dated, incomplete and moving slow.
Rust based tooling (LSP, lint, format, type check), often also used as base for IDE extensions, are popping up for other languages. Examples:
nu --lsp). There is also an established Tree-sitter grammar (tree-sitter-nu) used for editor tooling.The skeleton / architecture exists in these tools for PowerShell to take inspiration from. There is also this unofficial tree-sitter grammar that I believe can be piggy backed for CST (concrete syntax tree) and formatting:
Other arguments:
Beta Was this translation helpful? Give feedback.
All reactions