Wiki page
[
Position Independent Source Code] by
yumaikas
2018-09-02 14:50:04.
Artifact ce571f11ab168fb708235bc82e9a3cd76551e6f7:
1 D 2018-09-02T14:50:04.763
2 L Position\sIndependent\sSource\sCode
3 N text/x-markdown
4 P 4e750853b50f3516838907d8741cc9501efe578d
5 U yumaikas
6 W 2935
7 # Position Independent Source Code
8
9 PISC is a stack-based programming language that is primarily inspired by factor, TCL, bash and a little bit of python, written in go. It's currently a study in how far one can take code quotations, polymorphic stacks and pervasive dynamism.
10
11 Current longer term plan [here](https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/wiki?name=Long-Term+Plans)
12
13 Noteworthy things can be found in the [announcements][0]
14
15 <pre class="prettyprint">
16 "Hello, World!" println
17 </pre>
18
19 To get a feel for the basics of PISC, check out [PISC in Y minutes](https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/wiki?name=PISC+in+Y+Minutes)
20
21 Some examples (which you can try in [the playground][play]):
22
23 <pre class="prettyprint">
24 # String building
25 ${
26 "The answer is "
27 6 7 * >string
28 ", but we don't know the question"
29 }
30
31 /* Defining an adjustable fizzbuzz word */
32 : fizzbuzz-n ( n -- ) :n /* Store from stack to n local */
33 1 :i /* Store 1 into num variable */
34
35 $n [
36 $i 3 divisor? [ "Fizz" ] [ "" ] if :f
37 $i 5 divisor? [ "Buzz" ] [ "" ] if :b
38 $f $b str-concat :fb
39 $fb len 0 > [ $fb println ] [ $i println ] if
40 ++i
41 ] times ;
42
43 25 fizzbuzz-n
44 </pre>
45
46 The largest achievement in PISC to date is a [CSV](/artifact/6be3bb68af7e3784) parser.
47
48 # Installing From Source
49
50 Before you can install PISC for trying out, you'll need to install [Go 1.9][go19] or newer.
51
52 There are two ways to install PISC right now
53
54 1) Install [fossil][fossil] and run
55
56 mkdir "$GOPATH/src/pisc" && cd "$GOPATH/src/pisc"
57 fossil clone https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil PISC.fossil
58
59 2) Using git:
60
61 mkdir "$GOPATH/src/pisc" && cd "$GOPATH/src/pisc"
62 git clone github.com/yumaikas/PISC-mirror .
63
64 In the future, a different URL for PISC is planned, but has not been setup as yet.
65
66 Once you have Go, and have PISC somewhere where the go compiler can work with it, you can run `go get` to fetch PISC's go dependencies, and `go build -o pisc` to build the PISC interpreter.
67
68 Once you have PISC built, `pisc -i` will open an interactive PISC session.
69
70 ## Other items
71 [List of things to do](/wiki/todo).
72
73
74 ## Contact
75
76 If you have questions about PISC, feel free to email me at yumaikas94 at Google's mail service.
77
78
79 [0]: https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/timeline?n=50&y=e&v=0
80
81 [zip]: https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/zip/Position+Independent+Source+Code-f6060ffe32.zip?uuid=f6060ffe32a07dba
82 [tar]: https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/tarball/Position+Independent+Source+Code-f6060ffe32.tar.gz?uuid=f6060ffe32a07dba1c109349776a0bef31711ed0
83 [go19]: https://golang.org/dl/
84 [fossil]: http://fossil-scm.org/xfer/uv/download.html
85 [play]: https://pisc.junglecoder.com/playground/
86 Z 262b1dfe436ef9000c99cde779ca0d06