User Tools

Site Tools


using_chicken_on_sdf

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
using_chicken_on_sdf [2021/03/17 20:42] – [Install Eggs] hc9using_chicken_on_sdf [2021/03/17 20:52] (current) – [Learn] hc9
Line 5: Line 5:
 ===== Learn ===== ===== Learn =====
  
-To learn Scheme programming, check out a tutorial like [[http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html|Teach Yourself Scheme in Fixnum Days]].+To learn Scheme programming, check out a tutorial like //[[http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html|Teach Yourself Scheme in Fixnum Days]]//.
  
 To learn about Chicken, check out the [[http://call-cc.org/|Chicken website]], which includes a [[http://wiki.call-cc.org/man/4/The%20User%27s%20Manual|manual]] and a [[http://wiki.call-cc.org/|wiki]]. To learn about Chicken, check out the [[http://call-cc.org/|Chicken website]], which includes a [[http://wiki.call-cc.org/man/4/The%20User%27s%20Manual|manual]] and a [[http://wiki.call-cc.org/|wiki]].
Line 11: Line 11:
 ===== Play Around ===== ===== Play Around =====
  
-To play with Chicken, start the interactive interpreter by running csi. It should look like this:+To play with Chicken, start the interactive interpreter by running ''csi''. It should look like this:
  
 <code> <code>
Line 40: Line 40:
 ===== Install Eggs ===== ===== Install Eggs =====
  
-The Chicken community produces third-party libraries called eggs. (If you're familiar with the Ruby programming language, eggs are like Ruby's gems.) As an example, let's install the [[http://wiki.call-cc.org/eggref/4/readline|readline]] egg. This will allow you to use in the Chicken interpreter the same editing and history commands you use in your shell. For example, hitting the Up key will enter your previous command.+The Chicken community produces third-party libraries called //eggs//. (If you're familiar with the Ruby programming language, eggs are like Ruby's gems.) As an example, let's install the [[http://wiki.call-cc.org/eggref/4/readline|readline]] egg. This will allow you to use in the Chicken interpreter the same editing and history commands you use in your shell. For example, hitting the Up key will enter your previous command.
  
-Ideally, you could just run chicken-install readline and the egg would be installed. But if you do that, you'll get an error. Since you don't have administrator privileges on SDF, you can't install eggs to the default location (a system directory). You must install the eggs in your home directory, which requires you to do a little configuration beforehand. I'll show you how to do that.+Ideally, you could just run ''chicken-install readline'' and the egg would be installed. But if you do that, you'll get an error. Since you don't have administrator privileges on SDF, you can't install eggs to the default location (a system directory). You must install the eggs in your home directory, which requires you to do a little configuration beforehand. I'll show you how to do that.
  
 I'll assume you're running Bash as your shell and that you want to keep Chicken-related files in ~/chicken. First create a directory for a Chicken repository: I'll assume you're running Bash as your shell and that you want to keep Chicken-related files in ~/chicken. First create a directory for a Chicken repository:
  
 +<code>
   mkdir -p ~/chicken/lib/chicken/6   mkdir -p ~/chicken/lib/chicken/6
 +</code>
  
 Then install the repository: Then install the repository:
  
 +<code>
   chicken-install -init ~/chicken/lib/chicken/6   chicken-install -init ~/chicken/lib/chicken/6
 +</code>
  
 Then create some environment variables so Chicken will know to use your new repository for eggs, and will compile against SDF's system libraries when installing eggs: Then create some environment variables so Chicken will know to use your new repository for eggs, and will compile against SDF's system libraries when installing eggs:
  
-export CHICKEN_INCLUDE_PATH=${HOME}/chicken/lib/chicken/6\\  export CHICKEN_REPOSITORY=${HOME}/chicken/lib/chicken/6\\  export CSC_OPTIONS="-I/usr/pkg/include -L/usr/pkg/lib -static-libs"+<code> 
 +  export CHICKEN_INCLUDE_PATH=${HOME}/chicken/lib/chicken/6 
 +  export CHICKEN_REPOSITORY=${HOME}/chicken/lib/chicken/6 
 +  export CSC_OPTIONS="-I/usr/pkg/include -L/usr/pkg/lib -static-libs" 
 +</code>
  
 (You may also wish to put the above lines in a shell startup file, like ~/.bash_profile, so that the variables will be set every time you log in to SDF.) (You may also wish to put the above lines in a shell startup file, like ~/.bash_profile, so that the variables will be set every time you log in to SDF.)
Line 60: Line 68:
 Now you can install the readline egg: Now you can install the readline egg:
  
 +<code>
   chicken-install readline   chicken-install readline
 +</code>
  
-If the install was successful, we can check whether everything's working. Start the Chicken interpreter with csi and run this Scheme program to load the readline egg:+If the install was successful, we can check whether everything's working. Start the Chicken interpreter with ''csi'' and run this Scheme program to load the readline egg:
  
 ''(use readline)'' ''(use readline)''
using_chicken_on_sdf.1616013773.txt.gz · Last modified: 2021/03/17 20:42 by hc9