README.md

Русская версия

VeLisp

VeLisp is AutoLISP interpreter with DCL support. The idea is to treat AutoLISP as a general purpose programming language. The goal is to run AutoLISP programs outside of AutoCAD. Why? To learn basic AutoLISP and DCL programming, to write shell scripts, to run DCL dialogs just like regular applications on Windows, MacOS and Linux.

Table of contents

Windows

Install

You can find the latest release here.

Install via automatic setup

  1. Download https://github.com/ten0s/velisp/releases/download/0.7.10/velisp-0.7.10-win-x64-setup.zip
  2. Open Downloads folder
  3. Double-click on velisp-0.7.10-win-x64-setup.zip to open the archive
  4. Run velisp-0.7.10-win-x64-setup.exe
  5. Follow the installation wizard. Default options are ok for most users

Install via binary archive

Download and unarchive
  1. Download https://github.com/ten0s/velisp/releases/download/0.7.10/velisp-0.7.10-win-x64.zip
  2. Open Downloads folder
  3. Select velisp-0.7.10-win-x64.zip
  4. Press the right mouse button
  5. Click ‘Extract All…’
  6. Enter ’C:'
  7. Click ‘Extract’
Add the folder to PATH
  1. Press ‘Windows + Break’ to open the System Info
  2. Click ‘Advanced system settings’
  3. Click ‘Environment Variables…’
  4. Select ‘Path’ inside the User variables block
  5. Click ‘Edit…’
  6. Click ‘New…’
  7. Enter ‘C:\velisp-0.7.10-win-x64’
  8. Click ‘OK’
  9. Click ‘OK’

Usage

If you installed VeLisp via automatic setup go to ‘Start’ -> ‘VeLisp’ -> ‘VeLisp Command Prompt’.

If you installed Velisp via binary archive run the Command Prompt (cmd.exe) and move to the extraction directory:

> cd C:\velisp-0.7.10-win-x64

Run REPL (Read–Eval–Print Loop)

> velisp
VeLisp 0.7.10 on Windows
Type ".license" or ".help" for more information
_$ (+ 1 2)
3
_$ (defun add (a b) (+ a b))
ADD
_$ (mapcar '(lambda (x y) (itoa (add x y))) '(1 2 3) '(9 8 7))
("10" "10" "10")
_$ (quit)

Run code from file

Calculate 10th (by default) Fibonacci number

> velisp examples\fib.lsp
55

Calculate 11th Fibonacci number

> velisp examples\fib.lsp 11
89

Run the Calculator example

> velisp examples\calc.lsp

App Calc Windows Image

Run the Minesweeper example

> velisp examples\mines.lsp

App Mines Windows Image

Run the Fifteen Puzzle example

> velisp examples\fifteen.lsp

App Fifteen Windows Image

Run the Demo example

> velisp examples\demo.lsp

App Demo Windows Image

Run the Slides example

> velisp examples\slides.lsp

App Slides Windows Image

Run code from standard input

> type examples\fib.lsp | velisp
55
> type examples\fib.lsp | velisp -- 11
89
> echo (alert "Hello from VeLisp!") | velisp

Alert Hello From VeLisp Windows Image

> echo (alert (strcat "Hello from " (argv 2) "!")) | velisp -- Arg

Alert Hello From Arg Windows Image

Run without DCL support (faster loading, good for scripting)

> velisp --no-dcl examples\fib.lsp
55

Run the examples in AutoCAD

Add the examples folder to AutoCAD’s search path

  1. Click ‘Tools’ -> ‘Options…’
  2. Click ‘Files’ -> ‘Support File Search Path’
  3. Click ‘Add…’
  4. Click ‘Browse…’
  5. Select appropriately C:\Program Files\VeLisp\examples or C:\velisp-0.7.10-win-x64\examples
  6. Click ‘OK’
  7. Click ‘Apply’
  8. Click ‘OK’

Run the examples

  1. Click ‘Tools’ -> ‘AutoLISP’ -> ‘Visual LISP Editor’
  2. Run in Visual LISP Console
_$ (load "calc")
_$ (load "mines")
_$ (load "fifteen")
_$ (load "demo")
_$ (load "slides")

Self-extracting archive

How to create self-extracting archive https://ten0s.github.io/blog/2024/10/05/velisp-self-extracting-archive-en

MacOS

Install

You can find the latest release here.

Download and unarchive

Warning: Do not use Safari to download the archive, do not use Finder to extract the archive and, most importantly, do not use Finder to start VeLisp for the first time. Since VeLisp is not signed you will not be able to start it this way due to Apple’s Gatekeeper. Instead, start the Terminal application (Finder -> Go -> Utilities -> Terminal) and run:

% cd $HOME
% curl -LJO https://github.com/ten0s/velisp/releases/download/0.7.10/velisp-0.7.10-macos-x64.tar.xz
% tar xfJ velisp-0.7.10-macos-x64.tar.xz

Add to ~/.zshrc

export PATH=<PATH_TO>/velisp-0.7.10-macos-x64:$PATH

Usage

% cd velisp-0.7.10-macos-x64

Run REPL (Read–Eval–Print Loop)

% ./velisp
VeLisp 0.7.10 on MacOS
Type ".license" or ".help" for more information
_$ (+ 1 2)
3
_$ (defun add (a b) (+ a b))
ADD
_$ (mapcar '(lambda (x y) (itoa (add x y))) '(1 2 3) '(9 8 7))
("10" "10" "10")
_$ (quit)

Run code from file

Calculate 10th (by default) Fibonacci number

% ./velisp examples/fib.lsp
55

Calculate 11th Fibonacci number

% ./velisp examples/fib.lsp 11
89

Run the Calculator example

% ./velisp examples/calc.lsp

App Calc MacOS Image

Run the Minesweeper example

% ./velisp examples/mines.lsp

App Mines MacOS Image

Run the Fifteen Puzzle example

% ./velisp examples/fifteen.lsp

App Fifteen MacOS Image

Run the Demo example

% ./velisp examples/demo.lsp

App Demo MacOS Image

Run the Slides example

> ./velisp examples/slides.lsp

App Slides MacOS Image

Run code from standard input

% cat examples/fib.lsp | ./velisp
55
% cat examples/fib.lsp | ./velisp -- 11
89
% echo '(alert "Hello from VeLisp!")' | ./velisp

Alert Hello From VeLisp MacOS Image

% echo '(alert (strcat "Hello from " (argv 2) "!"))' | ./velisp -- Arg

Alert Hello From Arg MacOS Image

Run without DCL support (faster loading, good for scripting)

% ./velisp --no-dcl examples/fib.lsp
55

Linux

Install

You can find the latest release here.

Download and unarchive

$ curl -LJO https://github.com/ten0s/velisp/releases/download/0.7.10/velisp-0.7.10-linux-x64.tar.xz
$ tar xfJ velisp-0.7.10-linux-x64.tar.xz

Add to ~/.bashrc

export PATH=<PATH_TO>/velisp-0.7.10-linux-x64:$PATH

Usage

$ cd velisp-0.7.10-linux-x64

Run REPL (Read–Eval–Print Loop)

$ ./velisp
VeLisp 0.7.10 on Linux
Type ".license" or ".help" for more information
_$ (+ 1 2)
3
_$ (defun add (a b) (+ a b))
ADD
_$ (mapcar '(lambda (x y) (itoa (add x y))) '(1 2 3) '(9 8 7))
("10" "10" "10")
_$ (quit)

Run code from file

Calculate 10th (by default) Fibonacci number

$ ./velisp examples/fib.lsp
55

Calculate 11th Fibonacci number

$ ./velisp examples/fib.lsp 11
89

Run the Calculator example

$ ./velisp examples/calc.lsp

App Calc Linux Image

Run the Minesweeper example

$ ./velisp examples/mines.lsp

App Mines Linux Image

Run the Fifteen Puzzle example

$ ./velisp examples/fifteen.lsp

App Fifteen Linux Image

Run the Demo example

$ ./velisp examples/demo.lsp

App Demo Linux Image

Run the Slides example

> ./velisp examples/slides.lsp

App Slides Linux Image

Run code from standard input

$ cat examples/fib.lsp | ./velisp
55
$ cat examples/fib.lsp | ./velisp -- 11
89
$ echo '(alert "Hello from VeLisp!")' | ./velisp

Alert Hello From VeLisp Linux Image

$ echo '(alert (strcat "Hello from " (argv 2) "!"))' | ./velisp -- Arg

Alert Hello From Arg Linux Image

Run without DCL support (faster loading, good for scripting)

$ ./velisp --no-dcl examples/fib.lsp
55

Implemented functions

Known issues and limitations

  • Integers are signed numbers with values ranging from -9,007,199,254,740,991 (-253+1) to +9,007,199,254,740,991 (+253-1)

Versioning

The version reflects subjective percentage of completeness. For example, the version 0.7.3 should be read as VeLisp is 73% (0.73) ready.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as below, without any additional terms or conditions.

License

The project is licensed under the GNU General Public License v3.0 or later with the exception below. See LICENSE or https://spdx.org/licenses/GPL-3.0-or-later.html for full license information.

The files in the examples/ and lib/ directories are licensed under the BSD Zero Clause License. See LICENSE or LICENSE or https://spdx.org/licenses/0BSD.html for full license information.

See also

Описание

AutoLISP interpreter with DCL support

Конвейеры
0 успешных
0 с ошибкой