Common Lisp IDE


Good day, dear reader!
Before every new to the world of programming language Common Lisp
there is a problem of choice of development environment Integrated Development Environment (the IDE).

/ > There are a large number IDE Common Lisp. We list some of the most common of them:
the
Experts
Experts may argue regarding the last two items on the list.
After all, it would seem, Lispbox = Emacs + Slime?!
But, if you look closely at the website Lispbox, then, under the links for downloading the package, You will see:
Last updated: February 6, 2011.

In this article I will detail how to install and configure the cross-platform development environment for Common Lisp, how to download and install additional libraries using quicklisp — package Manager, Common Lisp. There will be many useful links to resources and materials on the language.
We will focus on conjunction GNU Emacs &Slime.
If You are interested in Common Lisp, You need cross-platform, powerful, interactive Common Lisp IDE with blackjack and ladies a debugger and disassembler (suddenly!) then ask under the cut...



the

one implementation of Common Lisp


Common LispANSI a standardized programming language that does not have a single canonical implementation.
Here is the list of major implementations:
the
We need a cross-platform, free, actively growing realization of the Common Lisp. I chose SBCL.
So, let's start!!!

the

Preparatory work


MS Windows


the
    the
  • Create the directory for the GNU Emacs at C:\emacs\
  • the
  • Create the directory for SBCL at C:\sbcl\
  • the
  • Download latest version GNU Emacs and extract in the directory C:\emacs\
  • the
  • Download distribution SBCL and set in the directory C:\sbcl\
  • the
  • Go to the directory GNU Emacs (C:\emacs\bin\), find addpm.exe and run it
    (I will add the icon that launches the Emacs in start)
  • the
  • Editable environment variables:
    the

      Create environment variable with name HOME (if You have not done this yet...) and value
      C:\Users\%username%\
      where %username% is the name of Your account

      Create environment variable with name PATH (if You have not done this yet...) and value C:\emacs\bin\

  • the
  • Create an empty file called .emacs C:\Users\%username%\
  • the
  • Creating empty directory C:\Users\%username%\.quicklisp\
  • the
  • Download the file quicklisp.lisp and place it in directory C:\Users\%username%\.quicklisp\

GNU/Linux (deb-based distributives)


the
    the
  • Install GNU Emacs:
    the
    sudo apt-get -y install emacs24
    sudo apt-get -y install org-mode
    sudo apt-get -y install emacs24-el
    sudo apt-get -y install emacs-goodies-el 
    
    the 
  • Set SBCL:
    the
    sudo apt-get -y install sbcl
    sudo apt-get -y install sbcl-doc
    sudo apt-get -y install sbcl-source
    
  • the
  • Create an empty file called .emacs home directory ~/
  • the
  • Creating empty directory ~/.quicklisp/
  • the
  • Download the file quicklisp.lisp and place it in directory ~/.quicklisp/
    sudo apt-get -y install curl
    curl -o $HOME/.quicklisp/quicklisp.lisp https://beta.quicklisp.org/quicklisp.lisp
    


the

customizing Emacs


It's time to configure the Emacs for professional Common Lisp projects.
Warning
All further work on setting up the system will take place in the GNU Emacs.
Everything below applies to MS Windows and GNU/Linux.
Assumes basic knowledge of editing in Emacs.

Open for editing the file .emacs. Go!
the
    the
  • implementation-Defined Common Lisp:
    the
    (require 'cl)
    (setq-default inferior-lisp-program "sbcl")
    
  • the
  • Configure the package Manager of Emacs:
    the
    ;; Package manager:
    ;; Initialise and add Melpa package repository
    (require 'package)
    (add-to-list 'package-archives
    '("melpa-stable" . "https://stable.melpa.org/packages/") t)
    (package-initialize)
    
    (defvar required-packages '(slime
    smartparens
    auto-complete))
    
    (defun packages-installed-p ()
    (loop for package in required-packages
    unless (package-installed-p package)
    do (return nil)
    finally (return t)))
    
    (unless (packages-installed-p)
    (package-refresh-contents)
    (dolist (package required-packages)
    (unless (package-installed-p package)
    (package-install package))))
    

    Now when You run the Emacs again, it will automatically download and install packages:
    the
  • the
  • Set up our packages:
    the
    (when (packages-installed-p)
    (require 'smartparens-config)
    (smartparens-global-mode)
    
    (require 'auto-complete-config)
    (ac-config-default)
    (global-auto-complete-mode t)
    (setq-default ac-auto-start t)
    (setq-default ac-auto-show-menu t)
    (defvar *sources* (list
    'lisp-mode
    'ac-source-semantic
    'ac-source-functions
    'ac-source-variables
    'ac-source-dictionary
    'ac-source-words-in-all-buffer
    'ac-source-files-in-current-dir))
    (let (source)
    (dolist (source *sources*)
    (add-to-list 'ac-sources source)))
    (add-to-list 'ac-modes 'lisp-mode)
    
    (require 'slime)
    (require 'slime-autoloads)
    (slime-setup '(slime-asdf
    slime-fancy
    slime-indentation))
    (setq-default is slime-net-coding-system 'utf-8-unix))
    
  • the
  • Adjust the indentation of Lisp code:
    the
    (setq-default lisp-body-indent 2)
    (setq-default lisp-indent-function 'common-lisp-indent-function)
    

Save the file .emacs and restart the Emacs.
Emacs download and install Slime, Smartparens and Auto Complete automatically in the directory
C:\Users\%username%\.emacs.d\ to MS Windows in the directory ~/.emacs.d/ GNU/Linux.
Warning
Written by us, only that the configuration file .emacs is cross-platform!
If you are migrating from Linux Windows conversely, nothing needs to be changed!
The main thing — to position .emacs in the right directory (theenvironment variable
HOME to MS Windows — definitely!
).

Early to celebrate, you also need to set quicklisp package Manager Common Lisp.

the

Installation and setup quicklisp


Quicklisp — a package Manager language Common Lisp.
the
    the
  • In the running Emacs execute the command M-x slime (Alt-x slime);
    this will start the IDE Common LispSlime
  • the
  • Execute:
    the
    ;; load the package Manager
    (load "~/.quicklisp/quicklisp.lisp")
    ;; Automatically download and install package Manager quicklisp
    ;; with all dependencies
    (quicklisp-quickstart:install :path "~/.quicklisp/")
    ;; Create .sbclrc file in your home directory
    ;; and, every time you run Slime/SBCL will load
    ;; downloaded and  installed  Your packages and libraries
    (ql:add-to-init-file)
    

For example, install a couple of libraries for the Common Lisp with quicklisp:
the

    CEPL is a lispy and friendly REPL library for working with OpenGL:
    the

    (ql:quickload :swank)
    (ql:quickload :sdl2)
    (ql:quickload :cepl.sdl2)
    
    the
  • working with databases
    the
    (ql:quickload :cl-dbi)
    
  • Webserver:
    the

    (ql:quickload :hunchentoot)
    
    the
  • ...
  • the
  • update the installed libraries and the quicklisp:
    the
    (ql:update-all-dists)
    (ql:update-client)
    

For Common Lisp written by big the number of good libraries for all occasions.
With quicklisp they are easy to install and start using.
In fact, You now have all you need in order to plunge into the world of Common Lisp!
Congratulations!

the

Useful links


the
Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Monitoring PostgreSQL + php-fpm + nginx + disk using Zabbix

Templates ESKD and GOST 7.32 for Lyx 1.6.x

Customize your Google