Powershell: PSMore

Created on 25 Sep 2018  路  8Comments  路  Source: PowerShell/PowerShell

@lzybkr Could you please share more information about PSMore status?

  • Can now we integrate the code in PowerShell Core? Step-By-Step or as experimental feature?
  • What benefits we expect?

    • Less resource consumption? Less memory allocations? Less CPU consumption?

    • More fast startup?

    • More convenient use for users?

    • Empowerment?

Issue-Question

Most helpful comment

Status - no progress since the last commit.

The initial idea is basically a console version of Out-GridView combined with less, then I let myself get sidetracked into the formatting subsystem.

So for I have a prototype of a new way of specifying formatting that:

  • uses no xml (so faster startup/module loading)
  • uses attributes, so can be specified inline with the type to be formatted
  • or can, via proxy, specify formatting on another type
  • use code gen with dynamic sites so it's extremely fast

What I probably need the most to continue is some external motivation and some dedicated time. I have other projects I've started - a PowerShell profiler and a PowerShell script formatter, so clearly I have a problem starting projects but not finding time to move them along.

One thought I had on external motivation was to start a charity fundraiser - I'd commit to a project if the charity gets funded. I haven't worked out the charity or the funding target though.

All 8 comments

Status - no progress since the last commit.

The initial idea is basically a console version of Out-GridView combined with less, then I let myself get sidetracked into the formatting subsystem.

So for I have a prototype of a new way of specifying formatting that:

  • uses no xml (so faster startup/module loading)
  • uses attributes, so can be specified inline with the type to be formatted
  • or can, via proxy, specify formatting on another type
  • use code gen with dynamic sites so it's extremely fast

What I probably need the most to continue is some external motivation and some dedicated time. I have other projects I've started - a PowerShell profiler and a PowerShell script formatter, so clearly I have a problem starting projects but not finding time to move them along.

One thought I had on external motivation was to start a charity fundraiser - I'd commit to a project if the charity gets funded. I haven't worked out the charity or the funding target though.

Thanks! I can not help with external motivation but I could help with the progress of these projects.

  • for PSMore we could continue in the PowerShell repo step by step replacing existing code.
  • for PowerShell script formatter we could start adding Trivia like Roslyn. Maybe RFC is right start.
  • for PowerShell profiler I don't know what we can do to help the project, perhaps add an API to measure script blocks that can be useful for performance dev test too. /cc @daxian-dbw

Trivia might make a formatter simpler to implement, but it isn't necessary. The full trivia can be synthesized from the tokens and ast. I have implemented what I think is critical to the formatter - a tree comparer so you can check the formatting won't change the semantics.

As for formatting - I'm not keen on the step by step replacement which is why I started a standalone project. At some point it will make sense to replace existing code, but that's a tricky work that isn't much fun - I speak from experience. Rewarding when it's done, but it takes motivation.

And profiling - I should talk with @daxian-dbw - he might be interested to pick it up.

@lzybkr I'd love to pick up the profiler work. Will sync with you offline on it.

Trivia might make a formatter simpler to implement

I think this is enough to do it. In addition, it will not only simplify but also add more features and flexibility.
If @SteveL-MSFT approves I could start RFC for trivia.

As for formatting - I'm not keen on the step by step replacement which is why I started a standalone project.

Do you want to keep this project as personal or maybe make it public like PowerShell/NextEFS?

And profiling

The same question - will the project MSFT internal or public like PowerShell/Profiler?

I think this is enough to do it. In addition, it will not only simplify but also add more features and flexibility.
If @SteveL-MSFT approves I could start RFC for trivia.

Retrofitting trivia would be, well, very non-trivial, both from a design point of view and a performance point of view. If we are talking about a new standalone parser based on the current parser, then I'd have fewer concerns, but I'm not convinced of the benefits.

Do you want to keep this project as personal or maybe make it public like PowerShell/NextEFS?

We'll see how it goes, eventually it probably makes sense to pull into the core.

The same question - will the project MSFT internal or public like PowerShell/Profiler?

Parts of profiling require changes to PowerShell Core, other parts can be external tools (no reason for MSFT internal) that might not even need any PowerShell dependencies. I pushed my wip here - the instrumentation is probably complete for in-process profiling, but there's plenty of remaining work - analyzing the profile data and support for out-of-process profiling.

@iSazonov I don't see any reason not to author a RFC for trivia support

Was this page helpful?
0 / 5 - 0 ratings