lisp | Toy Lisp 15 interpreter | Interpreter library

 by   robpike Go Version: Current License: BSD-3-Clause

kandi X-RAY | lisp Summary

kandi X-RAY | lisp Summary

lisp is a Go library typically used in Utilities, Interpreter applications. lisp has no bugs, it has no vulnerabilities, it has a Permissive License and it has medium support. You can download it from GitHub.

To install: go get robpike.io/lisp. This is an implementation of the language defined, with sublime concision, in the first few pages of the LISP 1.5 Programmer's Manual by McCarthy, Abrahams, Edwards, Hart, and Levin, from MIT in 1962. It is a pedagogical experiment to see just how well the interpreter (actually EVALQUOTE/APPLY) defined on page 13 of that book really works. The answer is: perfectly, of course. This program was a joy to put together. Its purpose was fun and education, and in no way to create a modern or even realistic Lisp implementation. The goal was to turn that marvelous page 13 into a working interpreter using clean, direct Go code.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              lisp has a medium active ecosystem.
              It has 930 star(s) with 49 fork(s). There are 22 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 0 open issues and 1 have been closed. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of lisp is current.

            kandi-Quality Quality

              lisp has 0 bugs and 0 code smells.

            kandi-Security Security

              lisp has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              lisp code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              lisp is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              lisp releases are not available. You will need to build from source code and install.
              Installation instructions are not available. Examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of lisp
            Get all kandi verified functions for this library.

            lisp Key Features

            No Key Features are available at this moment for lisp.

            lisp Examples and Code Snippets

            No Code Snippets are available at this moment for lisp.

            Community Discussions

            QUESTION

            How do purely functional languages handle index-based algorithms?
            Asked 2022-Apr-05 at 12:51

            I have been trying to learn about functional programming, but I still struggle with thinking like a functional programmer. One such hangup is how one would implement index-heavy operations which rely strongly on loops/order-of-execution.

            For example, consider the following Java code:

            ...

            ANSWER

            Answered 2022-Mar-07 at 21:17

            This is not an index-heavy operation, in fact you can do this with a one-liner with scanl1 :: (a -> a -> a) -> [a] -> [a]:

            Source https://stackoverflow.com/questions/71387267

            QUESTION

            Genera: Unlocking a Package
            Asked 2022-Feb-22 at 10:55

            There isn't a Genera topic on stackoverflow, but I thought I'd take the chance that one of the (probably) 5 people in the world using it might be here; no harm in trying.

            I've run into the situation where a few of the systems I'm working with use pretty printing, which is not implemented on Genera. I've managed to work around the problem in my own system by using the predecessor of pretty printing, XP. Looking at the code in xp-code.lisp and comparing it to that in CCL, it's clear where CCL got its pretty printing functions from.

            One solution, now proving inadequate, is to have a top-level eval that does an (xp::install :package my-package) and resume from the redefinition warnings. The problem is that when one of the third-party systems is compiled, they too complain about pretty printing features that are not implemented, so I'd have to install XP in each of these other packages that want pretty printing.

            What really needs to happen is for XP to be installed in the common-lisp package, because all of these other systems are going to :use :cl and expect to have a fully functional pretty printing system.

            That's not so easy though; the CL package is locked and each XP symbol requires multiple confirms, and a type 'yes', to get it into the CL package. The documentation for External-only Packages and Locking suggests that:

            To set up an external-only package, it can be temporarily unlocked and then the desired set of symbols interned in it

            but no where does it say how to unlock a package, and the Document Examiner isn't turning up much.

            I also have to stop and wonder if I'm barking up the wrong tree. XP was written with Genera in mind, and there are conditionalisations in the code for the platform. It shouldn't be so hard to install using the install function; and I wonder if I'm missing something obvious.

            Does anyone out there know how to unlock the CL package, or the proper way install XP in Genera? The included instructions for XP appear to be out of date.

            ...

            ANSWER

            Answered 2022-Feb-22 at 10:55

            QUESTION

            How to use of laziness in Scheme efficiently?
            Asked 2021-Dec-30 at 10:19

            I am trying to encode a small lambda calculus with algebraic datatypes in Scheme. I want it to use lazy evaluation, for which I tried to use the primitives delay and force. However, this has a large negative impact on the performance of evaluation: the execution time on a small test case goes up by a factor of 20x.

            While I did not expect laziness to speed up this particular test case, I did not expect a huge slowdown either. My question is thus: What is causing this huge overhead with lazy evaluation, and how can I avoid this problem while still getting lazy evaluation? I would already be happy to get within 2x the execution time of the strict version, but faster is of course always better.

            Below are the strict and lazy versions of the test case I used. The test deals with natural numbers in unary notation: it constructs a sequence of 2^24 sucs followed by a zero and then destructs the result again. The lazy version was constructed from the strict version by adding delay and force in appropriate places, and adding let-bindings to avoid forcing an argument more than once. (I also tried a version where zero and suc were strict but other functions were lazy, but this was even slower than the fully lazy version so I omitted it here.)

            I compiled both programs using compile-file in Chez Scheme 9.5 and executed the resulting .so files with petite --program. Execution time (user only) for the strict version was 0.578s, while the lazy version takes 11,891s, which is almost exactly 20x slower.

            Strict version ...

            ANSWER

            Answered 2021-Dec-28 at 16:24

            This sounds very like a problem that crops up in Haskell from time to time. The problem is one of garbage collection.

            There are two ways that this can go. Firstly, the lazy list can be consumed as it is used, so that the amount of memory consumed is limited. Or, secondly, the lazy list can be evaluated in a way that it remains in memory all of the time, with one end of the list pinned in place because it is still being used - the garbage collector objects to this and spends a lot of time trying to deal with this situation.

            Haskell can be as fast as C, but requires the calculation to be strict for this to be possible.

            I don't entirely understand the code, but it appears to be recursively creating a longer and longer list, which is then evaluated. Do you have the tools to measure the amount of memory that the garbage collector is having to deal with, and how much time the garbage collector runs for?

            Source https://stackoverflow.com/questions/70501342

            QUESTION

            Create the responsive next / previous button for my project
            Asked 2021-Dec-19 at 04:40

            could you guys please help me creating a next and previous buttons ? I've been struggling because of my bad javascript . I saw some people use Jquery and almost all Javascript. I'm practicing Javascript so there are a lot of things I don't know. Thank you very much.

            Wants: Next / Previous button to go to next page and go back page if users want to read again that page.

            Link of my demo: https://jsfiddle. net/hioihia123/zgjswtay/3/

            ...

            ANSWER

            Answered 2021-Dec-19 at 04:40

            Can you simply add the Previous and Next buttons at the footer or somewhere you'd prefer, and link to appropriate pages? Won't that be simple enough in your case?

            Source https://stackoverflow.com/questions/70408731

            QUESTION

            How come (let ((x 'huh?)) (cons (boundp 'x) x)) evaluates to (NIL . HUH?)?
            Asked 2021-Nov-15 at 19:03

            I do not understand this:

            ...

            ANSWER

            Answered 2021-Nov-15 at 19:03

            boundp is for determining whether symbols are bound in the global environment. Note the following two examples from the HyperSpec:

            Source https://stackoverflow.com/questions/69975715

            QUESTION

            Why are Common Lisp functions visible outside an enclosing let?
            Asked 2021-Oct-09 at 18:39

            In Scheme, the function f below is not visible outside its enclosing let:

            ...

            ANSWER

            Answered 2021-Oct-09 at 14:31

            From common lisp hyperspec:

            Evaluating defun causes function-name to be a global name for the function specified by the lambda expression

            Source https://stackoverflow.com/questions/69507212

            QUESTION

            Loading a local file in a remote Lisp with swank/slime
            Asked 2021-Oct-07 at 07:52

            Say that I am connected to a remote Lisp using swank/slime. I have a data file on my local machine on disk or, perhaps, in an emacs buffer. I want to process this file using the remote Lisp.

            I can obviously drop out to a shell and scp the file to the server, load the file, process it, close, delete the file so that I don't make a mess on the server.

            I can also paste the file into the repl:

            ...

            ANSWER

            Answered 2021-Oct-01 at 15:50

            Have you tried compiling the buffer directly (rather than loading the file)? This would only help if the buffer is compile-able, of course.

            This previous answer seems relevant (Load remote Lisp files):

            For your particular case, I suggest you compile the buffer (select the whole buffer C-x h, then C-c C-c), not the file (C-c C-k).

            The annoyance is that this changes the buffer's point and mark. Hopefully, you won't be compiling a whole buffer all the time.

            Source https://stackoverflow.com/questions/69397351

            QUESTION

            Parser written in Haskell not working as intended
            Asked 2021-Sep-29 at 14:33

            I was playing around with Haskell's parsec library. I was trying to parse a hexadecimal string of the form "#x[0-9A-Fa-f]*" into an integer. This the code I thought would work:

            ...

            ANSWER

            Answered 2021-Sep-29 at 14:33

            You need to place eof at the end.

            Source https://stackoverflow.com/questions/69378170

            QUESTION

            What is the meaning of the "explicit-check" declaration identifier in SBCL?
            Asked 2021-Sep-28 at 15:49

            In the source code of SBCL's y-or-n-p, I see (declare (explicit-check)):

            ...

            ANSWER

            Answered 2021-Sep-28 at 15:49

            Based on the following sources in the code, it appears that explicit-check indicates that the types associated with function parameters, as declared by an FTYPE declaration, are not automatically checked but checked explicitly (manually).

            This avoids having redundant checks when some function f dispatches on type of one argument a to a specialized function f_a whose signature is declared by FTYPE. Without the explicit-check in f_a, the type of a would be checked twice, once during type dispatch, and once when entering the function.

            • src/compiler/ir1-translators.lisp

            Source https://stackoverflow.com/questions/69270663

            QUESTION

            Yin-yang puzzle in Ruby
            Asked 2021-Aug-04 at 12:52

            As an attempt to learn more about call/cc in general I saw How does the yin-yang puzzle work? question and this explaination about the yin-yang puzzle:

            ...

            ANSWER

            Answered 2021-Aug-04 at 12:52

            i think your problem that yin and yang will become Continuation and they don't call together but only yang nested inside yin.

            Source https://stackoverflow.com/questions/68648586

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install lisp

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/robpike/lisp.git

          • CLI

            gh repo clone robpike/lisp

          • sshUrl

            git@github.com:robpike/lisp.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Interpreter Libraries

            v8

            by v8

            micropython

            by micropython

            RustPython

            by RustPython

            otto

            by robertkrimen

            sh

            by mvdan

            Try Top Libraries by robpike

            ivy

            by robpikeGo

            filter

            by robpikeGo

            nihongo

            by robpikeGo

            translate

            by robpikeGo

            typo

            by robpikeGo