https://github.com/sasagawa888/eisl Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Customer Stories + White papers, Ebooks, Webinars + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. {{ message }} sasagawa888 / eisl Public * * Notifications * Fork 17 * Star 198 ISLisp interpreter/compiler License View license 198 stars 17 forks Activity Star Notifications * Code * Issues 3 * Pull requests 0 * Actions * Projects 0 * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Security * Insights sasagawa888/eisl This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 2 branches 48 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/s] Use Git or checkout with SVN using the web URL. [gh repo clone sasaga] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @sasagawa888 sasagawa888 Update version number. ... a0b266f Aug 23, 2023 Update version number. a0b266f Git stats * 3,053 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time .github Create FUNDING.yml December 18, 2022 08:44 bench Add thread argument to push, pop July 1, 2023 09:11 cii in cii/fmt.c str.c test.c mem.c, delete __ununsed. On Linux Mint tey ... February 8, 2023 08:18 compat Try complete what @Irvise started, support building without curses/ te... November 10, 2022 00:00 documents MOdify PARA.md August 24, 2023 06:49 example Fixed ./example/rama.lsp August 9, 2023 08:11 library Improve compiler for plet pcall pexec July 31, 2023 16:51 nana Updated complex library October 27, 2021 08:26 tests Add syntax-highlighting parallel functions. August 19, 2023 12:20 verify Update bug.lsp July 16, 2023 05:30 .gitattributes Further work on locales April 14, 2021 00:35 .gitignore Added vim swap files to .gitignore April 20, 2023 10:29 .gitmodules Remove submodules October 25, 2021 23:08 README-ja.md Add tk:update command in tcltk library July 30, 2023 05:34 README.md Modify README.md August 3, 2023 08:14 bignum.c Add big_take_from_left to bingum.c May 1, 2023 16:13 cell.c Improveing CTRL+C in parallel August 20, 2023 09:17 compute.c format c code and compiler.lsp June 11, 2023 16:05 data.c Add mutex to freashcell July 4, 2023 07:32 dextension.d Rename as snake style January 29, 2023 07:59 disl.d Rename as snake style January 29, 2023 07:59 edit.c Add mutex to freashcell July 4, 2023 07:32 edlis.c Re indent with -kr option June 25, 2023 12:57 edlis.h Fixed edlis and update version number. June 14, 2023 15:20 eisl.h Update version number. August 24, 2023 07:07 error.c worker count max 5 August 11, 2023 09:14 extension.c Re start parallel fixing August 7, 2023 18:22 fast.h Add plock pprogn to compiler July 30, 2023 12:04 ffi.h Add parallel API for compiler July 29, 2023 04:56 fprint.tst Modified runbench.lsp comment out some benchmarks March 9, 2021 17:22 function.c Add thread safe for gc July 4, 2023 08:34 gbc.c Improveing CTRL+C in parallel August 20, 2023 09:17 license.txt Move license.txt to top October 15, 2022 17:22 link.c Add parallel API for compiler July 29, 2023 04:56 long.c Re indent with KR style. January 28, 2023 08:09 long.h Re indent with KR style. January 28, 2023 08:09 main.c Resize remark[] REMKSIZE=3000000 August 11, 2023 11:04 makefile Testing parallel GC June 18, 2023 11:44 syn_highlight.c Improveing CTRL+C in parallel August 20, 2023 09:17 syntax.c worker count max 5 August 11, 2023 09:14 term.h Re indent with KR style. January 28, 2023 08:09 View code [ ] Easy-ISLisp Installation GNU Emacs support Invoke Quit Introductory article Editable REPL Goal Compiler Invoke editor WiringPi Examples. Functions for debug Extended functions README.md Easy-ISLisp Easy-ISLisp(EISL) is an interpreter and compiler compatible with the ISLisp standard. EISL was written by Kenichi Sasagawa https:// qiita.com/sym_num/items/793adfe118514668e5b0 See ISLisp YouTube introduction of Easy-ISLisp Installation Change to the git cloned or downloaded Easy-ISLisp directory. * Type "sudo make install". * You can also supply a "PREFIX=$HOME" (or wherever) argument if you want. * For more advanced hacking on the interpreter itself, you can build a debug-mode executable by supplying a "DEBUG=1" argument to make, but this is unlikely to be needed by someone starting out. Update Easy-ISlisp * Type "sudo make clean". * Type "sudo make install". You may get an error that the curses.h file cannot be found when compiling EISL & Edlis. In this case, enter the following from the terminal sudo apt install libncurses-dev Otherwise, support for curses can be disable with WITHOUT_CURSES=1 in the make command. However, this will limit REPL support and will disable edlis. After version 1.4 Windows OS is not supported. Please use WSL on Windows. see Visual Studio Code Remote Development Extension Pack We confirmed operation in the following environments. * Ubuntu 16.04 GCC 5.4 * Ubuntu 18.04 GCC 7.3 * Raspberry Pi3 Raspbian GCC 6.3 * Raspberry Pi3 Raspbian GCC 8.3.0 * Paspberry Pi400 * openSUSE Leap 42.3 GCC 4.8.5 * Debian GNU/Linux GCC 6.3 GCC 7.3 * Linux Mint GCC ver 5.4 * Linux Mint GCC ver9.3.0 * macOS 11.1 clang 12.0.0 * OpenBSD If you use Clang on MacOS, provide option to Clang compatible with GCC. If you want to use library files from anyplace other than the PREFIX argument (default /usr/local), you should set the EASY_ISLISP enviroment variable to point to it. GNU Emacs support ISLisp-mode of Emacs is developed by Mr. sasanidas. Watch the video to see how to use it. https://vimeo.com/614514131 Repository URL: https://gitlab.com/sasanidas/islisp-mode Invoke eisl In the Linux version,the REPL is editable. If you do not want to use the editable REPL, invoke with the -r option. eisl -r If you want to start after reading a file, use the -l command-line option. e.g. eisl -l foo.lsp For other options, see eisl -h: $ eisl -h List of options: -c -- EISL starts after reading compiler.lsp. -f -- EISL starts after reading formatter.lsp. -h -- display help. -l filename -- EISL starts after reading the file. -r -- EISL does not use editable REPL. -s filename -- EISL runs the file with script mode. -v -- dislplay version number. You can also write ISLisp scripts, following the usual UNIX convention of pointing to the interpreter with the first line, e.g. #!/Users/me/bin/eisl -s (format (standard-output) "Hello world~%") Quit In the REPL type (quit) or Esc+Q. In the non-editable REPL type (quit) or CTRL+D. Introductory article Mr. Hiroi has published introductory articles about ISLisp. It's written in plain Japanese, so you can easily translate it into your native language with google translator. http://www.nct9.ne.jp/m_hiroi /clisp/islisp.html Editable REPL Key bindings are as follows: Key Description ctrl+F or - move right ctrl+B or - move left ctrl+P or | recall history older ctrl+N or | recall history newer ctrl+A move to begin of line strl+E move to end of line ctrl+J ctrl+M or return insert end of line ctrl+H or back-space backspace ctrl+D delete one char ctrl+K kill line from current positon ctrl+Y yank killed line Esc Tab completion Goal I hope that Lisp will become more popular. I hope many people enjoy it. EISL aims to be user-friendly. Compiler EISL has a compiler. It generates C code that can be compiled using gcc or clang to object code. Invoke with the -c option, eisl -c or (import "compiler") in the REPL. Then you can (compile-file "foo.lsp") (load "foo.o") For example: eisl -c Easy-ISLisp Ver1.6 > (compile-file "tests/tarai.lsp") type inference initialize pass1 pass2 compiling PACK compiling TARAI compiling FIB compiling FIB* compiling ACK compiling GFIB compiling TAK compiling LISTN compiling TAKL compiling CTAK compiling CTAK-AUX finalize invoke GCC T > (load "tests/tarai.o") T > (time (tarai 12 6 0)) Elapsed Time(second)=0.024106 > (time (ack 4 1)) Elapsed Time(second)=3.728262 > Invoke editor By default the edit function invokes the Edlis editor. But note that it respects the UNIX convention of the VISUAL and EDITOR environment variables, so if either of those is defined it will be used instead. (edit file-name-string) example (edit "foo.lsp") WiringPi On paspberry PI, Eisl includes system function of WiringPi. EISL <==================================> C (wiringpi-spi-setup ch speed) <===> wiringPiSPISetup (SPI_CH, SPI_SPEED) (wiringpi-setup-gpio ) <===> wiringPiSetupGpio() (pin-mode n 'output) <====> pinMode(n, OUTPUT) or 'input -> INPUT 'pwm-output -> PWM-OUTPUT (digital-write n v) <===> digitalWrite(n, v) (digital-write-byte v) <===> digitalWriteByte(value) (digital-read pin) <===> digitalRead(pin) (delay howlong) <===> void delay(unsigned int howLong) (pull-up-dn-control pin pud) <===> pullUpDnControl(pin,pud) (pwm-set-mode 'pwm-mode-ms) <===> pwmSetMode(PWM_MODE_MS); or 'pwm-mode-bal -> PWM_MODE_BAL (pwm-set-clock n) <===> pwmSetClock(n) (pwm-set-range n) <===> pwmSetRange(n) (pwm-write pin value) <===> pwmWrite(pin , value) Examples. ;;LED on/off (defglobal pin 5) (defglobal flag nil) (defun test (n) (cond ((null flag) (wiringpi-setup-gpio)(setq flag t))) (pin-mode pin 'output) (for ((i 0 (+ i 1))) ((> i n) t) (digital-write pin 1) (delay 1000) (digital-write pin 0) (delay 1000))) ;;control servo moter. ;;SG90 Micro servo Digital 9g (defun setup () (cond ((null flag) (wiringpi-setup-gpio ) (setq flag t))) (pin-mode 18 'pwm-output) (pwm-set-mode 'pwm-mode-ms) (pwm-set-clock 400) (pwm-set-range 1024)) (defun test (n) (pwm-write 18 n)) Functions for debug * (trace fn1 fn2 ... fn) * (untrace fn1 fn2 ... fn) or (untrace) * (backtrace) * (break) * (macroexpand-1) Extended functions Function Description (atom x) is x not cons? return T or NIL (eval x) evaluate s-expression x (nconc x y) append list x and list y destructively (random n) random-integer from 0 to n (random-real) random-float-number from 0 to 1 (set-random n) set random seed to non-negative number n (gbc) invoke garbage collection. (gbc t) display message when invoke GC. (gbc nil) not display message when invoke GC. (heapdump n) display cell dump list from nth address (instance n) display instance of nth address (defmodule name body) see tests/module.lsp (import x) import library. e.g. (import "compiler") (quit) quit from interpreter (load filename) load code from file e.g. (load "foo.lsp") (getenv var) get environment-var e.g. (getenv "EASY_ISLISP") (line-argument n) get nth argument from OS. n is zero base (line-argument) get all arguments from OS. (print obj) print obj to standard-stream (system cmd) send bash command e.g. (system "ls") (funcp x) is x user-defined-function? return T or NIL (subrp x) is x subr? return T or NIL (macrop x) is x macros? return T or NIL (fixnump x) is x fixnum?(32bit) return T or NIL (longnump x) is x longnum?(64bit) return T or NIL (bignump x) is x bignum? return T or NIL (macroexpand-1 x) macroexpand x only once (macroexpand-all x) macroexpand x completely About ISLisp interpreter/compiler Topics lisp Resources Readme License View license Activity Stars 198 stars Watchers 21 watching Forks 17 forks Report repository Releases 44 Easy-ISLisp ver3.45 Latest Aug 23, 2023 + 43 releases Sponsor this project Sponsor Learn more about GitHub Sponsors Packages 0 No packages published Contributors 14 * @sasagawa888 * @poldy * @gtnoble * @wasamasa * @lassik * @dbane-em * @cmplstofB * @Irvise * @yurivict * @d0p1s4m4 * @informatimago + 3 contributors Languages * Common Lisp 30.5% * Roff 29.8% * C 17.9% * Makefile 8.5% * Assembly 5.1% * TeX 3.1% * Other 5.1% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.