Skip to content

Instantly share code, notes, and snippets.

@ijp
Created Aug 11, 2012
Embed
What would you like to do?
getting started with guildhall

Important This page is no longer going to be the canonical resource for getting started with guild hall. Sorry about that, but for convenience (hopefully both mine and yours), I am moving maintenance to the github wiki for the project.

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment