Getting Started

ijp edited this page Feb 2, 2013 · 5 revisions

Getting Started with Guildhall

Guildhall (also known as Dorodango) is the package manager for guile 2. Currently it is not in widespread use; I hope we can change that.

First, you will need to download it. There is no tarball yet, so you will need to get it from git

git clone git://github.com/ijp/guildhall.git

then it’s the usual autotools dance

./autogen.sh
./configure -C
make
sudo make install

If you want to install to a location that is different to your guile 2 install, you will need to modify your GUILE_LOAD_PATH to include $PREFIX/share/guile/site/2.0/ where $PREFIX is the value you passed to the --prefix switch of configure, which is /usr/local/ by default.

Once you have successfully installed it. You will need to create the file ~/.config/guildhall/config.scm and add the line

(repository shift-reset "http://shift-reset.com/doro/")

to the file. This will enable access to my guildhall repository. Then

guild update

to update your guildhall installation to be able to access all the packages from that repository. You can view the packages available to you with

guild list-packages --all

(without –all it just shows installed packages)

and you can install a package (e.g my bloom-filter package) with

guild install bloom-filter

To be able to use packages you will need to be add ~/.local/share/guile/site/2.0 to your GUILE_LOAD_PATH.

As of version 2.0.7, Guile introduces a special marker ... which is used to allow users to specify that certain paths are searched after the default one. We recommend that all Guildhall users take advantage of this, and place the Guildhall site directory at the end of the path. e.g. If your existing GUILE_LOAD_PATH looked like

GUILE_LOAD_PATH=$HOME/guilecode

you should change it to

GUILE_LOAD_PATH=$HOME/guilecode:...:$HOME/.local/share/guile/site/2.0

then you can try it out

scheme@(guile−user)> ,use (bloom-filter)
;;; note: auto−compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the −−no−auto−compile argument to disable.
;;; compiling /home/ian/.local/share/guile/site/2.0/bloom−filter.scm
;;; compiled /home/ian/.cache/guile/ccache/2.0−LE−4−2.0/home/ian/.local/share/guile/site/2.0/bloom−filter.scm.go
scheme@(guile−user)> (define bf (make-bloom-filter 1000000))
scheme@(guile−user)> ,use (ice-9 rdelim)
scheme@(guile−user)> (call-with-input-file "/usr/share/dict/words"
(lambda (in)
(let loop ((line (read-line in)))
  (unless (eof-object? line)
    (bloom-filter-add! bf line)
   (loop (read-line in))))))
scheme@(guile−user)> (let ((l '("wonderful" "ball" "stereo" "jester"
           "flag" "shshshshsh" "nooooooo" "newyorkcity"
           "people" "kwyjibo")))
  (let loop ((l l))
    (unless (null? l)
      (format #t "~s: ~s~%" (car l) (bloom-filter-contains? bf (car l)))
      (loop (cdr l)))))
"wonderful": #t
"ball": #t
"stereo": #t
"jester": #t
"flag": #t
"shshshshsh": #f
"nooooooo": #t
"newyorkcity": #t
"people": #t
"kwyjibo": #f
scheme@(guile−user)> 

There are lots of other commands available to you, see the guildhall documentation for this.

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.