Coder Social home page Coder Social logo

marcomaggi / vicare Goto Github PK

View Code? Open in Web Editor NEW
200.0 26.0 34.0 257.25 MB

A native compiler for Scheme compliant with R6RS

Home Page: http://marcomaggi.github.com/vicare.html

License: Other

Scheme 91.90% Shell 0.31% Awk 0.02% C 4.91% Standard ML 0.21% Java 0.10% TeX 0.56% Perl 0.01% Makefile 0.97% Assembly 0.17% Lex 0.01% M4 0.60% Emacs Lisp 0.03% SaltStack 0.22%

vicare's Introduction

Vicare Scheme

Build Status

Active development of this project is currently on hiatus. The maintainer might accept contributions, but he is not currently working of further development.

Introduction

Scheme is a statically scoped and properly tail-recursive dialect of the Lisp programming language invented by Guy Lewis Steele Jr. and Gerald Jay Sussman. It was designed to have an exceptionally clear and simple semantics and few different ways to form expressions.

The "Revised^6 Report on the Algorithmic Language Scheme" gives a defining description of the programming language Scheme. The report is the work of many people in the course of many years; revision 6 was edited by Michael Sperber, R. Kent Dybvig, Matthew Flatt and Anton Van Straaten.

Ikarus Scheme is an almost R6RS compliant implementation of the Scheme programming language; it is the creation of Abdulaziz Ghuloum, which retired from development in 2010. Vicare Scheme is an R6RS compliant fork of Ikarus Scheme, aiming to become a native compiler for R6 Scheme producing single threaded programs running on Intel x86 32-bit and 64-bit processors. It is tested only on GNU+Linux; it should work on POSIX platforms, but not on Cygwin.

"Vicare" is pronounced the etruscan way.

Vicare offers arbitrary precision integers through GMP. It implements an optionally included foreign-functions interface based on Libffi. The last time the maintainer updated this paragraph, it had tested Libffi version 3.2.1.

A port to R6RS of the SRFI libraries is included in the distribution.

License

Copyright (c) 2011-2017 Marco Maggi [email protected]
Copyright (c) 2006-2010 Abdulaziz Ghuloum [email protected]
Modified by the Vicare contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Install

Install Vicare

See the INSTALL file for installation instructions for generic packages using the GNU Autotools. To install Vicare Scheme from a proper release tarball, we must unpack the archive then do:

$ cd vicare-scheme-0.4.0
$ ./configure
$ make
$ make install

To run the test suite we do:

$ make check

The Makefile is designed to allow parallel builds, so we can do:

$ make -j4 all && make -j4 check

which, on a 4-core CPU, should speed up building and checking significantly.

By default only compiled Scheme libraries are installed; to install also the source libraries we must configure with:

$ ./configure --enable-sources-installation ...

If, instead, we have checked out a revision from the repository, we will have to first build the infrastructure by running a Bourne shell script from the top source directory:

$ cd vicare-scheme
$ sh autogen.sh

notice that autogen.sh will run the programs autoreconf and libtoolize; the latter is selected through the environment variable LIBTOOLIZE, whose value can be customised; for example to run glibtoolize rather than libtoolize we do:

$ LIBTOOLIZE=glibtoolize sh autogen.sh

GNU Libtool is not directly needed by Vicare Scheme, but it is needed to correctly link libraries (like GNU Libiconv) which make use of it.

After this the procedure is the same as the one for building from a proper release tarball, but we must enable maintainer mode when running the configure script:

$ ./configure --enable-maintainer-mode
$ make
$ make install

again to run the test suite we do:

$ make check

To make use of the POSIX semaphore functions, we need to include the pthread library using the option:

$ ./configure --with-pthread [... other options ...]

by default pthread is linked to the executable if found on the host.

A bare build (without support for optional features and external libraries) can be obtained with:

$ ./configure \
     --disable-posix    \
     --disable-glibc    \
     --disable-linux    \
         --without-pthread  \
         --without-libffi   \
         --without-libiconv \
         --without-readline

To test what a rule will do use the "-n" option; example:

$ make install -n

The Makefile supports the DESTDIR environment variable to install the files under a temporary location; example:

$ make install DESTDIR=/tmp/vicare

By default, the Scheme libraries are installed under the directory:

$(libdir)/vicare-scheme

we should arrange the package configuration to install 32-bit binary libraries under:

$(prefix)/lib/vicare-scheme

and 64-bit binary libraries under:

$(prefix)/lib64/vicare-scheme

by configuring, for example, with:

$ ./configure --libdir=/usr/local/lib64 ...

The variable VFLAGS is available to the user when running configure and make to add command line options to the execution of vicare when compiling libraries and running tests; for example:

$ make VFLAGS="-g -O2 --print-loaded-libraries"

Special make rules

There are special makefile rules to rebuild source code files, mostly lexer and parser tables:

  • ip-address-tables - rebuild the tables for the net libraries
  • silex-test - rebuild the tests for the SILex lexer
  • lalr-test - rebuild the tests for the LALR parser

and the following DANGEROUS rule, use only if you know what you are doing:

  • silex-internals - rebuild the internal tables of SILex itself

Testing

Test files are located in the tests directory; the files with extension .sps are Scheme programs. They are partitioned in two families: the files whose name start with long-test need some time to be executed by a powerless computer; the files whose name start with test can be run in reasonable time on any system. The files whose name contains r6rs are R6RS compliance tests by Matthew Flatt.

The command make check will run all the tests, quick and long; the commands make test and make tests run the same set of "quick" tests; the commands make long-test and make long-tests run the same set of time-consuming tests. The check rule uses the GNU Automake infrastructure (parallel test harness, see Automake's documentation for details). After package installation: we can run the tests using the make installcheck rule which will load the installed libraries.

It is possible to select a single test file by using the file variable on the command line of make; for example:

$ make test file=equal-hash

will run the program test-issue-001-equal-hash.sps. The file variable is used to expand a file name with wildcards as in test-*$(file)*.sps.

It is possible to run vicare from the build directory with user selected command line arguments doing:

$ make test-run VFLAGS='...'

where the contents of the VFLAGS variable are placed directly on the command line.

Some test files need a usable directory pathname in the TMPDIR environment variable.

The test files acting on networking sockets expect localhost to resolve to the IPv4 address 127.0.0.1, which is usually the case.

The file test-vicare-posix-sockets.sps contains tests for network sockets which are normally disabled because the firewall rules on the hosting machine must allow TCP and UDP connections on 127.0.0.1:8080 and 127.0.0.1:8081; to enable these tests run make with the environment variable RUN_INET_TESTS set to something:

$ make test file=vicare-posix-sockets RUN_INET_TESTS=1

Usage

Read the documentation.

Credits

The original Ikarus Scheme code is the work of Abdulaziz Ghuloum. Vicare Scheme is a fork driven by Marco Maggi. See the CONTRIBUTORS file for the list of contributors to Ikarus Scheme and Vicare Scheme.

IrRegex is adapted from the original distribution by Alex Shinn, see the file LICENSE.irregex.

Pregexp is adapted from the original library by Dorai Sitaram, see the file LICENSE.pregexp.

The libraries in the hierarchy (vicare containers strings ---) are derived from the reference implementation of SRFI 13 by Olin Shivers.

The libraries in the hierarchy (vicare containers vectors ---) are derived from the reference implementation of SRFI 13 by Olin Shivers.

The library (vicare containers knuth-morris-pratt) is derived from the reference implementation of SRFI 13 by Olin Shivers.

The library (vicare containers strings rabin-karp) is derived from the implementation at:

<http://algs4.cs.princeton.edu/53substring/RabinKarp.java.html>

The library (vicare containers levenshtein) is derived from code by Neil Van Dyke.

The library (vicare language-extensions streams) is derived from code by Philip L. Bewig.

The library (vicare language-extensions loops) is derived from code by Sebastian Egner.

The library (vicare language-extensions comparisons) is derived from code by Sebastian Egner and Jens Axel Soegaard.

The libraries in the hierarchy (vicare crypto randomisations ---) have many authors, please see the headers of the individual files.

Some libraries in the hierarchy (vicare containers bytevectors ---) are derived from the SRFI 13 reference implementation by Olin Shivers.

The library (vicare formations) is derived from: format.scm Common LISP text output formatter for SLIB. Written 1992-1994 by Dirk Lutzebaeck. Authors of the original version (<1.4) were Ken Dickey and Aubrey Jaffer. Assimilated into Guile May 1999. Ported to R6RS Scheme and Vicare by Marco Maggi.

The SILex libraries are a port to R6RS Scheme of SILex version 1.0 by Danny Dubé. Copyright (C) 2001, 2009 Danny Dubé.

The LALR libraries are a port to R6RS Scheme of Lalr-scm by Dominique Boucher. Copyright (c) 2005-2008 Dominique Boucher.

Bugs, vulnerabilities and contributions

Bug and vulnerability reports are appreciated, all the vulnerability reports are public; register them using the Issue Tracker at the project's GitHub site. For contributions and patches please use the Pull Requests feature at the project's GitHub site.

Resources

The latest version of this package can be downloaded from:

https://bitbucket.org/marcomaggi/vicare-scheme/downloads

the home page of the Vicare project is at:

http://marcomaggi.github.io/vicare.html

development takes place at:

http://github.com/marcomaggi/vicare/

and as backup at:

https://bitbucket.org/marcomaggi/vicare-scheme/

The library Libffi can be found at:

http://sourceware.org/libffi/

The GMP library is available at:

http://gmplib.org/

The home page of the R6RS standard is at:

http://www.r6rs.org

Badges and static analysis

Travis CI

Travis CI is a hosted, distributed continuous integration service used to build and test software projects hosted at GitHub. We can find this project's dashboard at:

https://travis-ci.org/marcomaggi/vicare

Usage of this service is configured through the file .travis.yml and additional scripts are under the directory meta/travis-ci.

vicare's People

Contributors

eholk avatar kstephens avatar larsmans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vicare's Issues

in debug mode, incorrect handling of quasiquoted expressions

Running the program below as:

$ ikarus --r6rs-script hurtme.sps
ciao

while in debug mode:

$ ikarus --debug --r6rs-script hurtme.sps
ciao
ciao

(import (rnrs))
(define (b)
  (display "ciao\n"))
(quasiquote (,(b)))

notice that changing the expression to "(quasiquote ,(b))" does not exercise the bug.

This is bug #563577 in the Ikarus bug tracker.

(expt +i +inf.0) gives an &assertion

expt gives an exception here, but it should give some sort of NaN value:

Ikarus Scheme version 0.0.4-rc1+, 64-bit (revision 1870, build 2010-01-26)
Copyright (c) 2006-2009 Abdulaziz Ghuloum

(expt +i +inf.0)
Unhandled exception
Condition components:

  1. &assertion
  2. &who: fllog
  3. &message: "not a flonum"
  4. &irritants: (0.0+1.0i)

Matches Ikarus bug 633393, reported by Göran Weinholt.

hypot

(magnitude (make-rectangular 1e200 1e200)) overflows. This is because it directly calculates something of the form (sqrt (+ (square x) (square y))). The right way to fix this is to include hypot in the math functions imported from the math libraries, and use it appropriately. It might even be worth exposing to Scheme as its own function.

third argument of number->string is ignored

The third argument of number->string is currently ignored by the implementation in "ikarus.numerics.ss". It seems that all the R6RS implementations ignore it today (2010-06-07).

Matches bug 160780 in the Ikarus bug tracker.

GFDL License Issue

The file doc/macros.texi states:

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
any later version published by the Free Software Foundation; with no
Invariant Sections being GNU Free Documentation License'' andGNU
General Public License'', no Front--Cover Texts, and no Back--Cover
Texts. A copy of the license is included in the distribution.

Two issues.

First, there is a typo: "no Invariant Sections being".

Second, many people, as well as the Debian project, have issues with the GFDL. Unless there is a show-stopper in doing this, it would be convenient if the license were either changed to be the same as the rest of the project (GNU GPL3) or dual-licensed with the license. An example of why this would be appreciated is that the current difference is licenses between the manual and the source code prohibits is cut-and-paste of text between the manual and the source code!

detection of letrec and letrec* restrictions is a must

The following test should succeed because the LETREC form is wrong:

(check
    (guard (E ((assertion-violation? E)
               #t)
              (else #f))
      (eval '(letrec ((c b)
                      (b a)
                      (a 12))
               c)
            (environment '(rnrs))))
  => #t)

Matches bug 216832 at the Ikarus bug tracker.

Graph syntax reader bug

I just installed Vicare Scheme and came across a bug in the reader, it is also present in Ikarus. If you are constructing a graph using reader syntax as opposed to by mutating the list explicitly, and you forget the quote, then it will hang your system.

'#0=(a b c #0#)

#0=(a b c #0#)

#0=(a b c #0#)

hangs

While I am sure that this is a bug, I am not sure whether or not the 'correct' solution is to have this be an error, or to allow it a la bytevectors.

wrong handling of sum between exact integers and complex numbers

The two following operations must return the same result:

(+ 1 -1.1-0.0i)       => -0.10000000000000009+0.0i
(- 1 +1.1+0.0i)       => -0.10000000000000009+0.0i
                                             ^
                                             !

but instead they returned:

(+ 1 -1.1-0.0i)       => -0.10000000000000009-0.0i
(- 1 +1.1+0.0i)       => -0.10000000000000009+0.0i
                                             ^
                                             !

this is wrong because R6RS specifies the following for the "-"
function:

 Implementations that  distinguish -0.0 should  adopt behavior
 consistent with the following examples:

      (+  0.0 -0.0)           =>  0.0
      (+ -0.0  0.0)           =>  0.0
      (+  0.0  0.0)           =>  0.0
      (+ -0.0 -0.0)           => -0.0

so the "+" operation must be implemented as:

 (+ 1 -1.1-0.0i)
 == (make-rectangular (+ 1 -1.1) (+   0 -0.0))
 == (make-rectangular (+ 1 -1.1) (+ 0.0 -0.0))
 == (make-rectangular (+ 1 -1.1) (+ 0.0 -0.0))
 == (make-rectangular -0.100...  0.0)

notice that the step:

 (+ 0 -0.0) == (+ 0.0 -0.0)

is not compliant with R6RS but we accept it because it makes
other formulas work correctly, for example the following two
versions of ATAN which should return the same result:

 (define (atan-one x)
   (* +0.5i
      (- (log (+ 1 (* -1i x)))
         (log (+ 1 (* +1i x))))))

 (define (atan-two x)
   (* +0.5i
      (- (log (- 1 (* +1i x)))
         (log (+ 1 (* +1i x))))))

assertion violation in ik_mmap when running ikarus-io test file

With commit 6fc6e6a:

 $ make long-test file=ikarus-io
cd tests ; make long-test
make[1]: Entering directory `/home/marco/src/devel/scheme/vicare/=build.devel/tests'

*** testing Ikarus input/output functions
running "reading 256 bytes in ascending order" ... ok
running "reading 256 bytes in ascending order 2 at a time" ... ok
running "peeking 256 bytes in ascending order" ... ok
running "custom-binary-port port-eof?" ... ok
running "reading 256 bytes from bytevector-input-port" ... ok
running "peeking 256 bytes from bytevector-input-port" ... ok
running "bytevector-binary-port port-eof?" ... ok
running "reading 256 latin1 chars from bytevector-input-port" ... ok
running "peeking 256 bytes from latin1 transcoded port" ... ok
running "latin1 transcoded port port-eof?" ... ok
running "reading 128 utf8 chars from bytevector-input-port" ... ok
running "peeking 128 chars from utf8 port" ... ok
running "utf8 transcoded port port-eof?" ... ok
vicare: ../../src/ikarus-runtime.c:175: ik_mmap: Assertion `size == mapsize' failed.
/bin/sh: line 1: 26671 Aborted                 VICARE_LIBRARY_PATH=../../tests:../../tests/../lib:./../lib:../../tests/../scheme CHECK_TEST_NAME= VICARE_SRC_DIR=../../tests VICARE_BUILDDIR=. LD_LIBRARY_PATH=./../src/.libs ./../src/vicare -b ./../scheme/vicare.boot --debug --r6rs-script $f
make[1]: *** [long-test] Error 134
make[1]: Leaving directory `/home/marco/src/devel/scheme/vicare/=build.devel/tests'
make: *** [long-test] Error 2

vicare error: program file name given after mode option

Not sure what is happening. Also tried the latest version, but same issue. It also passed 100 of 104 of the simple tests in the package. Any suggestion much appreciated!

cnsgsz@ubuntu:~$ vicare --r6rs-script test.sps hi there
*** vicare error: program file name given after mode option

The program otherwise seems to run correctly:

cnsgsz@ubuntu:~$ vicare
Vicare Scheme version 0.2d10
Revision devel/de54fd79ed8b7dd28e18924aa1c64ba45adf7add
Build 2012-08-07

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011, 2012 Marco Maggi

vicare>

string->number wrong parsing of numbers with sign in the middle

The following forms should return false:

(string->number "1-1") => 1-i
(string->number "1.2-3.4") => 1.2-3.4i

but notice that:

(string->number "1/2-3/4") => #f

The problem shows up in source files reading, too, because the code of STRING->NUMBER is used also by the reader.

timer which returns Scheme values

The TIME-IT function prints time statistics on the console; it would be nice to have an alternative implementation returning the same informations as Scheme values.

Matches bug 190377 at the Ikarus bug tracker.

Scheme stack overflow is possible

There is no true stack overflow prevention check; a check is present, but it does not guarantee to always detect the danger. Even though it is unlikely to happen, a Scheme stack overflow can happen.

native endianness is hard coded as little

Native endianness is hard coded as little in "ikarus.bytevectors.ss". All the functions in this file need to be checked. Also the low level operations in "pass-specify-rep-primops.ss" need to be checked.

Redefining imported variables in interactive mode

This is the same bug as I reported at http://code.google.com/p/mosh-scheme/issues/detail?id=168 for Mosh.

What steps will reproduce the problem?

  1. Open vicare/ikarus REPL
  2. type (define * (* 2 3))
  3. type * again

What is the expected output? What do you see instead?

The expected output for step 2 is unspecified, (in Vicare none).
Instead I get

Unhandled exception
 Condition components:
   1. &undefined
   2. &who: eval
   3. &message: "unbound variable"
   4. &irritants: (*)

The expected output for step 3 is 6.
Instead I get

Unhandled exception
 Condition components:
   1. &undefined
   2. &who: eval
   3. &message: "unbound variable"
   4. &irritants: (*)`

The same thing happens if you try to redefine a variable imported from a library
in that manner.

What version of the product are you using? On what operating system?

Ikarus Scheme version 0.0.4-rc1+ (revision 1870, build 2010-05-26)
and Vicare git commit 030b076 on Fedora 13

Please provide any additional information below.

Traditionally in Scheme, a redefinition at the REPL has been equivalent to a set!.
I agree that the error is appropriate behaviour for a program ran in a batch mode,
however in a REPL, I'd expect to be able to rebind a variable, whether or not it
would be considered immutable in batch mode, and that it would have it's previous
value on it's right hand side until after the right hand side has been evaluated.

Vicare already lets me rebind variables I define myself i.e.
$ vicare
> (define g 10)
> g
10
> (define g (* g g ))
> g
100
>

It allows this behaviour if I have already redefined the previously immutable variable.
$ vicare
> (define * (lambda () #f))
> *
#<procedure >
> (define * (
))
> *
#f
> (define + -)
> +
#<procedure ->
> (define + (+ 10 7))
> +
3
>

optimizer error in some case of R6RS record type constructor call

Using the head of the devel branch (at least up to commit 6b24b40) it sometimes happens that calling an R6RS record constructor fails because the constructor function binding references #<void> rather than the function. In such cases the code fails with an error like:

*** Vicare: unhandled exception:
 Condition components:
   1. &assertion
   2. &who: apply
   3. &message: "not a procedure"
   4. &irritants: (#<void>)

This happens when the executable is run with options -O1, -O2, -O3 without debugging mode; it does not happen when using -O0 or turning on debugging mode. Notice that, by default, Vicare runs with -O2.

I am still working on finding a small example of code that reproduces this problem; in the meantime it is known that the package Industria (branch vicare-scheme) is affected by this problem.

The easy workaround is to run vicare with -O0; when configuring a package using the GNU Autotools (at least the ones packaged by me) we can do:

$ configure VFLAGS=-O0

Ikarus Bug 795236 \x7f; is printed unescaped

Reported by Göran Weinholt:

The DEL character is printed unescaped. It's not generally considered
printable, and on my terminal it looks like whitespace for some reason.

Ikarus Scheme version 0.0.4-rc1+, 64-bit (revision 1870, build 2010-11-07)
Copyright (c) 2006-2009 Abdulaziz Ghuloum

"\x7f;"
"�"

Arbitrary limit in apply

The apply procedure is limited to 8192 arguments. Please consider this a request to remove that limit, or to at least not have the condition be an &assertion. The &assertion condition inherits from &violation, which implies that the program has a bug. The most appropriate condition seems to be &implementation-restriction.

Vicare Scheme version 0.3d1, 64-bit
Revision devel/eb362bf709a6d7d0da3bcfdf4c126ea6898137c1
Build 2013-08-20

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011-2013 Marco Maggi

vicare> (apply list (vector->list (make-vector 9000 #t)))
Unhandled exception
Condition components:

  1. &assertion
  2. &who: apply
  3. &message: "expected proper list as argument with maximum length 8192"
  4. &irritants: ((#t #t #t #t #t #t #t #t #t #t #t #t #t #t #t #t #t #t #t
    ...

Build fails when HAVE_LIBFFI is not defined.

When libffi is not found, build fails because there are no dummy implementations for

ikptr ik_enter_c_function (ikpcb* pcb) { return false_object; }
void ik_leave_c_function (ikpcb* pcb,ikptr sk) { }

Add those dummy definitions under the #else part of #ifdef HAVE_LIBFFI in src/ikarus-ffi.c and it should build correctly.

bitwise-arithmetic-shift-right doesn't handle bignum shift amounts

The bitwise-arithmetic-shift-right procedure doesn't handle bignum shift amounts. The example below should return -1.

Vicare Scheme version 0.3d1, 64-bit
Revision devel/eb362bf709a6d7d0da3bcfdf4c126ea6898137c1
Build 2013-08-20

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011-2013 Marco Maggi

vicare> (bitwise-arithmetic-shift-right -1 (+ (greatest-fixnum) 1))
Unhandled exception
Condition components:

  1. &assertion
  2. &who: bitwise-arithmetic-shift-right
  3. &message: "expected fixnum as argument"
  4. &irritants: (1152921504606846976)

atan on small imaginary numbers loses precision

for small x, (atan x) is approximately x, since (atan 0) is 0 and the derivative of atan at 0 is 1. However for small imaginary arguments, there is a loss of precision causing bogus low digits and, for small enough arguments, rounding down to zero.

vicare> (atan 1e-20i)
0.0+0.0i

This is caused by (log (+ 1 e)) when e is small. The "right" fix is to use the C function log1p, which means an interface to that must be created, should probably be exposed at the user level, etc.

missing one-operand division operation for flonum complex numbers

$ vicare
Vicare Scheme version 0.1b0+ (revision e17ad8e, build 2011-06-13)
Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors

(/ 1.1+2.2i)
Unhandled exception
Condition components:

  1. &assertion
  2. &who: /
  3. &message: "not a number"
  4. &irritants: (1.1+2.2i)

The function "/" in the file "ikarus.numerics.ss" is missing the case for the predicate "clflonum?".

Can't (import (vicare))

Hello!
If I understood the documentation correctly, (import (vicare)) should have the same effect as (import (ikarus)).

From the documentation:

3 Extensions library

In addition to the libraries listed in the R6RS standard, Vicare offers the (ikarus) and (vicare) libraries which provide additional features; (ikarus) is a composite library, it exports a superset of all the supported bindings of R6RS; (vicare) exports the same bindings of (ikarus).

Now, in my machine, they are not the same. I can (import (ikarus)), but cannot (import (vicare)).

darkam andres /home/andres/scheme $ vicare
*** vicare warning: optimization level artificially set to 0.
Vicare Scheme version 0.1b1+ (revision 3e33f3b1ff6f1f076491569949a5e0ba2e7663c6, build 2011-10-26)
Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors

> (library-path)
("/usr/lib" "/home/andres/scheme/vicare/lib/vicare")
> (import (ikarus))
> (import (vicare))
Unhandled exception
 Condition components:
   1. &error
   2. &who: expander
   3. &message: "cannot locate library in library-path"
   4. &library-resolution:
       library: (vicare)
       files: ("/usr/lib/vicare/main.vicare.sls" "/usr/lib/vicare/main.vicare.ss" "/usr/lib/vicare/main.vicare.scm" "/usr/lib/vicare/main.sls" "/usr/lib/vicare/main.ss" "/usr/lib/vicare/main.scm" "/usr/lib/vicare.vicare.sls" "/usr/lib/vicare.vicare.ss" "/usr/lib/vicare.vicare.scm" "/usr/lib/vicare.sls" "/usr/lib/vicare.ss" "/usr/lib/vicare.scm" "/home/andres/scheme/vicare/lib/vicare/vicare/main.vicare.sls" "/home/andres/scheme/vicare/lib/vicare/vicare/main.vicare.ss" "/home/andres/scheme/vicare/lib/vicare/vicare/main.vicare.scm" "/home/andres/scheme/vicare/lib/vicare/vicare/main.sls" "/home/andres/scheme/vicare/lib/vicare/vicare/main.ss" "/home/andres/scheme/vicare/lib/vicare/vicare/main.scm" "/home/andres/scheme/vicare/lib/vicare/vicare.vicare.sls" "/home/andres/scheme/vicare/lib/vicare/vicare.vicare.ss" "/home/andres/scheme/vicare/lib/vicare/vicare.vicare.scm" "/home/andres/scheme/vicare/lib/vicare/vicare.sls" "/home/andres/scheme/vicare/lib/vicare/vicare.ss" "/home/andres/scheme/vicare/lib/vicare/vicare.scm")
> 

Is this expected behaviour, or a bug?
Am I missing something?

Thanks,

Andrés.

Can't read complex numbers like 1@1/3

Reported by Göran Weinholt on the Ikarus bug tracker:

Ikarus can't parse complex numbers on polar form when the angle is a
non-trivial rational:

1@1/3
Unhandled exception
Condition components:
1. &lexical
2. &message: "invalid numeric sequence"
3. &irritants: ("1@1/3\n")
4. &source-position:
file-name: stdin
character: 5

abort caused by invalid frame size

When running some code, for example test files, with debugging mode turned on (--debug command line option) the following error appears:

*** testing Vicare input/output functions
*** Vicare error: invalid framesize 4, expected 0 or less
    rp = 0x0000000008057870
    rp offset = 0

AFAICT this never happens when running outside debugging mode. It seems that the error is somwhat related to code using guardians and after GC hooks to perform miscellaneous cleanup actions.

Ikarus Bug 793544 Shared structures are displayed peculiarly

Reported by Göran Weinholt:

Ikarus Scheme version 0.0.4-rc1+, 64-bit (revision 1870, build 2010-11-07)
Copyright (c) 2006-2009 Abdulaziz Ghuloum

(let ((l '(b c)))
(display (list l (cdr l)))
(newline))
((b . (c)) (c))

As you can see, the printer decided to use the dot notation, even though
it wasn't necessary in this case. This can get pretty confusing in
larger examples.

Installation instructions incomplete for Git checkouts

Installation instructions for Git checkouts (as opposed to release tarballs) should note that the build only works correctly if one configures with --enable-maintainer-mode (so that doc/version.texi gets rebuilt) and executes scripts/make-last-revision from the top directory.

Writes to current-output-port don't appear when not in REPL.

The following code prints nothing on stdout when run with "vicare --r6rs-script hello-world.sch" (or any other non-interactive invocation). It works fine when typed directly into the REPL. This was compiled on 64-bit Arch Linux, but built as -m32 binary from Git commit e14cda2...

$ cat hello-world.sch
(import (rnrs base)
(rnrs io simple))

(display "Hello world.\n" (current-output-port))

Iconv support broken on systems with iconv() inside glibc

The configure script assumes that the (vicare iconv) library can only be built if a libiconv is available. This is not true as glibc can (and is, in e.g. Arch Linux) be built with iconv() and related APIs integrated instead, meaning that there is no separate libiconv on the system and leading to a spurious failure. I am not familliar enough with autotools to rewrite this myself at the moment, but I figure that VICARE_WITH_LIBRARY in its current form cannot support this case.

segment fault when building on branch "devel"

when building on branch "devel" on ubuntu 1204, x86_64, the building process seg faults.

the log:
chaos@felucia:/src/vicare/build/scheme$ pwd
/home/chaos/src/vicare/build/scheme
chaos@felucia:
/src/vicare/build/scheme$ make
VICARE_SRC_DIR=../../scheme
VICARE_BUILD_DIR=.
VICARE_FASL_DIRECTORY=''
VICARE_LIBRARY_PATH=.:../../scheme:../../scheme/../lib:./../lib
../src/vicare -b ../../scheme/vicare.boot.8.prebuilt
--r6rs-script ../../scheme/makefile.sps
make: *** [vicare.boot] Segmentation fault (core dumped)

Segfault when port? is called with no arguments

Vicare Scheme version 0.3d1, 64-bit
Revision devel/eb362bf709a6d7d0da3bcfdf4c126ea6898137c1
Build 2013-08-20

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011-2013 Marco Maggi

vicare> (port?)
Segmentation fault

record protocol function returning void crashes process

The following program crashes the process:

(import (rnrs))
(define-record-type alpha
(fields a)
(protocol (lambda (maker)
(newline))))
(make-alpha 1)

It does not crash when done in the REPL, it does not crash when done in debug mode.

This matches bug #559498 in the Ikarus bug tracker.

Negative result from gcd

The gcd procedure is specified to always return a non-negative result. In this example it should return 1:

Vicare Scheme version 0.3d1, 64-bit
Revision devel/eb362bf709a6d7d0da3bcfdf4c126ea6898137c1
Build 2013-08-20

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011-2013 Marco Maggi

vicare> (gcd -1)
$1 = -1

(bitwise-ior) and (bitwise-xor) should both be zero

When bitwise-ior or bitwise-xor is called with zero arguments they should return 0, which acts as identity for these procedures. The example below should return 42:

Vicare Scheme version 0.3d1, 64-bit
Revision devel/eb362bf709a6d7d0da3bcfdf4c126ea6898137c1
Build 2013-08-20

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011-2013 Marco Maggi

vicare> (define (identity x) (bitwise-ior x (bitwise-ior)))
vicare> (identity 42)
$1 = -1

Possible problems with fork

I was trying to run the fork example from the docs, and I'm not sure it's working correctly. Here's a transcript:

(Vicare Scheme version 0.2d16
Revision 3e33f3b1ff6f1f076491569949a5e0ba2e7663c6
Build 2012-09-04

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011, 2012 Marco Maggi

vicare> (import (vicare posix))
vicare>           (fork
            (lambda (child-pid)
              (printf "in parent, child pid = ~s\n" child-pid))
            (lambda ()
              (printf "in child\n")
              (exit)))
in parent, child pid = 8057
vicare>           
          (printf "here we are in the parent\n")
here we are in the parent

I would also expect to see "in child" printed out, but I do not see this. In some other code I have been writing, it seems like only one of the thunks actually runs.

(/ -3/8) => 8/-3, (= 8/-3 (/ -3/8)) => #f

Reported by John David Stone as Ikarus bug 831582:

I expected to see (/ -3/8) => -8/3, but 8/-3 is OK even though it's not a valid R6RS numeric literal. But then (= 8/-3 (/ -3/8)) should be true. Other weirdness:

(- 8/-3 (/ -3/8)) => 0
(= -8/3 (/ -3/8)) => #f
(- -8/3 (/ -3/8)) => 0
(= -8/3 (/ 1 -3/8)) => #t
(= (/ -3/8) (/ 1 -3/8)) => #f

Segfault when fl- is called with a fixnum

When the fl- procedure is called with a single fixnum the process segfaults.

Vicare Scheme version 0.3d1, 64-bit
Revision devel/eb362bf709a6d7d0da3bcfdf4c126ea6898137c1
Build 2013-08-20

Copyright (c) 2006-2010 Abdulaziz Ghuloum and contributors
Copyright (c) 2011-2013 Marco Maggi

vicare> (fl- 1)
Segmentation fault

Additionally, the message here is wrong:

vicare> (fl- #t)
Unhandled exception
Condition components:

  1. &assertion
  2. &who: fl-
  3. &message: "expected fixnum as argument"
  4. &irritants: (#t)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.