# clnl
-This is an experiment at creating an alternate implementation of NetLogo mainly as an exercise for me so that I come to understand NetLogo better. It is true for me that I only truly understand something when I can explain it to someone else without repetition. In code, this manifests as expressing a program in another language.
+This is an experiment at creating an alternate implementation of NetLogo in Common Lisp.
-See the [wiki](https://github.com/frankduncan/clnl/wiki) for more information at this time.
+See the [wiki](https://github.com/frankduncan/clnl/wiki) for more information.
-# Building
+# Running from source
-If you'd like to build it, you're going to need a few things:
+If you'd like to run it from source, you're going to need a few things:
+* A copy of the clnl source (either from the [releases page](https://github.com/frankduncan/clnl/releases) or via cloning)
* An implementation of sbcl with threads enabled
-* The following common lisp libraries (included in deps/tarpit folder)
+* The following common lisp libraries (included in [deps/common-lisp](deps/common-lisp) folder)
* alexandria
* babel
* cffi
* cl-charms
* cl-opengl
* cl-ppcre
- * docgen
* ironclad
* mt19937
* nibbles
* trivial-features
- * style-checker
-* rlwrap
-# Running as a program
-
-bin/nl has been added for convenience to run the netlogo instance. It boots up the ncurses command line with an opengl view. Not very many commands are implemented, but it should alert you to that. A good test is
+[bin/nl](bin/nl) and [bin/run.lisp](bin/run.lisp) have been added for convenience to run the netlogo instance. It boots up the ncurses command line with an opengl view. Not very many commands are implemented, but it should alert you to that. A good test is
```
crt 10
ask turtles [ fd 5 ]
```
+## Running on OSX
+
+In order to run on OSX, you may have to build your own sbcl instance with threads enabled. See [bin/buildosxexec.sh](bin/buildosxexec.sh) for how it's done when releasing/testing.
+
+## Running on Windows
+
+In order to run on Windows, you will need to install a copy of 32bit sbcl with threads enabled, as well as putting a copy of freeglut and pdcurses in that directory. See [bin/buildwindowsexec.sh](bin/buildwindowsexec.sh) for how it's done when releasing/testing.
+
# Running in a common lisp instance
If you'd like to run using your own sbcl instance, you can attach the clnl.asd file wherever you link asd files, and then use:
(clnl:run)
```
-## Running on OSX
-
-In order to run on OSX, you may have to build your own sbcl instance with threads enabled.
-
-# Testing
-
-If you'd like to see the tests go on your system, there's a number of utilities to look at:
+# Using standalone executables
-* bin/test.lisp
-* bin/diagnose-test
-* bin/diagnose-view-test
-* bin/test-mode
+See the [releases page](https://github.com/frankduncan/clnl/releases) for the most recent release.
--- /dev/null
+#!/bin/bash
+
+# This script builds a verion of sbcl with the libraries pre loaded
+# for ease of travis. Remember to update bin/buildosxsbcl when you
+# update this.
+
+mkdir -p tmp/sbcl
+
+cwd=$PWD
+( cd tmp &&
+ tar jxf ../deps/linux/sbcl-1.2.6-x86-64-linux-binary.tar.bz2 &&
+ cd sbcl-1.2.6-x86-64-linux/ &&
+ SBCL_HOME="" INSTALL_ROOT=$cwd/tmp/sbcl/ bash install.sh )
+
+mkdir -p tmp/deps/
+
+( cd tmp/deps &&
+ tar zxf ../../deps/common-lisp/3b-cl-opengl-993d627.tar.gz &&
+ tar zxf ../../deps/common-lisp/alexandria-b1c6ee0.tar.gz &&
+ tar zxf ../../deps/common-lisp/babel_0.5.0.tar.gz &&
+ tar zxf ../../deps/common-lisp/cffi_0.15.0.tar.gz &&
+ tar zxf ../../deps/common-lisp/cl-ppcre.tar.gz &&
+ tar zxf ../../deps/common-lisp/ironclad.tar.gz &&
+ tar zxf ../../deps/common-lisp/mt19937-latest.tar.gz &&
+ tar zxf ../../deps/common-lisp/nibbles-v0.12.tar.gz &&
+ tar zxf ../../deps/common-lisp/trivial-features_0.8.tar.gz &&
+ tar zxf ../../deps/common-lisp/cl-charms-9bb94ef.tar.gz
+)
+
+SBCL_HOME="" tmp/sbcl/bin/sbcl --core tmp/sbcl/lib/sbcl/sbcl.core \
+ --eval "(require 'asdf)" \
+ --eval "(asdf:initialize-source-registry '(:source-registry (:tree \"${PWD}/tmp/deps\") (:directory \"${PWD}/src/main\") :IGNORE-INHERITED-CONFIGURATION))" \
+ --eval "(asdf:load-system :clnl)" \
+ --eval "(asdf:clear-output-translations)" \
+ --eval '(sb-ext:save-lisp-and-die "clnl" :executable t :toplevel (function clnl:run))'
+
+chmod +x clnl
+
+rm -rf tmp
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="500"
+ height="500"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.48.5 r10040"
+ sodipodi:docname="logo.svg"
+ inkscape:export-filename="/home/herbie/lisp/clnl/resources/logo/logo1024.png"
+ inkscape:export-xdpi="184.32001"
+ inkscape:export-ydpi="184.32001">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.7"
+ inkscape:cx="485.50283"
+ inkscape:cy="-5.1983055"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1678"
+ inkscape:window-height="989"
+ inkscape:window-x="0"
+ inkscape:window-y="30"
+ inkscape:window-maximized="0"
+ inkscape:snap-grids="false"
+ inkscape:snap-to-guides="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid4240"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-552.36218)">
+ <rect
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:8;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="rect3017"
+ width="423.25391"
+ height="362.96167"
+ x="38.373047"
+ y="620.88135" />
+ <g
+ id="g2997"
+ transform="matrix(0.77421468,0,0,0.77421468,56.101339,195.21214)">
+ <rect
+ y="614.70905"
+ x="30.108809"
+ height="219.78238"
+ width="219.78239"
+ id="rect3004"
+ style="fill:none;stroke:#000000;stroke-width:15.49957657;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-width:15.49957657;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
+ id="rect3790"
+ width="219.78239"
+ height="219.78238"
+ x="251"
+ y="614.70905" />
+ <polygon
+ style="fill:#0000ff;fill-opacity:1"
+ id="polygon4048"
+ points="40,250 150,205 260,250 150,5 "
+ transform="matrix(-0.71550806,0,0,-0.71550806,247.32621,815.82753)" />
+ <polygon
+ style="fill:#0000ff;fill-opacity:1"
+ id="polygon4048-3"
+ points="150,205 260,250 150,5 40,250 "
+ transform="matrix(0,0.71550806,-0.71550806,0,452.11847,617.27404)" />
+ </g>
+ <g
+ id="g3005"
+ transform="matrix(0.55763053,0,0,0.55763053,108.46072,388.477)">
+ <path
+ inkscape:connector-curvature="0"
+ id="path4094"
+ d="m 49.384049,890.65188 c 26.015274,0 52.030551,0 78.045801,0"
+ style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:19.64974022;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4094-4"
+ d="m 50.263874,990.49165 c 0,-36.59464 0,-73.18943 0,-109.78413"
+ style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:19.76080704;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4094-3"
+ d="m 50.23318,980.54731 c 26.015273,0 52.03054,0 78.04582,0"
+ style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:19.64974022;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4094-2"
+ d="m 379.80053,980.80353 c 26.14542,0 52.29084,0 78.43624,0"
+ style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:19.69882774;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4094-4-5"
+ d="m 160.12432,990.50585 c 0,-36.59272 0,-73.18542 0,-109.77811"
+ style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:19.76024818;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4094-4-6"
+ d="m 269.97098,990.50585 c 0,-36.59272 0,-73.18542 0,-109.77811"
+ style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:19.76024818;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4094-4-2"
+ d="m 346.86366,990.50585 c 0,-36.59276 0,-73.18544 0,-109.77813"
+ style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:19.76024818;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4094-4-5-7"
+ d="m 379.81766,990.50585 c 0,-36.59272 0,-73.18542 0,-109.77811"
+ style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:19.76024818;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ inkscape:connector-curvature="0"
+ id="path4094-2-4"
+ d="m 160.10718,980.54731 c 26.14541,0 52.29083,0 78.43625,0"
+ style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:19.69882774;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ <path
+ sodipodi:nodetypes="cc"
+ inkscape:connector-curvature="0"
+ id="path4242"
+ d="m 271.70684,889.11779 72.84721,93.66562"
+ style="fill:none;stroke:#0000ff;stroke-width:19.69882774;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+ </g>
+ </g>
+</svg>