README.txt 11.1 KB
Newer Older
1

2
          Welcome to the Genworks® GDL and Gendl® Environment
Dave Cooper's avatar
Dave Cooper committed
3 4


5
             ================================================
6
                               GDL1592
7
             ================================================
Dave Cooper's avatar
Dave Cooper committed
8 9


Dave Cooper's avatar
Dave Cooper committed
10
          Welcome to the Genworks® GDL and Gendl® Environment
11 12


Dave Cooper's avatar
Dave Cooper committed
13

14 15 16 17 18
Startup
=========

After some time, you should see a "GDL-USER>" command prompt.

Dave Cooper's avatar
Dave Cooper committed
19 20 21
A web server also starts by default on port 9000 (or the next
available port above 9000) of the local host, which allows you to
visit, for example:
22 23 24 25 26 27 28 29 30 31

  http://localhost:9000/tasty

If you accept the default robot:assembly, then click the hover-over
"pencil" icon next to the robot in the tree, you should see a
wireframe rendering of a simplified android robot.

See "Troubleshooting" below if you experience trouble starting up.


Dave Cooper's avatar
Dave Cooper committed
32 33 34 35 36 37

Updating
=========

The function (update-gdl) will pull down a bootstrap file which knows
how to fetch and install the currently available patches for this
38
version of GDL. (Note: this is not yet functional in this release).
Dave Cooper's avatar
Dave Cooper committed
39 40 41 42 43 44 45 46 47 48


Documentation
=============

 The following manual is currently available in PDF format: 
   
   http://genworks.com/downloads/tutorial.pdf


49 50 51 52 53 54 55 56 57 58 59 60
 The following Video Playlist is available (YouTube):

   https://youtu.be/aoTbtGhSHkE


 Additionally, reference documentation is available "live" from your
 running system, at

   http://localhost:9000/yadd



Dave Cooper's avatar
Dave Cooper committed
61 62 63 64
==================
Authoring GDL Code
==================

Dave Cooper's avatar
Dave Cooper committed
65 66
Gnu Emacs
==========
67

Dave Cooper's avatar
Dave Cooper committed
68 69 70 71
All things considered, Gnu Emacs is the most powerful, portable, and
risk-free IDE (Integrated Development Environment) available for
working with Lisp-based systems like GDL. Spending some time getting
familiar with Gnu Emacs is perhaps the best small investment you can
Dave Cooper's avatar
Dave Cooper committed
72
make.
73 74 75 76 77 78

If you are new to Emacs, you can get a general Emacs Tutorial under
the Help menu above. After completing the Tutorial, try to practice
what you learned by forcing yourself not to use the mouse too much in
Emacs.

Dave Cooper's avatar
Dave Cooper committed
79
Touch-typing ability is definitely an asset for GDL development, but
80 81
with auto-completion of symbols (possible with M-/ -- you'll know what
that means after looking at the tutorial) it is possible to become a
Dave Cooper's avatar
Dave Cooper committed
82
world-class GDL developer without having world-class typing speed.
83 84

It is strongly recommended to map your Caps Lock key to be a Control
Dave Cooper's avatar
Dave Cooper committed
85 86 87 88 89
key. This will allow you to use all the Emacs navigation keystrokes
without constantly curling your left little finger down to the Control
key.  For Linux and Mac, this is easy to do in your System
Preferences. For Windows, here are some resources which can help you
do this:
90 91 92 93 94 95 96

  http://johnhaller.com/jh/useful_stuff/disable_caps_lock/

Note that if you are running Windows in a Virtual Machine hosted under
MacOS or Linux, it is sufficient to map the Caps Lock to to Control in
the host system.

Dave Cooper's avatar
Dave Cooper committed
97 98
Finally, please see the Genworks Documentation (URL below) for some
screen-cast videos on using Emacs in the GDL environment.
99 100


Dave Cooper's avatar
Dave Cooper committed
101 102 103
==============================
Learning GDL and Documentation
==============================
104

Dave Cooper's avatar
Dave Cooper committed
105
Absolutely the best way to learn GDL is to dive in and start using
106 107
it for small exercises and projects.

Dave Cooper's avatar
Dave Cooper committed
108 109 110
The work-in-progress tutorial.pdf is published here:

 http://genworks.com/downloads/tutorial.pdf
111 112 113 114 115

Other Documentation:

  http://www.genworks.com

Dave Cooper's avatar
Dave Cooper committed
116 117 118 119 120 121 122 123
 Then click the link for Documentation, which contains lecture slides
 and videos.

 Additionally, reference documentation is available "live" from your
 running system, at

   http://localhost:9000/yadd

124 125 126 127 128 129


=========
Quitting 
=========

Dave Cooper's avatar
Dave Cooper committed
130
  When you have had enough of using GDL with Slime, you should do
131 132
  two things:

Dave Cooper's avatar
Dave Cooper committed
133
 1. Visit the *slime-repl ...* buffer with C-x C-&
134

Dave Cooper's avatar
Dave Cooper committed
135 136
 2. Type ,q (just a comma then the letter "q") to quit the GDL
    session. This will not quit Emacs.
137

Dave Cooper's avatar
Dave Cooper committed
138
 3. (optional) type 
139 140 141 142 143 144

        C-x C-c (that's Control-x, Control-c) 

    to kill the Emacs process and exit the window.
    
 3. If you kept Emacs up and running, it is possible to restart the
Dave Cooper's avatar
Dave Cooper committed
145
    GDL session again with: 
146

Dave Cooper's avatar
Dave Cooper committed
147
       M-x gdl
148 149 150 151 152 153


=================
Customizing Emacs
=================

Dave Cooper's avatar
Dave Cooper committed
154 155 156 157
If a file exists in your home directory called ".emacs-glime" this
will be loaded upon startup. You can put any custom emacs-lisp code in
this file to customize your startup (see below for an example to
customize the color theme).
158 159 160 161

You can always find out where Emacs thinks is your home directory's
location by typing

Dave Cooper's avatar
Dave Cooper committed
162
  C-x d ~/ <Enter>
163 164 165 166 167

This should present the list of files in the home directory, and show
its full name on the first line. Likewise, to visit your init file,
type:

Dave Cooper's avatar
Dave Cooper committed
168
   C-x C-f ~/.emacs-gendl <Enter>.
169 170 171 172 173


Color Themes
============

Dave Cooper's avatar
Dave Cooper committed
174
GDL ships with the color-theme package for Gnu emacs:
175 176 177 178 179 180 181 182

  http://emacswiki.org/emacs/ColorTheme


You can select any of the themes from color-theme with 

  M-x color-theme-select

Dave Cooper's avatar
Dave Cooper committed
183
(Click on the color theme you want to select then press <Enter>).
184 185 186 187 188 189


To set a color theme automatically, put something like the following
at the end of your ~/.emacs-gendl :


Dave Cooper's avatar
Dave Cooper committed
190
  (color-theme-bharadwaj)
191 192 193 194 195 196 197


=========================
Emacs Keychord Reference
=========================

The following is a reference for the Emacs keychords which are
Dave Cooper's avatar
Dave Cooper committed
198
commonly used when working with GDL. They will be understandable after
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311
you have completed the Emacs Tutorial mentioned above. If you force
yourself to use these for a few days, they will quickly feel natural.

;;
;; Backing out of a command (important! use this whenever you are lost)
;;

C-g  : quit the active command (use this if you ever get confused)

;;
;; Navigating Through the Buffer
;;

C-n   : next line
C-p   : previous line
C-f   : forward char
M-f   : forward word
C-M-f : forward s-expression
C-b   : backward char
M-b   : backward word
C-M-b : backward s-expression
C-a   : begin of line
C-e   : end of line

;;
;; Auto-completion
;;

M-/    : complete word

C-c ]  : "super-bracket" -- close parens to enclosing toplevel.


;;
;; Copying, Cutting, Pasting, working with Lisp S-expressions
;;

C-d         : delete character
M-d         : delete word
C-M-k       : kill s-expression
C-<space>   : begins a selection
C-M-<space> : selects current sexpression
M-w         : copies selection
C-w         : cuts selection
C-y         : yanks (pastes) the selection
M-y         : yanks previous 
C-k         : kills current line
C-x u       : Undo!
M-<space>   : removes all but one whitespace under point.
M-\         : removes all whitespace under point.

;;
;; Indenting
;;

C-M-q indents entire expression  (with cursor on opening parenthesis)

C-q indents and word-wraps a paragraph of text to reasonable line
    length.

;;
;; Working with Files & Buffers
;;

C-x C-b   : get list of open buffers
C-x k     : kills current buffer
C-x b     : visit other buffer (default is previous)
C-x C-s   : saves current buffer to file
C-x C-w   : saves current buffer to a new file
C-x C-f   : find file (i.e. file open)

;;
;; Dired (Directory editor) mode
;;

C-x C-f  to visit a directory, then <Enter> for Directory Editor (Dired)
Within Dired: 

  d  : marks file for deletion
  f  : visits the file or directory
  ~  : marks all backup files for deletion
  x  : executes pending commands (usually deletions)

;;
;; Windows and Frames
;;

C-x 2    : split screen into two windows
C-x 1    : make current window be the only window
C-x 0    : close current window
C-x o    : change to next window
C-x y    : change to previous window
C-x 2 5  : Open a new Frame (a new desktop window)
C-x &    : Jump to *gdl-devo* buffer

;;
;; Command-line Shortcuts
;;

M-p   : bring back previous command
M-n   : bring back next command


;;
;; Compiling and Loading from Buffer
;;

C-c C-k  : Compile Buffer  
C-c C-c  : Compile current form (e.g. define-object or defun)
C-x C-e  : Evaluate Form   (with cursor after closing parenthesis)



Dave Cooper's avatar
Dave Cooper committed
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379
Quicklisp
=========

Quicklisp is a curated library manager which can automatically fetch
CL libraries and their dependencies from the Internet. See
http://quicklisp.org for more information on Quicklisp.

 the function

  (load-quicklisp)

will load and initialize the supported version of quicklisp (which
ships with the installation) and pre-register all Gendl-related
packages so that Quicklisp will not try to fetch and reload these if
you try to (ql:quickload ...) a system which depends on them. The
version of quicklisp which ships with this release is the only
supported version of Quicklisp (to ensure library compatibility, each
GDL release is tied to a specific Quicklisp version).

Note that depending on your installation, you may not have file
permissions to write into the quicklisp directory in its default
location, i.e.  

  (merge-pathnames "quicklisp/" glisp:*gendl-home*)

In this case, you can copy (copy, not move) the quicklisp directory to
a writeable location of your choice, and specify a :path keyword
argument to load-quicklisp, e.g:

 (load-quicklisp :path "~/quicklisp/")

Note that it is a good idea to include the trailing slash in the
pathname.

After doing (load-quicklisp), you can test whether Quicklisp is
functional by trying something like:

  (ql:quickload :cl-json)



Emacs Initialization and Glime
==============================

We have divided the emacs user initialiazation file into two files:

  ~/.emacs-gendl[.el] which is loaded when starting this emacs
                      environment, and 

  ~/.emacs-glime[.el] which is loaded only when starting the
                      GDL-flavored Slime environment.

In case you are wondering what "glime" actually is - this is Genworks'
extension to Slime (Superior Lisp Interaction Mode for Emacs, which we
use by default to interact with Gendl and GDL from Emacs). The idea of
Glime is that when you type

  "(the ..."  or 

   ":objects ((my-object :type 'my-object ..."  

then the emacs mini-buffer will give useful and context-sensitive
completion information similar to what it does now for standard Lisp
functions. Glime already works now to some extent, but we feel it
needs to be polished a bit more before loading it by default.

You can load Glime at any time with:

380 381 382 383 384 385
  (load-glime)

followed by: 


  M-x load-file gdl/emacs/glime.el
Dave Cooper's avatar
Dave Cooper committed
386 387 388 389 390 391 392 393


In due course we intend to have Glime polished a bit more so it does a
better job filtering and formatting the auto-completions for messages
and object inputs, at which point it will be loaded by default in our
standard emacs initialization and we will rightfully be able to call
the whole environment "Glime."

394 395 396 397 398 399 400 401


Troubleshooting
===============

Webserver Fails to serve on Port 9000

  First of all, you may receive a message from your Firewall asking
Dave Cooper's avatar
Dave Cooper committed
402
  for permission to unblock services from the GDL executable. You
403 404 405 406 407 408 409 410 411 412
  should grant this permission.

  If you are unable to see the following URL:

    http://localhost:9000/color-map

  then it is possible your machine already has another process running
  on Port 9000. For example, some online gaming software will set up a
  proxy service on this port.

Dave Cooper's avatar
Dave Cooper committed
413
  If this is the case, then you can start GDL serving on a different
414 415 416 417 418 419 420 421 422 423 424 425 426 427
  port. To do this, try the following at the "gdl-user>" command
  prompt (using port 8888 as an example):

    (net.aserve:shutdown)
    (gwl:start-gwl :port 8888)

 Now try visiting 

     http://localhost:8888/color-map

 If this works, then you can put these commands into the gdlinit.cl
 initialization file in your home directory.