-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Implicit Interpretation Demo ( Fixes #886 )
- Loading branch information
James Brundage
committed
Feb 7, 2024
1 parent
a888c85
commit 73e4131
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |