Position Independent Source Code

Artifact Content
Login
Wiki page [Position Independent Source Code] by yumaikas 2025-11-01 06:06:53.

Artifact 7e78701a4b134a64098b707dba2ade86fa1de383:


     1  D 2025-11-01T06:06:53.357
     2  L Position\sIndependent\sSource\sCode
     3  N text/x-markdown
     4  P cfa8f16827606ee9276a20f9418544521fa5b83b
     5  U yumaikas
     6  W 3305
     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  ## Status
    12  
    13  PISC is currently not in active development. It has served it's purpose for me as a educational experience. That being said, it's a relatively small codebase, and I am more than happy to answer questions about it. Feel free to reach out on either mastodon (<https://tech.lgbt/@sakiamu>), or at yumaikas94 on the googles mail service. 
    14  
    15  These days, I'm actively doing work related to <https://nova-lang.net>, which is also stack-based, but quite a different kettle of fish
    16  
    17  Noteworthy things can be found in the [announcements][0] 
    18  
    19  <pre class="prettyprint">
    20  "Hello, World!" println
    21  </pre>
    22  
    23  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)
    24  
    25  Some examples (which you can try in [the playground][play]): 
    26  
    27  <pre class="prettyprint">
    28  # String building
    29  ${ 
    30     "The answer is " 
    31     6 7 * >string 
    32     ", but we don't know the question" 
    33  }    
    34  
    35  /* Defining an adjustable fizzbuzz word */
    36  : fizzbuzz-n ( n -- ) :n /* Store from stack to n local */
    37      1 :i /* Store 1 into num variable */
    38       
    39      $n [
    40          $i 3 divisor? [ "Fizz" ] [ "" ] if :f
    41          $i 5 divisor? [ "Buzz" ] [ "" ] if :b
    42          $f $b str-concat :fb
    43          $fb len 0 > [ $fb println ] [ $i println ] if 
    44          ++i
    45      ] times ;
    46      
    47  25 fizzbuzz-n
    48  </pre>
    49  
    50  The largest achievement in PISC to date is a [CSV](/artifact/6be3bb68af7e3784) parser.
    51  
    52  # Installing From Source
    53  
    54  Before you can install PISC for trying out, you'll need to install [Go 1.9][go19] or newer.
    55  
    56  There are two ways to install PISC right now
    57  
    58  1) Install [fossil][fossil] and run    
    59      
    60      mkdir "$GOPATH/src/pisc" && cd "$GOPATH/src/pisc"
    61      fossil clone https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil PISC.fossil
    62  
    63  2) Using git:
    64  
    65      mkdir "$GOPATH/src/pisc" && cd "$GOPATH/src/pisc" 
    66      git clone github.com/yumaikas/PISC-mirror .
    67  
    68  In the future, a different URL for PISC is planned, but has not been setup as yet.
    69  
    70  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. 
    71  
    72  Once you have PISC built, `pisc -i` will open an interactive PISC session.
    73  
    74  ## Other items
    75  [List of things to do](/wiki/todo). 
    76  
    77  
    78  ## Contact
    79  
    80  If you have questions about PISC, feel free to email me at yumaikas94 at Google's mail service. 
    81  
    82  
    83  [0]: https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/timeline?n=50&y=e&v=0
    84  
    85  [zip]: https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/zip/Position+Independent+Source+Code-f6060ffe32.zip?uuid=f6060ffe32a07dba
    86  [tar]: https://pisc.junglecoder.com/home/apps/fossil/PISC.fossil/tarball/Position+Independent+Source+Code-f6060ffe32.tar.gz?uuid=f6060ffe32a07dba1c109349776a0bef31711ed0 
    87  [go19]: https://golang.org/dl/
    88  [fossil]: http://fossil-scm.org/xfer/uv/download.html
    89  [play]: https://pisc.junglecoder.com/playground/
    90  Z 9378958922889093ba47e7d1c3441f03