reorienting what we want to do, based on current discussions with David and Steve.
[CommonLispStat.git] / README.org
blob311a256b3de4735a983c7c4ce093274e23d0b290
2 Time-stamp: <2012-10-05 04:03:26 tony>
4 * Current Status: COMPLETELY BROKEN
6   but we are rebuilding it.
8 * Fast Start
10   You probably did  (preferred)
12 #+name: GitClone
13 #+begin_src shell
14   git clone git://github.com/blindglobe/common-lisp-stat.git
15 #+end_src
17   or (coming soon!) from within a Lisp instance, 
19 #+name: QuickLispLoad
20 #+begin_src lisp
21   (ql:quickload :cls)
22 #+end_src
24   At one point, I planned a pure git-delivery via cloning and
25   submodules, but this proved to be a bit more complex than needed,
26   thanks to the creation of quicklisp.  It's also a stupid idea if
27   one plans to have users who are not hackers or developers, and
28   eventually we want users.
30   Despite quicklisp, there will need to be a version for delivering a
31   system development-oriented CLS environment and this will consist of
32   git repositories, possibly through submodules, but this (submodules)
33   is for discussion.
35   There are quite a few libraries that are needed, and right now we
36   are working on simplifying the whole thing.   Once you get past
37   this step, then you should:
39   1. run a common lisp (SBCL, CMUCL, CLISP, CLOZURE-CL) starting in
40      the current directory.  You will need ASDF at a minimum,
41      QUICKLISP preferred.  And you should have QUICKLISP.
43   2. (on Debian or similar systems: can use CLC (Common Lisp
44      Controller) or SBCL approaches, i.e.  ~/.clc/systems or
45      ~/.sbcl/systems should contain softlinks to the cls and other
46      required ASDF files (i.e. cls.asd, cffi.asd, and lift.asd).
48   There are example sessions and scripts for data analysis, some real,
49   some proposed, in the file:examples/ directory.  Also see
50   file:TODO.org for snippets of code that work or fail to work.
52 ** Example Usage steps [2/6]
54 *** DONE Start and Load 
55   
56 1. start your lisp
57 2. load CLS
59 #+BEGIN_SRC lisp
60 (ql:quickload :cls)
61 #+END_SRC
63 *** DONE Setup a place to work
65 In Common Lisp, you need to select and setup namespace to store data
66 and functions.  There is a scratch user-package, or sandbox, for
67 CLS, *cls-user* , which you can select via:
69 #+BEGIN_SRC lisp -n :tangle "readme-example.lisp"
70 (in-package :cls-user)
71 #+END_SRC
73 and this has some basic modules from CLS instantiated (dataframes,
74 probability calculus, numerical linear algebra, basic summaries
75 (numerical and visual displays).  
77 However, it can be better is to create a package to work in, which
78 pulls in only desired functionality:
80 #+BEGIN_SRC lisp +n :tangle "readme-example.lisp"
81   (defpackage :my-package-user
82     (:documentation "demo of how to put serious work should be placed in
83       a similar package elsewhere for reproducibility.  This hints as to
84       what needs to be done for a user- or analysis-package.")
85     (:nicknames :my-clswork-user)
86     (:use :common-lisp ; always needed for user playgrounds!
87           :lisp-matrix ; we only need the packages that we need...
88           :common-lisp-statistics
89           :lisp-stat-data-examples) ;; this ensures access to a data package
90     (:export summarize-data summarize-results this-data this-report)) 
91   
92   (in-package :my-clswork-user) ;; or :my-package-user
93 #+END_SRC
95 We need to pull in the packages with data or functions that we need;
96 just because the data/function is pulled in by another package, in
97 that package's namespace, does NOT mean it is available in this name
98 space.  However, the *common-lisp-statistics* package will ensure
99 that fundamental objects and functions are always available. 
102 *** TODO Get to work [0/3]
104 **** TODO Pull in or create data
106 **** TODO Summarize results
108 **** TODO Save work and results for knowledge building and reuse 
110 One can build a package, or save an image (CL implementation
111 dependent) or...
112   
113 *** Inform  moi of problems or successes
115     mailto:blindglobe@gmail.com if there is anything wrong, or
116     even if something happens to work.
118     Current beliefs:
119     - SBCL is target platform.   CCL and CMUCL should be similar.
120     - CLISP is finicky regarding the problems that we have with CFFI
121       conversation.  In particular that we can not really do typing
122       that we need to take care of.  I think this is my (Tony's)
123       problem, not someone elses, and specifically, not CLISP's
124     - Need to test ECL.
126 * History
128    See files in file:Doc/  for history, design considerations, and
129    random, sometimes false and misleading, musings.
131 * Working on your own modifications
133 #+begin_src shell
134    git clone git://repo.or.cz/CommonLispStat.git 
135    cd CommonLispStat
136 #   git submodules init
137 #   git submodules update
138 #+end_src
140    will pull the whole repository, and create a "master" branch to
141    work on.  If you are making edits, which I'd like, you don't want
142    to use the master branch, but more to use a topic-centric branch,
143    so you might:
145 #+begin_src shell
146     git checkout -b myTopicBranch
147 #+end_src
149 and then work on myTopicBranch, pulling back to the master branch when
150 needed by
152 #+begin_src shell
153     git checkout master
154     git pull . myTopicBranch
155 #+end_src
158 #+begin_src shell
159     git rebase myTopicBranch
160 #+end_src
163 of course, perhaps you want to contribute to the mob branch.   For
164 that, after cloning the repository as above, you would:
166 #+begin_src shell
167     git checkout -b mob remotes/origin/mob
168 #+end_src
170 (work, work, work... through a cycle of
172 #+begin_src shell
173          <edit>
174          git add <files just edited>
175          git commit -m "what I just did"
176 #+end_src
178  ad-nauseum.  When ready to commit, then just:
180 #+begin_src shell
181      git push git+ssh://mob@repo.or.cz/srv/git/CommonLispStat.git mob:mob
182 #+end_src
186 and it'll be put on the mob branch, as a proposal for merging.
188 Another approach would be to pull from the topic branch into the mob
189 branch before uploading.   Will work on a formal example soon.
191 (the basic principle is that instead of the edit cycle on mob, do
192 something like:
194 #+begin_src shell
195   git checkout mob
196   git pull . myTopicBranch   
197   git push git+ssh://mob@repo.or.cz/srv/git/CommonLispStat.git mob:mob
198 #+end_src
202 Alternatively, one can work on the github repositories as well.  They
203 are a bit differently organized, and require one to get a github
204 account and work from there.  In that case, you'd need to D/L the
205 libraries. 
207 That gets a bit tricky, but see ./bin/GetRepos.sh for an example. 
209 * Documentation and examples
211   I've started putting examples of use in function documentation.  If
212   you are a lisp'er, you'll find this pendantic and insulting.  Many
213   of the uses are trivial.  However, this has been tested out on a
214   number of research statisticians (the primary user audience) and
215   found useful.
217   Still need to write the (run-doc-ex 'function-name) function, which
218   would print out the example and run it live.  Hopefully with the
219   same results.  I've used XML markup for this, but for no particular
220   reason, we could have used SEXPs as well.  This is currently done by
221   using an <example> tag set, as in
223 #+srcname: 
224 #+begin_src xml
225   <example>
226   (progn
227     (example-code-for-function))
228   </example>
229 #+end_src
231 * Footnotes
233 [fn:1] I´m not including instructions for Emacs or git, as the former
234 is dealt with other places and the latter was required for you to get
235 this.  Since disk space is cheap, I´m intentionally forcing git to be
236 part of this system.  Sorry if you hate it.  Org-mode, org-babel, and
237 org-babel-lisp, and hypo are useful for making this file a literate
238 and interactively executable piece of work.