Skip to content

Commit fd7cab4

Browse files
StartAutomatingStartAutomating
authored andcommitted
Updating PipeScript.HelpOut.ps1
1 parent 29a771b commit fd7cab4

File tree

1 file changed

+46
-12
lines changed

1 file changed

+46
-12
lines changed

docs/README.md

Lines changed: 46 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,60 @@
1-
This directory and it's subdirectories contain Transpilers that transform parameter attributes.
1+
<div align='center'>
2+
<img src='Assets/PipeScript.png' />
3+
</div>
24

3-
Parameter Transpilers do not need to take any values from the pipeline.
4-
They will be called by the Core PipeScript Transpiler ```PipeScript.ParameterAttribute```.
5+
# What Is PipeScript?
56

6-
When Transpiling a Parameter, the Transpiler should return one of two things.
7+
> PipeScript is a transpiled scripting language built atop of PowerShell.
78
8-
1. An empty ```[ScriptBlock]``` preceeded by attributes or help. This will replace the Transpiled attribute with a real one.
9-
2. A ```[Collections.IDictionary]``` can be used to send arguments directly back to ```Update-PipeScript```.
9+
> PipeScript can be run interactively
1010
11-
Many parameter transpilers can also apply to a ```[Management.Automation.Language.VariableExpressionAst]```.
11+
> PipeScript can embedded within many languages to dynamically generate source code
1212
13-
When this is the case it is common for the transpiler to add a ```[ValidateScript]``` attribute to the variable. This will constraint the value of that variable.
13+
## What's a Transpiler?
1414

15-
## List Of Parameter Transpilers
15+
A transpiler takes source code written in one language and transforms or translates it.
1616

17+
Transpilers can be used to extend a given language.
18+
For example, TypeScript adds strongly typed features to JavaScript, a weakly typed language.
1719

18-
|Table|
19-
|-----|
20-
||
20+
Transpilers can also be used to convert from one language to another.
21+
For example, most PowerShell ```Select-Object``` statements could be translated to SQL.
2122

23+
Transpilers can also be used to optimize or reconfigure source code.
24+
For example, any minifier or code stylization tool is a transpiler.
2225

26+
## What makes PipeScript unique?
2327

28+
PipeScript is unique because PowerShell is unique.
2429

30+
There are a few facets of PowerShell's uniqueness that make PipeScript possible:
2531

32+
### Incredibly Flexible Syntax
2633

34+
One of PowerShell's strengths is it's consistent syntax. Most PowerShell you encounter will be cleanly organized into Verbs and Nouns.
35+
For example, ```Get-Process```.
36+
37+
However, like JavaScript, what is valid syntax goes far beyond what PowerShell uses. Commands can be named almost anything. Attributes and Types need not exist to be valid. This gives us many places we can extend PowerShell as a language.
38+
39+
Additionally, the core language features of PowerShell are a superset of most programming languages. This means that PowerShell should be able to be transpiled into any language.
40+
41+
### The Abstract Syntax Tree
42+
43+
PowerShell also has an Abstract Syntax Tree. This is used to represent scripts before they run. As the name implies, this is hierarchical representation of syntax, which lets us walk thru step-by-step, not just token-by-token.
44+
45+
Because the Abstract Syntax Tree of PowerShell is so well-defined, it lets us be incredibly flexible. Not only can we transform certain parts of the syntax, we can do so differently based off of the surrounding context. This makes transforming PowerShell much more potent than a simple find and replace.
46+
47+
### Rich RegEx Support
48+
49+
PowerShell comes with Rich RegEx Support.
50+
The ```-match```, ```-replace```, and ```-split``` operators help slice and dice text, and the .NET ```[RegEx]``` class allows for even more advanced operations. This lets us flexibly parse text and turn it into objects.
51+
52+
### The Object Pipeline
53+
54+
The Object Pipeline is the backbone of PowerShell and PipeScript.
55+
56+
It allows you to pipe structured data, not text, from one step to the next.
57+
58+
By using the object pipeline, you loosely couple each step and allow steps to easily take input from structured files or APIs.
59+
60+
PipeScript allows you to transpile using an Object Pipeline.

0 commit comments

Comments
 (0)