Position Independent Source Code

Artifact Content
Login
Wiki page [Position Independent Source Code] by yumaikas 2018-09-02 14:50:04.

Artifact ce571f11ab168fb708235bc82e9a3cd76551e6f7:


D 2018-09-02T14:50:04.763
L Position\sIndependent\sSource\sCode
N text/x-markdown
P 4e750853b50f3516838907d8741cc9501efe578d
U yumaikas
W 2935
# Position Independent Source Code

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.

Current longer term plan [here](https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/wiki?name=Long-Term+Plans)

Noteworthy things can be found in the [announcements][0] 

<pre class="prettyprint">
"Hello, World!" println
</pre>

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)

Some examples (which you can try in [the playground][play]): 

<pre class="prettyprint">
# String building
${ 
   "The answer is " 
   6 7 * >string 
   ", but we don't know the question" 
}    

/* Defining an adjustable fizzbuzz word */
: fizzbuzz-n ( n -- ) :n /* Store from stack to n local */
    1 :i /* Store 1 into num variable */
     
    $n [
        $i 3 divisor? [ "Fizz" ] [ "" ] if :f
        $i 5 divisor? [ "Buzz" ] [ "" ] if :b
        $f $b str-concat :fb
        $fb len 0 > [ $fb println ] [ $i println ] if 
        ++i
    ] times ;
    
25 fizzbuzz-n
</pre>

The largest achievement in PISC to date is a [CSV](/artifact/6be3bb68af7e3784) parser.

# Installing From Source

Before you can install PISC for trying out, you'll need to install [Go 1.9][go19] or newer.

There are two ways to install PISC right now

1) Install [fossil][fossil] and run    
    
    mkdir "$GOPATH/src/pisc" && cd "$GOPATH/src/pisc"
    fossil clone https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil PISC.fossil

2) Using git:

    mkdir "$GOPATH/src/pisc" && cd "$GOPATH/src/pisc" 
    git clone github.com/yumaikas/PISC-mirror .

In the future, a different URL for PISC is planned, but has not been setup as yet.

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. 

Once you have PISC built, `pisc -i` will open an interactive PISC session.

## Other items
[List of things to do](/wiki/todo). 


## Contact

If you have questions about PISC, feel free to email me at yumaikas94 at Google's mail service. 


[0]: https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/timeline?n=50&y=e&v=0

[zip]: https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/zip/Position+Independent+Source+Code-f6060ffe32.zip?uuid=f6060ffe32a07dba
[tar]: https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/tarball/Position+Independent+Source+Code-f6060ffe32.tar.gz?uuid=f6060ffe32a07dba1c109349776a0bef31711ed0 
[go19]: https://golang.org/dl/
[fossil]: http://fossil-scm.org/xfer/uv/download.html
[play]: https://pisc.junglecoder.com/playground/
Z 262b1dfe436ef9000c99cde779ca0d06