Skip to content

Commit 73e4131

Browse files
author
James Brundage
committed
docs: Implicit Interpretation Demo ( Fixes #886 )
1 parent a888c85 commit 73e4131

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#1. Implicit Interpretation
2+
3+
# Implicit Interpretation is a part of PipeScript that allows you to implicitly run anything with an interpreter
4+
5+
# This means any language can be seamlessly run from PipeScript
6+
7+
# Let's start simple (with JavaScript)
8+
"console.log('All Your Base Belong To Us')" > .\Message.js
9+
10+
# Now let's run it.
11+
.\Message.js
12+
13+
# Let's try another language (Python)
14+
"print('Run anything with PipeScript')" > .\Message.py
15+
16+
# And let's run that:
17+
.\Message.py
18+
19+
# Why stop there, let's Go!
20+
@"
21+
package main
22+
23+
import "fmt"
24+
25+
func main() {
26+
fmt.Println("Go is also fair game")
27+
}
28+
"@ > Message.go
29+
30+
.\Message.go
31+
32+
# Is that all? Nope.
33+
34+
# $psInterpreter(s) gives us all interpretable languages
35+
$PSInterpreter
36+
37+
# How many interpreters are there, currently?
38+
$PSInterpreters.Count
39+
40+
# $psLanguage(s) gives us all languages.
41+
$psLanguage
42+
43+
# How many languages can PipeScript talk to?
44+
$PSLanguages.Count

0 commit comments

Comments
 (0)