Skip to content

Commit

Permalink
docs: Implicit Interpretation Demo ( Fixes #886 )
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Feb 7, 2024
1 parent a888c85 commit 73e4131
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Demos/102-PipeScript-Implicit-Interpretation.demo.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#1. Implicit Interpretation

# Implicit Interpretation is a part of PipeScript that allows you to implicitly run anything with an interpreter

# This means any language can be seamlessly run from PipeScript

# Let's start simple (with JavaScript)
"console.log('All Your Base Belong To Us')" > .\Message.js

# Now let's run it.
.\Message.js

# Let's try another language (Python)
"print('Run anything with PipeScript')" > .\Message.py

# And let's run that:
.\Message.py

# Why stop there, let's Go!
@"
package main
import "fmt"
func main() {
fmt.Println("Go is also fair game")
}
"@ > Message.go

.\Message.go

# Is that all? Nope.

# $psInterpreter(s) gives us all interpretable languages
$PSInterpreter

# How many interpreters are there, currently?
$PSInterpreters.Count

# $psLanguage(s) gives us all languages.
$psLanguage

# How many languages can PipeScript talk to?
$PSLanguages.Count

0 comments on commit 73e4131

Please sign in to comment.