using_chicken_on_sdf
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
using_chicken_on_sdf [2021/03/17 20:46] – [Install Eggs] hc9 | using_chicken_on_sdf [2021/03/17 20:52] (current) – [Learn] hc9 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Using Chicken on SDF ====== | ||
+ | |||
+ | Chicken is a practical implementation of Scheme. Scheme is a programming language in the Lisp family. | ||
+ | |||
+ | ===== Learn ===== | ||
+ | |||
+ | To learn Scheme programming, | ||
+ | |||
+ | To learn about Chicken, check out the [[http:// | ||
+ | |||
+ | ===== Play Around ===== | ||
+ | |||
+ | To play with Chicken, start the interactive interpreter by running '' | ||
+ | |||
+ | < | ||
+ | |||
+ | $ csi | ||
+ | |||
+ | CHICKEN | ||
+ | (c)2008-2011 The Chicken Team | ||
+ | (c)2000-2007 Felix L. Winkelmann | ||
+ | Version 4.7.0 | ||
+ | netbsd-unix-gnu-x86-64 [ 64bit manyargs dload ptables ] | ||
+ | compiled 2011-08-24 on ol (NetBSD) | ||
+ | |||
+ | #;1> | ||
+ | |||
+ | </ | ||
+ | |||
+ | At the Chicken prompt, you can type in a Scheme program and hit Return to run your code. | ||
+ | |||
+ | < | ||
+ | |||
+ | #;1> (print " | ||
+ | Hello, World | ||
+ | #;2> | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== 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:// | ||
+ | |||
+ | Ideally, you could just run '' | ||
+ | |||
+ | 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: | ||
+ | |||
+ | < | ||
+ | mkdir -p ~/ | ||
+ | </ | ||
+ | |||
+ | Then install the repository: | ||
+ | |||
+ | < | ||
+ | chicken-install -init ~/ | ||
+ | </ | ||
+ | |||
+ | 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}/ | ||
+ | export CHICKEN_REPOSITORY=${HOME}/ | ||
+ | export CSC_OPTIONS=" | ||
+ | </ | ||
+ | |||
+ | (You may also wish to put the above lines in a shell startup file, like ~/ | ||
+ | |||
+ | Now you can install the readline egg: | ||
+ | |||
+ | < | ||
+ | chicken-install readline | ||
+ | </ | ||
+ | |||
+ | If the install was successful, we can check whether everything' | ||
+ | |||
+ | '' | ||
+ | |||
+ | Then run this program to use readline in this interpreter session: | ||
+ | |||
+ | '' | ||
+ | |||
+ | Now check if you have readline support in the interpreter. Run a trivial program like 42 and then hit the Up key and check if " | ||
+ | |||
+ | ---- | ||
+ | |||
+ | $Id: chicken.html, | ||