r6rs | R6RS compliant Scheme interpreter in JavaScript | Interpreter library

 by   yoo2001818 JavaScript Version: 0.1.19 License: MIT

kandi X-RAY | r6rs Summary

kandi X-RAY | r6rs Summary

r6rs is a JavaScript library typically used in Utilities, Interpreter applications. r6rs has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can install using 'npm i r6rs' or download it from GitHub, npm.

A Scheme interpreter (Currently partly R6RS compliant).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              r6rs has a low active ecosystem.
              It has 5 star(s) with 0 fork(s). There are 1 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              r6rs has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of r6rs is 0.1.19

            kandi-Quality Quality

              r6rs has no bugs reported.

            kandi-Security Security

              r6rs has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              r6rs is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              r6rs releases are not available. You will need to build from source code and install.
              Deployable package is available in npm.
              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 r6rs
            Get all kandi verified functions for this library.

            r6rs Key Features

            No Key Features are available at this moment for r6rs.

            r6rs Examples and Code Snippets

            No Code Snippets are available at this moment for r6rs.

            Community Discussions

            QUESTION

            Is it possible to load an entire file from disk efficiently in Scheme R6RS?
            Asked 2021-May-04 at 02:13

            The following get_file function reads file from disk as a Scheme R6RS string:

            ...

            ANSWER

            Answered 2021-May-04 at 02:13

            QUESTION

            SRFI implementations for Chez Scheme
            Asked 2020-May-16 at 17:20

            I'm new to Chez, and just looking for some clarity given the various maintained and unmaintained repos existing.

            Is there a single commonly preferred source repo to obtain the R6RS SRFI libraries (specifically for Chez Scheme)?

            I know about https://srfi.schemers.org/ which is good for searching for individual SRFI documentation, and has a tgz of all documentation and some scheme code, but there is no version or release info on the tgz (although the timestamps suggest it's fairly up to date https://srfi.schemers.org/srfi.tgz).

            For R6RS I can find most of the SRFIs as separate repos under the following repo, which isn't very practical to grab all the code: https://github.com/scheme-requests-for-implementation

            And then a variety of other repos, eg:

            https://github.com/arcfide/chez-srfi

            https://github.com/ovenpasta/thunderchez

            https://github.com/dharmatech/surfage

            https://bazaar.launchpad.net/~scheme-libraries-team/scheme-libraries/srfi/files

            The only ones with recent activity, and luckily also seem to be Chez-focused, seem to be chez-srfi and thunderchez.

            chez-srfi seems the most recently active, and once I worked out the requirement to run link-dirs.chezscheme.sps and then softlink the chez-srfi directory to srfi it seems to work using the standard import references - (import (srfi :N lib)).

            That said I've had similar success using (import (srfi sN lib)) using Thunderchez.

            I'm completely agnostic over which repo I use, providing it's easy to use and actively kept up to date. Is there a clear preferred choice providing this, or is choice based more cosmetically on personal opinion (in which case I'll form my own rather ask it on here!).

            ...

            ANSWER

            Answered 2020-May-16 at 17:20

            The honest answer is probably "no" - there is not a single version of srfi preferred by the community.

            But to (kinda) answer my own question, whilst I can't say it's a defacto standard yet, Akku is a package manager and virtual environment management system of Scheme that is miles ahead of any of the alternatives, and actively developed. It's not an individual implementation of srfi, but is a way to install various Scheme packages you need to use through a single interface.

            https://akkuscm.org/

            It's not quite venv and pip - but it's getting there. I'm amazed this isn't talked about more, I only stumbled upon it some time after my initial search for a tool like this.

            You get a single interface to pull packages for both R6RS and R7RS, and a range of Scheme implementations.

            There is also Snow, which is currently only supporting R7RS: http://snow-fort.org/

            But as Akku mirrors Snow as well as providing R6RS support, it is more comprehensive.

            To answer the specifics of the original example - Akku installs chez-srfi by default (on a Chez Scheme system at least) on creation of a new project, but also offers thunderchez as a package. Whether that indicates a preference by the Akku developer's, I'll leave up to the reader to decide.

            The original question was about a single defacto srfi implementation for Chez, rather than a more general package manager. In hindsight this misses the point a bit, simply because I didn't think a single package manager (beyond srfi) was a remote possibility.

            So for my use at least - Akku, not only provides various implementations of srfi, but also offers a host of other packages, and largely answers my question.

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

            QUESTION

            How to retrieve a foreign raw bytes pointer from a scheme bytevector?
            Asked 2020-Apr-19 at 10:22

            Scheme provides a bytevector type which can be used to do low-level operations on bytes abd array of bytes (see r6rs and chez manual). However, it does not seem to provide a way to retrieve the underlying pointer to the array of bytes it is storing and I need that pointer to pass to foreign C functions to fill or read data from the bytevector.

            To be more precise about the context, I am trying to write some code for low-level handling of bytes in Idris2 which is using Scheme as its backend, but I am a newbie in Scheme so I am certainly overlooking something obvious: What's the preferred approach to extract this pointer from the bytevector?

            ...

            ANSWER

            Answered 2020-Apr-19 at 10:22

            An operation that returned a bytevector's address as an integer would be dangerously unsafe, since the garbage collector might subsequently move the bytevector and place other objects there. Passing a stale address to C code could cause memory corruption.

            The docs for Chez Scheme's foreign-procedure say that an argument declared as u8* accepts a bytevector and passes the address of its contents to the foreign function. That's safe, because the FFI and GC cooperate to make sure the object is not moved between taking the address and calling the foreign function --- but see the warning about retaining the pointer in foreign data structures. See also lock-object, which temporarily prevents the GC from moving or reclaiming an object.

            In Racket, the _bytes and _pointer foreign types work similarly. There's also a ptr-add operation that combines a pointer-like object with an offset. For example, if bs is a bytestring, then (ptr-add bs 1 _byte) is reliably converted to the address of the second byte of bs, even if the GC moves bs. I don't know if Chez has a similar feature.

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

            QUESTION

            notation in r6rs grammar for complex numbers
            Asked 2020-Apr-07 at 13:05

            In r6rs grammar for numbers there is this rule:

            ...

            ANSWER

            Answered 2020-Feb-29 at 14:00

            It's polar notation for complex numbers @. I've never found documentation for it other than the syntax but I'd guess that is in radians.

            (magnitude 2@2) => 2.
            (angle 2@2) => 2.

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

            QUESTION

            Define goto in scheme
            Asked 2019-Oct-19 at 22:44

            As an exercise to learn call/cc and macros, I tried to define goto.

            ...

            ANSWER

            Answered 2019-Oct-19 at 22:44

            I think top level is different in different implementations. For Racket, call/cc captures continuation up to a single, top-most expression, not the whole program. I think Guile captures up to the whole program. Hence the difference.

            You can get Guile's behavior by writing your code in a function:

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

            QUESTION

            Printing hashtables in Scheme (Chez)
            Asked 2018-Dec-29 at 03:10

            I'm using quite a lot of (standard R6RS) hashtables in Chez Scheme, but it's not very nice working with them at the REPL because they are just printed as #. I have written a print-table function but it's a bit annoying to keep calling it every time I want to inspect my data.

            It looks like Racket has a way to do custom printing for a given type. Is there any way to do something similar in Scheme?

            ...

            ANSWER

            Answered 2018-Dec-29 at 03:10

            Chez Scheme does allow for custom reading and writing of most records, including hashtables. Chez Scheme provides a record-writer and record-reader procedure which allow customizing the functions used to write and read records:

            http://cisco.github.io/ChezScheme/csug9.5/objects.html#./objects:s176

            There are some good examples on that page, but an important detail is that you can specify #f as the writer, the default for new record types, which will use a format capable of being read back by the default reader. This won't work 100% of the time as there are some types which have no serializable representation, like functions.

            Once I disable the special printer for eq-hashtables and the special printer for the base hashtables, I can see the default representation:

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

            QUESTION

            Rotating a matrix, why isn't it working as a function, yet it does in line command?
            Asked 2018-Nov-02 at 06:40

            A way to rotate a matrix is by getting it's transpose and then reversing all the rows. I've got around it with two functions, map (which returns the transpose) and reverse (completing a 90° rotation), in console I do the following:

            (reverse (apply map list (list (list 1 2 3 4) (list 5 6 7 8) (list 9 10 11 12) (list 13 14 15 16)) ) )

            ...

            ANSWER

            Answered 2018-Nov-02 at 06:40

            Your input was incorrect.

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

            QUESTION

            Racket R6RS support: syntax-case
            Asked 2018-Jun-12 at 16:15

            This simple R6RS program:

            ...

            ANSWER

            Answered 2018-Jun-12 at 16:15

            The Racket implementation of R6RS is not non-compliant in this case. Indeed, if anything, it is obeying the standard more closely: your program as-written is not careful about import phases. The problem is that define-syntax evaluates its right-hand side during expand-time, as noted by section 11.2.2 Syntax definitions:

            Binds to the value of , which must evaluate, at macro-expansion time, to a transformer.

            Unlike other Scheme standards, R6RS takes care to distinguish between phases, since it permits arbitrary programming at compile-time (while other Scheme standards do not). Therefore, section 7.1 Library form specifies how to import libraries at specific phases:

            Each specifies a set of bindings to be imported into the library, the levels at which they are to be available, and the local names by which they are to be known. An must be one of the following:

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

            QUESTION

            Data Structures in Scheme
            Asked 2018-Apr-18 at 23:52

            I am learning Scheme, coming from a background of Haskell, and I've run into a pretty surprising issue - scheme doesn't seem to have custom data types??? (ie. objects, structs, etc.). I know some implementations have their own custom macros implementing structs, but R6RS itself doesn't seem to provide any such feature.

            Given this, I have two questions:

            1. Is this correct? Am I missing a feature that allows creation of custom data types?
            2. If not, how do scheme programmers structure a program?

            For example, any function trying to return multiple items of data needs some way of encapsulating the data. Is the best practice to use a hash map?

            ...

            ANSWER

            Answered 2018-Apr-18 at 22:42
            1. Absolutely not. Scheme has several SRFIs for custom types, aka. record types, and with R7RS Red edition it will be SRFI-136, but since you mention R6RS it has records defined in the standard too.

            Example using R6RS:

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

            QUESTION

            Cleanest way to make a "derived" identifier?
            Asked 2017-Dec-29 at 21:43

            It's very common for Scheme macros to make "derived" identifiers, like how defining a record type foo (using the R6RS syntactic record API) will by default define a constructor called make-foo. I wanted to do something similar in my own macro, but I couldn't find any clean way within the standard libraries. I ended up writing this:

            ...

            ANSWER

            Answered 2017-Dec-29 at 21:43

            Although it might not be a hygienic macro, i suppose you could use define-syntax like this (in chicken scheme). For chicken scheme the documentation for macros is here. Also this SO question sheds some light on chicken scheme macros. Finally i don't know if this would be an idiomatic way to approach the problem.

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install r6rs

            You can install using 'npm i r6rs' or download it from GitHub, npm.

            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
            Install
          • npm

            npm i r6rs

          • CLONE
          • HTTPS

            https://github.com/yoo2001818/r6rs.git

          • CLI

            gh repo clone yoo2001818/r6rs

          • sshUrl

            git@github.com:yoo2001818/r6rs.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 yoo2001818

            AheuiChem

            by yoo2001818JavaScript

            gb-emulator-js

            by yoo2001818TypeScript

            webglue

            by yoo2001818JavaScript

            node-ncc-es6

            by yoo2001818JavaScript

            kkiro3d

            by yoo2001818JavaScript