Skip to content

Commit ff3db9f

Browse files
StartAutomatingStartAutomating
authored andcommitted
Updating PipeScript.HelpOut.ps1 (including topics, re #132)
1 parent bfc6581 commit ff3db9f

File tree

1 file changed

+29
-35
lines changed

1 file changed

+29
-35
lines changed

docs/README.md

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,54 @@
1-
<div align='center'>
2-
<img src='Assets/PipeScript.png' />
3-
</div>
1+
This directory and it's subdirectories contain additional language keywords within PipeScript.
42

5-
# What Is PipeScript?
3+
Most keywords will be implemented as a Transpiler that tranforms a CommandAST.
64

7-
> PipeScript is a transpiled scripting language built atop of PowerShell.
85

9-
> PipeScript can be run interactively
6+
|DisplayName |Synopsis |
7+
|------------------|----------------------------|
8+
|[New](New.psx.ps1)|['new' keyword](New.psx.ps1)|
109

11-
> PipeScript can embedded within many languages to dynamically generate source code
1210

13-
## What's a Transpiler?
1411

15-
A transpiler takes source code written in one language and transforms or translates it.
1612

17-
Transpilers can be used to extend a given language.
18-
For example, TypeScript adds strongly typed features to JavaScript, a weakly typed language.
13+
## New Example 1
1914

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.
2215

23-
Transpilers can also be used to optimize or reconfigure source code.
24-
For example, any minifier or code stylization tool is a transpiler.
16+
~~~PowerShell
17+
.> { new DateTime }
18+
~~~
2519

26-
## What makes PipeScript unique?
20+
## New Example 2
2721

28-
PipeScript is unique because PowerShell is unique.
2922

30-
There are a few facets of PowerShell's uniqueness that make PipeScript possible:
23+
~~~PowerShell
24+
.> { new byte 1 }
25+
~~~
3126

32-
### Incredibly Flexible Syntax
27+
## New Example 3
3328

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```.
3629

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.
30+
~~~PowerShell
31+
.> { new int[] 5 }
32+
~~~
3833

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.
34+
## New Example 4
4035

41-
### The Abstract Syntax Tree
4236

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.
37+
~~~PowerShell
38+
.> { new datetime 12/31/1999 }
39+
~~~
4440

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.
41+
## New Example 5
4642

47-
### Rich RegEx Support
4843

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.
44+
~~~PowerShell
45+
.> { new @{RandomNumber = Get-Random; A ='b'}}
46+
~~~
5147

52-
### The Object Pipeline
48+
## New Example 6
5349

54-
The Object Pipeline is the backbone of PowerShell and PipeScript.
5550

56-
It allows you to pipe structured data, not text, from one step to the next.
51+
~~~PowerShell
52+
.> { new Diagnostics.ProcessStartInfo @{FileName='f'} }
53+
~~~
5754

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)