unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* GNU Guile 2.9.9 Released [beta]
@ 2020-01-13  8:39 Andy Wingo
  2020-01-13  8:44 ` Andy Wingo
                   ` (3 more replies)
  0 siblings, 4 replies; 24+ messages in thread
From: Andy Wingo @ 2020-01-13  8:39 UTC (permalink / raw)
  To: guile-user; +Cc: guile-sources, guile-devel

We are pleased to announce GNU Guile release 2.9.9.  This is the ninfth
and probably final pre-release of what will eventually become the 3.0
release series.

Compared to the current stable series (2.2.x), the future Guile 3.0 adds
support for just-in-time native code generation, speeding up all Guile
programs.  See the NEWS extract at the end of the mail for full details.

Compared to the previous prerelease (2.9.7), Guile 2.9.8 fixes a number
of bugs.

The current plan is to make a 3.0.0 final release on 17 January 2020.
If there's nothing wrong with this prerelease, 3.0.0 will be essentially
identical to 2.9.9.  With that in mind, please test and make sure the
release works on your platform!  Please send any build reports (success
or failure) to guile-devel@gnu.org, along with platform details.  You
can file a bug by sending mail to bug-guile@gnu.org.

The Guile web page is located at http://gnu.org/software/guile/, and
among other things, it contains a copy of the Guile manual and pointers
to more resources.

Guile is an implementation of the Scheme programming language, packaged
for use in a wide variety of environments.  In addition to implementing
the R5RS, R6RS, and R7RS Scheme standards, Guile includes a module
system, full access to POSIX system calls, networking support, multiple
threads, dynamic linking, a foreign function call interface, powerful
string processing, and HTTP client and server implementations.

Guile can run interactively, as a script interpreter, and as a Scheme
compiler to VM bytecode.  It is also packaged as a library so that
applications can easily incorporate a complete Scheme interpreter/VM.
An application can use Guile as an extension language, a clean and
powerful configuration language, or as multi-purpose "glue" to connect
primitives provided by the application.  It is easy to call Scheme code
From C code and vice versa.  Applications can add new functions, data
types, control structures, and even syntax to Guile, to create a
domain-specific language tailored to the task at hand.

Guile 2.9.9 can be installed in parallel with Guile 2.2.x; see
http://www.gnu.org/software/guile/manual/html_node/Parallel-Installations.html.

A more detailed NEWS summary follows these details on how to get the
Guile sources.

Here are the compressed sources:
  http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.lz   (10MB)
  http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.xz   (12MB)
  http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.gz   (21MB)

Here are the GPG detached signatures[*]:
  http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.lz.sig
  http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.xz.sig
  http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.gz.sig

Use a mirror for higher download bandwidth:
  http://www.gnu.org/order/ftp.html

Here are the SHA256 checksums:

  59f136e5db36eba070cc5e68784e632dc2beae4b21fd6c7c8ed2c598cc992efc  guile-2.9.9.tar.lz
  bf71920cfa23e59fc6257bee84ef4dfeccf4f03e96bb8205592e09f9dbff2969  guile-2.9.9.tar.xz
  eafe394cf99d9dd1ab837e6d1b9b2b8d9f0cd13bc34e64ca92456ce1bc2b1925  guile-2.9.9.tar.gz

[*] Use a .sig file to verify that the corresponding file (without the
.sig suffix) is intact.  First, be sure to download both the .sig file
and the corresponding tarball.  Then, run a command like this:

  gpg --verify guile-2.9.9.tar.gz.sig

If that command fails because you don't have the required public key,
then run this command to import it:

  gpg --keyserver keys.gnupg.net --recv-keys 4FD4D288D445934E0A14F9A5A8803732E4436885

and rerun the 'gpg --verify' command.

This release was bootstrapped with the following tools:
  Autoconf 2.69
  Automake 1.16.1
  Libtool 2.4.6
  Gnulib v0.1-1157-gb03f418
  Makeinfo 6.7

An extract from NEWS follows.


Changes since alpha 2.9.8 (since 2.9.7):

* Notable changes

** `define-module' #:autoload no longer pulls in the whole module

One of the ways that a module can use another is "autoloads".  For
example:

  (define-module (a) #:autoload (b) (make-b))

In this example, module `(b)' will only be imported when the `make-b'
identifier is referenced.  However besides the imprecision about when a
given binding is actually referenced, this mechanism used to cause the
whole imported module to become available, not just the specified
bindings.  This has now been changed to only import the specified bindings.

This is a backward-incompatible change.  The fix is to mention all
bindings of interest in the autoload clause.  Feedback is welcome.

** `guard' no longer unwinds the stack for clause tests

SRFI-34, and then R6RS and R7RS, defines a `guard' form that is a
shorthand for `with-exception-handler'.  The cond-like clauses for the
exception handling are specified to run with the continuation of the
`guard', while any re-propagation of the exception happens with the
continuation of the original `raise'.

In practice, this means that one needs full `call-with-continuation' to
implement the specified semantics, to be able to unwind the stack to the
cond clauses, then rewind if none match.  This is not only quite
expensive, it is also error-prone as one usually doesn't want to rewind
dynamic-wind guards in an exceptional situation.  Additionally, as
continuations bind tightly to the current thread, it makes it impossible
to migrate a subcomputation with a different thread if a `guard' is live
on the stack, as is done in Fibers.

Guile now works around these issues by running the test portion of the
guard expressions within the original `raise' continuation, and only
unwinding once a test matches.  This is an incompatible semantic change
but we think the situation is globally much better, and we expect that
very few people will be affected by the change.

** Improve SRFI-43 vector-fill!

SRFI-43 vector-fill! now has the same performance whether an optional
range is provided or not, and is also provided in core.  As a side
effect, vector-fill! and vector_fill_x no longer work on non-vector
rank-1 arrays.  Such cases were handled incorrectly before; for example,
prior to this change:

  (define a (make-vector 10 'x))
  (define b (make-shared-array a (lambda (i) (list (* 2 i))) 5))
  (vector-fill! b 'y)

  => #1(y y y x x)

This is now an error.  Instead, use array-fill!.

** Fix compilation on 32-bit targets

A compile error introduced in 2.9.3 prevented compilation on 32-bit
targets.  This has been fixed.

** Fix a bug in closure conversion

Thanks for Stefan Israelsson Tampe for the report.

** Fix omission in R7RS support

Somewhat embarrassingly, the R7RS support added earlier in 2.9 failed to
include an implementation of `define-library'.  This oversight has been
corrected :)

** Optionally allow duplicate field names in core records

See the new #:allow-duplicate-field-names? keyword argument to
`make-record-type' in the manual, for more.  This restores a needed
feature to R6RS records.

** Fix default value of thread-local fluids

Before, `fluid-ref' on an unbound thread-local fluid was returning #f
instead of the default value of the fluid.  Thanks to Rob Browning for
the fix!


\f
Changes in alpha 2.9.x (since the stable 2.2 series):

* Notable changes

** Just-in-time code generation

Guile programs now run up to 4 times faster, relative to Guile 2.2,
thanks to just-in-time (JIT) native code generation.  Notably, this
brings the performance of "eval" as written in Scheme back to the level
of "eval" written in C, as in the days of Guile 1.8.

See "Just-In-Time Native Code" in the manual, for more information.  JIT
compilation will be enabled automatically and transparently.  To disable
JIT compilation, configure Guile with `--enable-jit=no' or
`--disable-jit'.  The default is `--enable-jit=auto', which enables the
JIT if it is available.  See `./configure --help' for more.

JIT compilation is enabled by default on x86-64, i686, ARMv7, and
AArch64 targets.

** Lower-level bytecode

Relative to the virtual machine in Guile 2.2, Guile's VM instruction set
is now more low-level.  This allows it to express more advanced
optimizations, for example type check elision or integer
devirtualization, and makes the task of JIT code generation easier.

Note that this change can mean that for a given function, the
corresponding number of instructions in Guile 3.0 may be higher than
Guile 2.2, which can lead to slowdowns when the function is interpreted.
We hope that JIT compilation more than makes up for this slight
slowdown.

** Interleaved internal definitions and expressions allowed

It used to be that internal definitions had to precede all expressions
in their bodies.  This restriction has been relaxed.  If an expression
precedes an internal definition, it is treated as if it were a
definition of an unreferenced variable.  For example, the expression
`(foo)' transforms to the equivalent of `(define _ (begin (foo) #f))',
if it precedes other definitions.

This change improves the readability of Guile programs, as it used to be
that program indentation tended to increase needlessly to allow nested
`let' and `letrec' to re-establish definition contexts after initial
expressions, for example for type-checks on procedure arguments.

** Record unification

Guile used to have a number of implementations of structured data types
in the form of "records": a core facility, SRFI-9 (records), SRFI-35
(condition types -- a form of records) and R6RS records.  These
facilities were not compatible, as they all were built in different
ways.  This had the unfortunate corollary that SRFI-35 conditions were
not compatible with R6RS conditions.  To fix this problem, we have now
added the union of functionality from all of these record types into
core records: single-inheritance subtyping, mutable and immutable
fields, and so on.  See "Records" in the manual, for full details.

R6RS records, SRFI-9 records, and the SRFI-35 and R6RS exception types
have been accordingly "rebased" on top of core records.

** Reimplementation of exceptions

Since Guile's origins 25 years ago, `throw' and `catch' have been the
primary exception-handling primitives.  However these primitives have
two problems.  One is that it's hard to handle exceptions in a
structured way using `catch'.  Few people remember what the
corresponding `key' and `args' are that an exception handler would see
in response to a call to `error', for example.  In practice, this
results in more generic catch-all exception handling than one might
like.

The other problem is that `throw', `catch', and especially
`with-throw-handler' are quite unlike what the rest of the Scheme world
uses.  R6RS and R7RS, for example, have mostly converged on
SRFI-34-style `with-exception-handler' and `raise' primitives, and
encourage the use of SRFI-35-style structured exception objects to
describe the error.  Guile's R6RS layer incorporates an adapter between
`throw'/`catch' and structured exception handling, but it didn't apply
to SRFI-34/SRFI-35, and we would have to duplicate it for R7RS.

In light of these considerations, Guile has now changed to make
`with-exception-handler' and `raise-exception' its primitives for
exception handling and defined a hierarchy of R6RS-style exception types
in its core.  SRFI-34/35, R6RS, and the exception-handling components of
SRFI-18 (threads) have been re-implemented in terms of this core
functionality.  There is also a a compatibility layer that makes it so
that exceptions originating in `throw' can be handled by
`with-exception-hander', and vice-versa for `raise-exception' and
`catch'.

Generally speaking, users will see no difference.  The one significant
difference is that users of SRFI-34 will see more exceptions flowing
through their `with-exception-handler'/`guard' forms, because whereas
before they would only see exceptions thrown by SRFI-34, now they will
see exceptions thrown by R6RS, R7RS, or indeed `throw'.

Guile's situation is transitional.  Most exceptions are still signalled
via `throw'.  These will probably migrate over time to
`raise-exception', while preserving compatibility of course.

See "Exceptions" in the manual, for full details on the new API.

** Optimization of top-level bindings within a compilation unit

At optimization level 2 and above, Guile's compiler is now allowed to
inline top-level definitions within a compilation unit.  See
"Declarative Modules" in the manual, for full details.  This change can
improve the performance of programs with many small top-level
definitions by quite a bit!

At optimization level 3 and above, Guile will assume that any top-level
binding in a declarative compilation unit that isn't exported from a
module can be completely inlined into its uses.  (Prior to this change,
-O3 was the same as -O2.)  Note that with this new
`seal-private-bindings' pass, private declarative bindings are no longer
available for access from the first-class module reflection API.  The
optimizations afforded by this pass can be useful when you need a speed
boost, but having them enabled at optimization level 3 means they are
not on by default, as they change Guile's behavior in ways that users
might not expect.

** By default, GOOPS classes are not redefinable

It used to be that all GOOPS classes were redefinable, at least in
theory.  This facility was supported by an indirection in all "struct"
instances, even though only a subset of structs would need redefinition.
We wanted to remove this indirection, in order to speed up Guile
records, allow immutable Guile records to eventually be described by
classes, and allow for some optimizations in core GOOPS classes that
shouldn't be redefined anyway.

Thus in GOOPS now there are classes that are redefinable and classes
that aren't.  By default, classes created with GOOPS are not
redefinable.  To make a class redefinable, it should be an instance of
`<redefinable-class>'.  See "Redefining a Class" in the manual for more
information.

** Define top-level bindings for aux syntax: `else', `=>', `...', `_'

These auxiliary syntax definitions are specified to be defined in the
R6RS and the R7RS.  They were previously unbound, even in the R6RS
modules.  This change is not anticipated to cause any incompatibility
with existing Guile code, and improves things for R6RS and R7RS users.

** Conventional gettext alias is now `G_'

Related to the last point, since the "Fix literal matching for
module-bound literals" change in the 2.2 series, it was no longer
possible to use the conventional `_' binding as an alias for `gettext',
because a local `_' definition would prevent `_' from being recognized
as auxiliary syntax for `match', `syntax-rules', and similar.  The new
recommended conventional alias for `gettext' is `G_'.

** Add --r6rs command-line option

The new `install-r6rs!' procedure adapts Guile's defaults to be more
R6RS-compatible.  This procedure is called if the user passes `--r6rs'
as a command-line argument.  See "R6RS Incompatibilities" in the manual,
for full details.

** Add support for R7RS

Thanks to Göran Weinholt and OKUMURA Yuki, Guile now implements the R7RS
modules.  As the R7RS library syntax is a subset of R6RS, to use R7RS
you just `(import (scheme base))' and off you go.  As with R6RS also,
there are some small lexical incompatibilities regarding hex escapes;
see "R6RS Support" in the manual, for full details.

Also as with R6RS, there is an `install-r7rs!' procedure and a `--r7rs'
command-line option.

** Add #:re-export-and-replace argument to `define-module'

This new keyword specifies a set of bindings to re-export, but also
marks them as intended to replace core bindings.  See "Creating Guile
Modules" in the manual, for full details.

Note to make this change, we had to change the way replacement flags are
stored, to being associated with modules instead of individual variable
objects.  This means that users who #:re-export an imported binding that
was already marked as #:replace by another module will now see warnings,
as they need to use #:re-export-and-replace instead.

** `iota' in core and SRFI-1 `iota' are the same

Previously, `iota' in core would not accept start and step arguments and
would return an empty list for negative count. Now there is only one
`iota' function with the extended semantics of SRFI-1.  Note that as an
incompatible change, core `iota' no longer accepts a negative count.

* New deprecations

** scm_t_uint8, etc deprecated in favor of C99 stdint.h

It used to be that Guile defined its own `scm_t_uint8' because C99
`uint8_t' wasn't widely enough available.  Now Guile finally made the
change to use C99 types, both internally and in Guile's public headers.

Note that this also applies to SCM_T_UINT8_MAX, SCM_T_INT8_MIN, for intN
and uintN for N in 8, 16, 32, and 64.  Guile also now uses ptrdiff_t
instead of scm_t_ptrdiff, and similarly for intmax_t, uintmax_t,
intptr_t, and uintptr_t.

** The two-argument form of `record-constructor'

Calling `record-constructor' with two arguments (the record type and a
list of field names) is deprecated.  Instead, call with just one
argument, and provide a wrapper around that constructor if needed.

* Incompatible changes

** All deprecated code removed

All code deprecated in Guile 2.2 has been removed.  See older NEWS, and
check that your programs can compile without linker warnings and run
without runtime warnings.  See "Deprecation" in the manual.

In particular, the function `scm_generalized_vector_get_handle' which
was deprecated in 2.0.9 but remained in 2.2, has now finally been
removed. As a replacement, use `scm_array_get_handle' to get a handle
and `scm_array_handle_rank' to check the rank.

** Remove "self" field from vtables and "redefined" field from classes

These fields were used as part of the machinery for class redefinition
and is no longer needed.

** VM hook manipulation simplified

The low-level mechanism to instrument a running virtual machine for
debugging and tracing has been simplified.  See "VM Hooks" in the
manual, for more.

* Changes to the distribution

** New effective version

The "effective version" of Guile is now 3.0, which allows parallel
installation with other effective versions (for example, the older Guile
2.2).  See "Parallel Installations" in the manual for full details.
Notably, the `pkg-config' file is now `guile-3.0', and there are new
`guile-3' and `guile-3.0' features for `cond-expand'.



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-13  8:39 Andy Wingo
@ 2020-01-13  8:44 ` Andy Wingo
  2020-01-13 17:26 ` John Cowan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 24+ messages in thread
From: Andy Wingo @ 2020-01-13  8:44 UTC (permalink / raw)
  To: guile-user; +Cc: guile-sources, guile-devel

On Mon 13 Jan 2020 09:39, Andy Wingo <wingo@pobox.com> writes:

> Compared to the previous prerelease (2.9.7), Guile 2.9.8 fixes a number
> of bugs.

Obviously this was meant to be 2.9.9 versus 2.9.8 :)

> Changes since alpha 2.9.8 (since 2.9.7):

Here too :)



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-13  8:39 Andy Wingo
  2020-01-13  8:44 ` Andy Wingo
@ 2020-01-13 17:26 ` John Cowan
  2020-01-13 21:32 ` Stefan Israelsson Tampe
  2020-01-14 20:13 ` Stefan Israelsson Tampe
  3 siblings, 0 replies; 24+ messages in thread
From: John Cowan @ 2020-01-13 17:26 UTC (permalink / raw)
  To: Andy Wingo; +Cc: bug-guile, guile-devel

[-- Attachment #1: Type: text/plain, Size: 1527 bytes --]

Guile 2.9.9, like .8 and .7, does not build on Cygwin (64 bit).  Configure
runs without error, but make crashes with this (truncated to just the tail):

Making all in bootstrap
make[2]: Entering directory
'/cygdrive/c/Users/rr828893/Downloads/guile-2.9.9/bootstrap'
  BOOTSTRAP GUILEC ice-9/eval.go
  BOOTSTRAP GUILEC ice-9/psyntax-pp.go
  BOOTSTRAP GUILEC language/cps/intmap.go
  BOOTSTRAP GUILEC language/cps/intset.go
  BOOTSTRAP GUILEC language/cps/graphs.go
  BOOTSTRAP GUILEC ice-9/vlist.go
  BOOTSTRAP GUILEC srfi/srfi-1.go
/bin/sh: line 6:  4294 Segmentation fault      (core dumped)
GUILE_AUTO_COMPILE=0 ../meta/build-env guild compile
--target="x86_64-unknown-cygwin" -O1 -Oresolve-primitives -L
"/home/rr828893/Downloads/guile-2.9.9/module" -L
"/home/rr828893/Downloads/guile-2.9.9/guile-readline" -o "srfi/srfi-1.go"
"../module/srfi/srfi-1.scm"
make[2]: *** [Makefile:1930: srfi/srfi-1.go] Error 139
make[2]: Leaving directory
'/cygdrive/c/Users/rr828893/Downloads/guile-2.9.9/bootstrap'
make[1]: *** [Makefile:1849: all-recursive] Error 1
make[1]: Leaving directory
'/cygdrive/c/Users/rr828893/Downloads/guile-2.9.9'
make: *** [Makefile:1735: all] Error 2

All previous problems (which were easy to work around) have gone away in
this release, which is progress, but it doesn't get me past Guile 2.2.



John Cowan          http://vrici.lojban.org/~cowan        cowan@ccil.org
Your worships will perhaps be thinking that it is an easy thing
to blow up a dog? [Or] to write a book?
    --Don Quixote, Introduction

[-- Attachment #2: Type: text/html, Size: 1905 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-13  8:39 Andy Wingo
  2020-01-13  8:44 ` Andy Wingo
  2020-01-13 17:26 ` John Cowan
@ 2020-01-13 21:32 ` Stefan Israelsson Tampe
  2020-01-13 21:33   ` Stefan Israelsson Tampe
                     ` (2 more replies)
  2020-01-14 20:13 ` Stefan Israelsson Tampe
  3 siblings, 3 replies; 24+ messages in thread
From: Stefan Israelsson Tampe @ 2020-01-13 21:32 UTC (permalink / raw)
  To: Andy Wingo; +Cc: Guile User, guile-sources, guile-devel

[-- Attachment #1: Type: text/plain, Size: 20572 bytes --]

Nice, but I think we are not there yet.

In current guile (eq? f f) = #f for a procedure f. Try:

(define-module (b)
  #:export (f))

(define (g x) x)
(define (u x) g)
(define (f x)
  (pk eq?    (eq?  g (u x)))
  (pk eqv?   (eqv? g (u x)))
  (pk equal? (equal? g (u x)))
  (pk (object-address g) (object-address (u x))))

scheme@(guile-user)> (use-modules (b))
;;; note: source file /home/stis/b.scm
;;;       newer than compiled
/home/stis/.cache/guile/ccache/3.0-LE-8-4.2/home/stis/
b.scm.go
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/stis/b.scm
;;; compiled /home/stis/.cache/guile/ccache/3.0-LE-8-4.2/home/stis/b.scm.go
scheme@(guile-user)> (f 1)

;;; (#<procedure eq? (#:optional _ _ . _)> #f)

;;; (#<procedure eqv? (#:optional _ _ . _)> #f)

;;; (#<procedure equal? (#:optional _ _ . _)> #f)

;;; (139824931374184 139824931374200)


On Mon, Jan 13, 2020 at 9:39 AM Andy Wingo <wingo@pobox.com> wrote:

> We are pleased to announce GNU Guile release 2.9.9.  This is the ninfth
> and probably final pre-release of what will eventually become the 3.0
> release series.
>
> Compared to the current stable series (2.2.x), the future Guile 3.0 adds
> support for just-in-time native code generation, speeding up all Guile
> programs.  See the NEWS extract at the end of the mail for full details.
>
> Compared to the previous prerelease (2.9.7), Guile 2.9.8 fixes a number
> of bugs.
>
> The current plan is to make a 3.0.0 final release on 17 January 2020.
> If there's nothing wrong with this prerelease, 3.0.0 will be essentially
> identical to 2.9.9.  With that in mind, please test and make sure the
> release works on your platform!  Please send any build reports (success
> or failure) to guile-devel@gnu.org, along with platform details.  You
> can file a bug by sending mail to bug-guile@gnu.org.
>
> The Guile web page is located at http://gnu.org/software/guile/, and
> among other things, it contains a copy of the Guile manual and pointers
> to more resources.
>
> Guile is an implementation of the Scheme programming language, packaged
> for use in a wide variety of environments.  In addition to implementing
> the R5RS, R6RS, and R7RS Scheme standards, Guile includes a module
> system, full access to POSIX system calls, networking support, multiple
> threads, dynamic linking, a foreign function call interface, powerful
> string processing, and HTTP client and server implementations.
>
> Guile can run interactively, as a script interpreter, and as a Scheme
> compiler to VM bytecode.  It is also packaged as a library so that
> applications can easily incorporate a complete Scheme interpreter/VM.
> An application can use Guile as an extension language, a clean and
> powerful configuration language, or as multi-purpose "glue" to connect
> primitives provided by the application.  It is easy to call Scheme code
> From C code and vice versa.  Applications can add new functions, data
> types, control structures, and even syntax to Guile, to create a
> domain-specific language tailored to the task at hand.
>
> Guile 2.9.9 can be installed in parallel with Guile 2.2.x; see
>
> http://www.gnu.org/software/guile/manual/html_node/Parallel-Installations.html
> .
>
> A more detailed NEWS summary follows these details on how to get the
> Guile sources.
>
> Here are the compressed sources:
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.lz   (10MB)
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.xz   (12MB)
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.gz   (21MB)
>
> Here are the GPG detached signatures[*]:
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.lz.sig
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.xz.sig
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.gz.sig
>
> Use a mirror for higher download bandwidth:
>   http://www.gnu.org/order/ftp.html
>
> Here are the SHA256 checksums:
>
>   59f136e5db36eba070cc5e68784e632dc2beae4b21fd6c7c8ed2c598cc992efc
> guile-2.9.9.tar.lz
>   bf71920cfa23e59fc6257bee84ef4dfeccf4f03e96bb8205592e09f9dbff2969
> guile-2.9.9.tar.xz
>   eafe394cf99d9dd1ab837e6d1b9b2b8d9f0cd13bc34e64ca92456ce1bc2b1925
> guile-2.9.9.tar.gz
>
> [*] Use a .sig file to verify that the corresponding file (without the
> .sig suffix) is intact.  First, be sure to download both the .sig file
> and the corresponding tarball.  Then, run a command like this:
>
>   gpg --verify guile-2.9.9.tar.gz.sig
>
> If that command fails because you don't have the required public key,
> then run this command to import it:
>
>   gpg --keyserver keys.gnupg.net --recv-keys
> 4FD4D288D445934E0A14F9A5A8803732E4436885
>
> and rerun the 'gpg --verify' command.
>
> This release was bootstrapped with the following tools:
>   Autoconf 2.69
>   Automake 1.16.1
>   Libtool 2.4.6
>   Gnulib v0.1-1157-gb03f418
>   Makeinfo 6.7
>
> An extract from NEWS follows.
>
>
> Changes since alpha 2.9.8 (since 2.9.7):
>
> * Notable changes
>
> ** `define-module' #:autoload no longer pulls in the whole module
>
> One of the ways that a module can use another is "autoloads".  For
> example:
>
>   (define-module (a) #:autoload (b) (make-b))
>
> In this example, module `(b)' will only be imported when the `make-b'
> identifier is referenced.  However besides the imprecision about when a
> given binding is actually referenced, this mechanism used to cause the
> whole imported module to become available, not just the specified
> bindings.  This has now been changed to only import the specified bindings.
>
> This is a backward-incompatible change.  The fix is to mention all
> bindings of interest in the autoload clause.  Feedback is welcome.
>
> ** `guard' no longer unwinds the stack for clause tests
>
> SRFI-34, and then R6RS and R7RS, defines a `guard' form that is a
> shorthand for `with-exception-handler'.  The cond-like clauses for the
> exception handling are specified to run with the continuation of the
> `guard', while any re-propagation of the exception happens with the
> continuation of the original `raise'.
>
> In practice, this means that one needs full `call-with-continuation' to
> implement the specified semantics, to be able to unwind the stack to the
> cond clauses, then rewind if none match.  This is not only quite
> expensive, it is also error-prone as one usually doesn't want to rewind
> dynamic-wind guards in an exceptional situation.  Additionally, as
> continuations bind tightly to the current thread, it makes it impossible
> to migrate a subcomputation with a different thread if a `guard' is live
> on the stack, as is done in Fibers.
>
> Guile now works around these issues by running the test portion of the
> guard expressions within the original `raise' continuation, and only
> unwinding once a test matches.  This is an incompatible semantic change
> but we think the situation is globally much better, and we expect that
> very few people will be affected by the change.
>
> ** Improve SRFI-43 vector-fill!
>
> SRFI-43 vector-fill! now has the same performance whether an optional
> range is provided or not, and is also provided in core.  As a side
> effect, vector-fill! and vector_fill_x no longer work on non-vector
> rank-1 arrays.  Such cases were handled incorrectly before; for example,
> prior to this change:
>
>   (define a (make-vector 10 'x))
>   (define b (make-shared-array a (lambda (i) (list (* 2 i))) 5))
>   (vector-fill! b 'y)
>
>   => #1(y y y x x)
>
> This is now an error.  Instead, use array-fill!.
>
> ** Fix compilation on 32-bit targets
>
> A compile error introduced in 2.9.3 prevented compilation on 32-bit
> targets.  This has been fixed.
>
> ** Fix a bug in closure conversion
>
> Thanks for Stefan Israelsson Tampe for the report.
>
> ** Fix omission in R7RS support
>
> Somewhat embarrassingly, the R7RS support added earlier in 2.9 failed to
> include an implementation of `define-library'.  This oversight has been
> corrected :)
>
> ** Optionally allow duplicate field names in core records
>
> See the new #:allow-duplicate-field-names? keyword argument to
> `make-record-type' in the manual, for more.  This restores a needed
> feature to R6RS records.
>
> ** Fix default value of thread-local fluids
>
> Before, `fluid-ref' on an unbound thread-local fluid was returning #f
> instead of the default value of the fluid.  Thanks to Rob Browning for
> the fix!
>
>
>
> Changes in alpha 2.9.x (since the stable 2.2 series):
>
> * Notable changes
>
> ** Just-in-time code generation
>
> Guile programs now run up to 4 times faster, relative to Guile 2.2,
> thanks to just-in-time (JIT) native code generation.  Notably, this
> brings the performance of "eval" as written in Scheme back to the level
> of "eval" written in C, as in the days of Guile 1.8.
>
> See "Just-In-Time Native Code" in the manual, for more information.  JIT
> compilation will be enabled automatically and transparently.  To disable
> JIT compilation, configure Guile with `--enable-jit=no' or
> `--disable-jit'.  The default is `--enable-jit=auto', which enables the
> JIT if it is available.  See `./configure --help' for more.
>
> JIT compilation is enabled by default on x86-64, i686, ARMv7, and
> AArch64 targets.
>
> ** Lower-level bytecode
>
> Relative to the virtual machine in Guile 2.2, Guile's VM instruction set
> is now more low-level.  This allows it to express more advanced
> optimizations, for example type check elision or integer
> devirtualization, and makes the task of JIT code generation easier.
>
> Note that this change can mean that for a given function, the
> corresponding number of instructions in Guile 3.0 may be higher than
> Guile 2.2, which can lead to slowdowns when the function is interpreted.
> We hope that JIT compilation more than makes up for this slight
> slowdown.
>
> ** Interleaved internal definitions and expressions allowed
>
> It used to be that internal definitions had to precede all expressions
> in their bodies.  This restriction has been relaxed.  If an expression
> precedes an internal definition, it is treated as if it were a
> definition of an unreferenced variable.  For example, the expression
> `(foo)' transforms to the equivalent of `(define _ (begin (foo) #f))',
> if it precedes other definitions.
>
> This change improves the readability of Guile programs, as it used to be
> that program indentation tended to increase needlessly to allow nested
> `let' and `letrec' to re-establish definition contexts after initial
> expressions, for example for type-checks on procedure arguments.
>
> ** Record unification
>
> Guile used to have a number of implementations of structured data types
> in the form of "records": a core facility, SRFI-9 (records), SRFI-35
> (condition types -- a form of records) and R6RS records.  These
> facilities were not compatible, as they all were built in different
> ways.  This had the unfortunate corollary that SRFI-35 conditions were
> not compatible with R6RS conditions.  To fix this problem, we have now
> added the union of functionality from all of these record types into
> core records: single-inheritance subtyping, mutable and immutable
> fields, and so on.  See "Records" in the manual, for full details.
>
> R6RS records, SRFI-9 records, and the SRFI-35 and R6RS exception types
> have been accordingly "rebased" on top of core records.
>
> ** Reimplementation of exceptions
>
> Since Guile's origins 25 years ago, `throw' and `catch' have been the
> primary exception-handling primitives.  However these primitives have
> two problems.  One is that it's hard to handle exceptions in a
> structured way using `catch'.  Few people remember what the
> corresponding `key' and `args' are that an exception handler would see
> in response to a call to `error', for example.  In practice, this
> results in more generic catch-all exception handling than one might
> like.
>
> The other problem is that `throw', `catch', and especially
> `with-throw-handler' are quite unlike what the rest of the Scheme world
> uses.  R6RS and R7RS, for example, have mostly converged on
> SRFI-34-style `with-exception-handler' and `raise' primitives, and
> encourage the use of SRFI-35-style structured exception objects to
> describe the error.  Guile's R6RS layer incorporates an adapter between
> `throw'/`catch' and structured exception handling, but it didn't apply
> to SRFI-34/SRFI-35, and we would have to duplicate it for R7RS.
>
> In light of these considerations, Guile has now changed to make
> `with-exception-handler' and `raise-exception' its primitives for
> exception handling and defined a hierarchy of R6RS-style exception types
> in its core.  SRFI-34/35, R6RS, and the exception-handling components of
> SRFI-18 (threads) have been re-implemented in terms of this core
> functionality.  There is also a a compatibility layer that makes it so
> that exceptions originating in `throw' can be handled by
> `with-exception-hander', and vice-versa for `raise-exception' and
> `catch'.
>
> Generally speaking, users will see no difference.  The one significant
> difference is that users of SRFI-34 will see more exceptions flowing
> through their `with-exception-handler'/`guard' forms, because whereas
> before they would only see exceptions thrown by SRFI-34, now they will
> see exceptions thrown by R6RS, R7RS, or indeed `throw'.
>
> Guile's situation is transitional.  Most exceptions are still signalled
> via `throw'.  These will probably migrate over time to
> `raise-exception', while preserving compatibility of course.
>
> See "Exceptions" in the manual, for full details on the new API.
>
> ** Optimization of top-level bindings within a compilation unit
>
> At optimization level 2 and above, Guile's compiler is now allowed to
> inline top-level definitions within a compilation unit.  See
> "Declarative Modules" in the manual, for full details.  This change can
> improve the performance of programs with many small top-level
> definitions by quite a bit!
>
> At optimization level 3 and above, Guile will assume that any top-level
> binding in a declarative compilation unit that isn't exported from a
> module can be completely inlined into its uses.  (Prior to this change,
> -O3 was the same as -O2.)  Note that with this new
> `seal-private-bindings' pass, private declarative bindings are no longer
> available for access from the first-class module reflection API.  The
> optimizations afforded by this pass can be useful when you need a speed
> boost, but having them enabled at optimization level 3 means they are
> not on by default, as they change Guile's behavior in ways that users
> might not expect.
>
> ** By default, GOOPS classes are not redefinable
>
> It used to be that all GOOPS classes were redefinable, at least in
> theory.  This facility was supported by an indirection in all "struct"
> instances, even though only a subset of structs would need redefinition.
> We wanted to remove this indirection, in order to speed up Guile
> records, allow immutable Guile records to eventually be described by
> classes, and allow for some optimizations in core GOOPS classes that
> shouldn't be redefined anyway.
>
> Thus in GOOPS now there are classes that are redefinable and classes
> that aren't.  By default, classes created with GOOPS are not
> redefinable.  To make a class redefinable, it should be an instance of
> `<redefinable-class>'.  See "Redefining a Class" in the manual for more
> information.
>
> ** Define top-level bindings for aux syntax: `else', `=>', `...', `_'
>
> These auxiliary syntax definitions are specified to be defined in the
> R6RS and the R7RS.  They were previously unbound, even in the R6RS
> modules.  This change is not anticipated to cause any incompatibility
> with existing Guile code, and improves things for R6RS and R7RS users.
>
> ** Conventional gettext alias is now `G_'
>
> Related to the last point, since the "Fix literal matching for
> module-bound literals" change in the 2.2 series, it was no longer
> possible to use the conventional `_' binding as an alias for `gettext',
> because a local `_' definition would prevent `_' from being recognized
> as auxiliary syntax for `match', `syntax-rules', and similar.  The new
> recommended conventional alias for `gettext' is `G_'.
>
> ** Add --r6rs command-line option
>
> The new `install-r6rs!' procedure adapts Guile's defaults to be more
> R6RS-compatible.  This procedure is called if the user passes `--r6rs'
> as a command-line argument.  See "R6RS Incompatibilities" in the manual,
> for full details.
>
> ** Add support for R7RS
>
> Thanks to Göran Weinholt and OKUMURA Yuki, Guile now implements the R7RS
> modules.  As the R7RS library syntax is a subset of R6RS, to use R7RS
> you just `(import (scheme base))' and off you go.  As with R6RS also,
> there are some small lexical incompatibilities regarding hex escapes;
> see "R6RS Support" in the manual, for full details.
>
> Also as with R6RS, there is an `install-r7rs!' procedure and a `--r7rs'
> command-line option.
>
> ** Add #:re-export-and-replace argument to `define-module'
>
> This new keyword specifies a set of bindings to re-export, but also
> marks them as intended to replace core bindings.  See "Creating Guile
> Modules" in the manual, for full details.
>
> Note to make this change, we had to change the way replacement flags are
> stored, to being associated with modules instead of individual variable
> objects.  This means that users who #:re-export an imported binding that
> was already marked as #:replace by another module will now see warnings,
> as they need to use #:re-export-and-replace instead.
>
> ** `iota' in core and SRFI-1 `iota' are the same
>
> Previously, `iota' in core would not accept start and step arguments and
> would return an empty list for negative count. Now there is only one
> `iota' function with the extended semantics of SRFI-1.  Note that as an
> incompatible change, core `iota' no longer accepts a negative count.
>
> * New deprecations
>
> ** scm_t_uint8, etc deprecated in favor of C99 stdint.h
>
> It used to be that Guile defined its own `scm_t_uint8' because C99
> `uint8_t' wasn't widely enough available.  Now Guile finally made the
> change to use C99 types, both internally and in Guile's public headers.
>
> Note that this also applies to SCM_T_UINT8_MAX, SCM_T_INT8_MIN, for intN
> and uintN for N in 8, 16, 32, and 64.  Guile also now uses ptrdiff_t
> instead of scm_t_ptrdiff, and similarly for intmax_t, uintmax_t,
> intptr_t, and uintptr_t.
>
> ** The two-argument form of `record-constructor'
>
> Calling `record-constructor' with two arguments (the record type and a
> list of field names) is deprecated.  Instead, call with just one
> argument, and provide a wrapper around that constructor if needed.
>
> * Incompatible changes
>
> ** All deprecated code removed
>
> All code deprecated in Guile 2.2 has been removed.  See older NEWS, and
> check that your programs can compile without linker warnings and run
> without runtime warnings.  See "Deprecation" in the manual.
>
> In particular, the function `scm_generalized_vector_get_handle' which
> was deprecated in 2.0.9 but remained in 2.2, has now finally been
> removed. As a replacement, use `scm_array_get_handle' to get a handle
> and `scm_array_handle_rank' to check the rank.
>
> ** Remove "self" field from vtables and "redefined" field from classes
>
> These fields were used as part of the machinery for class redefinition
> and is no longer needed.
>
> ** VM hook manipulation simplified
>
> The low-level mechanism to instrument a running virtual machine for
> debugging and tracing has been simplified.  See "VM Hooks" in the
> manual, for more.
>
> * Changes to the distribution
>
> ** New effective version
>
> The "effective version" of Guile is now 3.0, which allows parallel
> installation with other effective versions (for example, the older Guile
> 2.2).  See "Parallel Installations" in the manual for full details.
> Notably, the `pkg-config' file is now `guile-3.0', and there are new
> `guile-3' and `guile-3.0' features for `cond-expand'.
>
>

[-- Attachment #2: Type: text/html, Size: 23885 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-13 21:32 ` Stefan Israelsson Tampe
@ 2020-01-13 21:33   ` Stefan Israelsson Tampe
  2020-01-14  9:57   ` Stefan Israelsson Tampe
  2020-01-14 11:16   ` Andy Wingo
  2 siblings, 0 replies; 24+ messages in thread
From: Stefan Israelsson Tampe @ 2020-01-13 21:33 UTC (permalink / raw)
  To: Andy Wingo; +Cc: Guile User, guile-sources, guile-devel

[-- Attachment #1: Type: text/plain, Size: 21201 bytes --]

I mean that this bug is for 2.9.9

On Mon, Jan 13, 2020 at 10:32 PM Stefan Israelsson Tampe <
stefan.itampe@gmail.com> wrote:

> Nice, but I think we are not there yet.
>
> In current guile (eq? f f) = #f for a procedure f. Try:
>
> (define-module (b)
>   #:export (f))
>
> (define (g x) x)
> (define (u x) g)
> (define (f x)
>   (pk eq?    (eq?  g (u x)))
>   (pk eqv?   (eqv? g (u x)))
>   (pk equal? (equal? g (u x)))
>   (pk (object-address g) (object-address (u x))))
>
> scheme@(guile-user)> (use-modules (b))
> ;;; note: source file /home/stis/b.scm
> ;;;       newer than compiled
> /home/stis/.cache/guile/ccache/3.0-LE-8-4.2/home/stis/
> b.scm.go
> ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
> ;;;       or pass the --no-auto-compile argument to disable.
> ;;; compiling /home/stis/b.scm
> ;;; compiled
> /home/stis/.cache/guile/ccache/3.0-LE-8-4.2/home/stis/b.scm.go
> scheme@(guile-user)> (f 1)
>
> ;;; (#<procedure eq? (#:optional _ _ . _)> #f)
>
> ;;; (#<procedure eqv? (#:optional _ _ . _)> #f)
>
> ;;; (#<procedure equal? (#:optional _ _ . _)> #f)
>
> ;;; (139824931374184 139824931374200)
>
>
> On Mon, Jan 13, 2020 at 9:39 AM Andy Wingo <wingo@pobox.com> wrote:
>
>> We are pleased to announce GNU Guile release 2.9.9.  This is the ninfth
>> and probably final pre-release of what will eventually become the 3.0
>> release series.
>>
>> Compared to the current stable series (2.2.x), the future Guile 3.0 adds
>> support for just-in-time native code generation, speeding up all Guile
>> programs.  See the NEWS extract at the end of the mail for full details.
>>
>> Compared to the previous prerelease (2.9.7), Guile 2.9.8 fixes a number
>> of bugs.
>>
>> The current plan is to make a 3.0.0 final release on 17 January 2020.
>> If there's nothing wrong with this prerelease, 3.0.0 will be essentially
>> identical to 2.9.9.  With that in mind, please test and make sure the
>> release works on your platform!  Please send any build reports (success
>> or failure) to guile-devel@gnu.org, along with platform details.  You
>> can file a bug by sending mail to bug-guile@gnu.org.
>>
>> The Guile web page is located at http://gnu.org/software/guile/, and
>> among other things, it contains a copy of the Guile manual and pointers
>> to more resources.
>>
>> Guile is an implementation of the Scheme programming language, packaged
>> for use in a wide variety of environments.  In addition to implementing
>> the R5RS, R6RS, and R7RS Scheme standards, Guile includes a module
>> system, full access to POSIX system calls, networking support, multiple
>> threads, dynamic linking, a foreign function call interface, powerful
>> string processing, and HTTP client and server implementations.
>>
>> Guile can run interactively, as a script interpreter, and as a Scheme
>> compiler to VM bytecode.  It is also packaged as a library so that
>> applications can easily incorporate a complete Scheme interpreter/VM.
>> An application can use Guile as an extension language, a clean and
>> powerful configuration language, or as multi-purpose "glue" to connect
>> primitives provided by the application.  It is easy to call Scheme code
>> From C code and vice versa.  Applications can add new functions, data
>> types, control structures, and even syntax to Guile, to create a
>> domain-specific language tailored to the task at hand.
>>
>> Guile 2.9.9 can be installed in parallel with Guile 2.2.x; see
>>
>> http://www.gnu.org/software/guile/manual/html_node/Parallel-Installations.html
>> .
>>
>> A more detailed NEWS summary follows these details on how to get the
>> Guile sources.
>>
>> Here are the compressed sources:
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.lz   (10MB)
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.xz   (12MB)
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.gz   (21MB)
>>
>> Here are the GPG detached signatures[*]:
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.lz.sig
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.xz.sig
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.gz.sig
>>
>> Use a mirror for higher download bandwidth:
>>   http://www.gnu.org/order/ftp.html
>>
>> Here are the SHA256 checksums:
>>
>>   59f136e5db36eba070cc5e68784e632dc2beae4b21fd6c7c8ed2c598cc992efc
>> guile-2.9.9.tar.lz
>>   bf71920cfa23e59fc6257bee84ef4dfeccf4f03e96bb8205592e09f9dbff2969
>> guile-2.9.9.tar.xz
>>   eafe394cf99d9dd1ab837e6d1b9b2b8d9f0cd13bc34e64ca92456ce1bc2b1925
>> guile-2.9.9.tar.gz
>>
>> [*] Use a .sig file to verify that the corresponding file (without the
>> .sig suffix) is intact.  First, be sure to download both the .sig file
>> and the corresponding tarball.  Then, run a command like this:
>>
>>   gpg --verify guile-2.9.9.tar.gz.sig
>>
>> If that command fails because you don't have the required public key,
>> then run this command to import it:
>>
>>   gpg --keyserver keys.gnupg.net --recv-keys
>> 4FD4D288D445934E0A14F9A5A8803732E4436885
>>
>> and rerun the 'gpg --verify' command.
>>
>> This release was bootstrapped with the following tools:
>>   Autoconf 2.69
>>   Automake 1.16.1
>>   Libtool 2.4.6
>>   Gnulib v0.1-1157-gb03f418
>>   Makeinfo 6.7
>>
>> An extract from NEWS follows.
>>
>>
>> Changes since alpha 2.9.8 (since 2.9.7):
>>
>> * Notable changes
>>
>> ** `define-module' #:autoload no longer pulls in the whole module
>>
>> One of the ways that a module can use another is "autoloads".  For
>> example:
>>
>>   (define-module (a) #:autoload (b) (make-b))
>>
>> In this example, module `(b)' will only be imported when the `make-b'
>> identifier is referenced.  However besides the imprecision about when a
>> given binding is actually referenced, this mechanism used to cause the
>> whole imported module to become available, not just the specified
>> bindings.  This has now been changed to only import the specified
>> bindings.
>>
>> This is a backward-incompatible change.  The fix is to mention all
>> bindings of interest in the autoload clause.  Feedback is welcome.
>>
>> ** `guard' no longer unwinds the stack for clause tests
>>
>> SRFI-34, and then R6RS and R7RS, defines a `guard' form that is a
>> shorthand for `with-exception-handler'.  The cond-like clauses for the
>> exception handling are specified to run with the continuation of the
>> `guard', while any re-propagation of the exception happens with the
>> continuation of the original `raise'.
>>
>> In practice, this means that one needs full `call-with-continuation' to
>> implement the specified semantics, to be able to unwind the stack to the
>> cond clauses, then rewind if none match.  This is not only quite
>> expensive, it is also error-prone as one usually doesn't want to rewind
>> dynamic-wind guards in an exceptional situation.  Additionally, as
>> continuations bind tightly to the current thread, it makes it impossible
>> to migrate a subcomputation with a different thread if a `guard' is live
>> on the stack, as is done in Fibers.
>>
>> Guile now works around these issues by running the test portion of the
>> guard expressions within the original `raise' continuation, and only
>> unwinding once a test matches.  This is an incompatible semantic change
>> but we think the situation is globally much better, and we expect that
>> very few people will be affected by the change.
>>
>> ** Improve SRFI-43 vector-fill!
>>
>> SRFI-43 vector-fill! now has the same performance whether an optional
>> range is provided or not, and is also provided in core.  As a side
>> effect, vector-fill! and vector_fill_x no longer work on non-vector
>> rank-1 arrays.  Such cases were handled incorrectly before; for example,
>> prior to this change:
>>
>>   (define a (make-vector 10 'x))
>>   (define b (make-shared-array a (lambda (i) (list (* 2 i))) 5))
>>   (vector-fill! b 'y)
>>
>>   => #1(y y y x x)
>>
>> This is now an error.  Instead, use array-fill!.
>>
>> ** Fix compilation on 32-bit targets
>>
>> A compile error introduced in 2.9.3 prevented compilation on 32-bit
>> targets.  This has been fixed.
>>
>> ** Fix a bug in closure conversion
>>
>> Thanks for Stefan Israelsson Tampe for the report.
>>
>> ** Fix omission in R7RS support
>>
>> Somewhat embarrassingly, the R7RS support added earlier in 2.9 failed to
>> include an implementation of `define-library'.  This oversight has been
>> corrected :)
>>
>> ** Optionally allow duplicate field names in core records
>>
>> See the new #:allow-duplicate-field-names? keyword argument to
>> `make-record-type' in the manual, for more.  This restores a needed
>> feature to R6RS records.
>>
>> ** Fix default value of thread-local fluids
>>
>> Before, `fluid-ref' on an unbound thread-local fluid was returning #f
>> instead of the default value of the fluid.  Thanks to Rob Browning for
>> the fix!
>>
>>
>>
>> Changes in alpha 2.9.x (since the stable 2.2 series):
>>
>> * Notable changes
>>
>> ** Just-in-time code generation
>>
>> Guile programs now run up to 4 times faster, relative to Guile 2.2,
>> thanks to just-in-time (JIT) native code generation.  Notably, this
>> brings the performance of "eval" as written in Scheme back to the level
>> of "eval" written in C, as in the days of Guile 1.8.
>>
>> See "Just-In-Time Native Code" in the manual, for more information.  JIT
>> compilation will be enabled automatically and transparently.  To disable
>> JIT compilation, configure Guile with `--enable-jit=no' or
>> `--disable-jit'.  The default is `--enable-jit=auto', which enables the
>> JIT if it is available.  See `./configure --help' for more.
>>
>> JIT compilation is enabled by default on x86-64, i686, ARMv7, and
>> AArch64 targets.
>>
>> ** Lower-level bytecode
>>
>> Relative to the virtual machine in Guile 2.2, Guile's VM instruction set
>> is now more low-level.  This allows it to express more advanced
>> optimizations, for example type check elision or integer
>> devirtualization, and makes the task of JIT code generation easier.
>>
>> Note that this change can mean that for a given function, the
>> corresponding number of instructions in Guile 3.0 may be higher than
>> Guile 2.2, which can lead to slowdowns when the function is interpreted.
>> We hope that JIT compilation more than makes up for this slight
>> slowdown.
>>
>> ** Interleaved internal definitions and expressions allowed
>>
>> It used to be that internal definitions had to precede all expressions
>> in their bodies.  This restriction has been relaxed.  If an expression
>> precedes an internal definition, it is treated as if it were a
>> definition of an unreferenced variable.  For example, the expression
>> `(foo)' transforms to the equivalent of `(define _ (begin (foo) #f))',
>> if it precedes other definitions.
>>
>> This change improves the readability of Guile programs, as it used to be
>> that program indentation tended to increase needlessly to allow nested
>> `let' and `letrec' to re-establish definition contexts after initial
>> expressions, for example for type-checks on procedure arguments.
>>
>> ** Record unification
>>
>> Guile used to have a number of implementations of structured data types
>> in the form of "records": a core facility, SRFI-9 (records), SRFI-35
>> (condition types -- a form of records) and R6RS records.  These
>> facilities were not compatible, as they all were built in different
>> ways.  This had the unfortunate corollary that SRFI-35 conditions were
>> not compatible with R6RS conditions.  To fix this problem, we have now
>> added the union of functionality from all of these record types into
>> core records: single-inheritance subtyping, mutable and immutable
>> fields, and so on.  See "Records" in the manual, for full details.
>>
>> R6RS records, SRFI-9 records, and the SRFI-35 and R6RS exception types
>> have been accordingly "rebased" on top of core records.
>>
>> ** Reimplementation of exceptions
>>
>> Since Guile's origins 25 years ago, `throw' and `catch' have been the
>> primary exception-handling primitives.  However these primitives have
>> two problems.  One is that it's hard to handle exceptions in a
>> structured way using `catch'.  Few people remember what the
>> corresponding `key' and `args' are that an exception handler would see
>> in response to a call to `error', for example.  In practice, this
>> results in more generic catch-all exception handling than one might
>> like.
>>
>> The other problem is that `throw', `catch', and especially
>> `with-throw-handler' are quite unlike what the rest of the Scheme world
>> uses.  R6RS and R7RS, for example, have mostly converged on
>> SRFI-34-style `with-exception-handler' and `raise' primitives, and
>> encourage the use of SRFI-35-style structured exception objects to
>> describe the error.  Guile's R6RS layer incorporates an adapter between
>> `throw'/`catch' and structured exception handling, but it didn't apply
>> to SRFI-34/SRFI-35, and we would have to duplicate it for R7RS.
>>
>> In light of these considerations, Guile has now changed to make
>> `with-exception-handler' and `raise-exception' its primitives for
>> exception handling and defined a hierarchy of R6RS-style exception types
>> in its core.  SRFI-34/35, R6RS, and the exception-handling components of
>> SRFI-18 (threads) have been re-implemented in terms of this core
>> functionality.  There is also a a compatibility layer that makes it so
>> that exceptions originating in `throw' can be handled by
>> `with-exception-hander', and vice-versa for `raise-exception' and
>> `catch'.
>>
>> Generally speaking, users will see no difference.  The one significant
>> difference is that users of SRFI-34 will see more exceptions flowing
>> through their `with-exception-handler'/`guard' forms, because whereas
>> before they would only see exceptions thrown by SRFI-34, now they will
>> see exceptions thrown by R6RS, R7RS, or indeed `throw'.
>>
>> Guile's situation is transitional.  Most exceptions are still signalled
>> via `throw'.  These will probably migrate over time to
>> `raise-exception', while preserving compatibility of course.
>>
>> See "Exceptions" in the manual, for full details on the new API.
>>
>> ** Optimization of top-level bindings within a compilation unit
>>
>> At optimization level 2 and above, Guile's compiler is now allowed to
>> inline top-level definitions within a compilation unit.  See
>> "Declarative Modules" in the manual, for full details.  This change can
>> improve the performance of programs with many small top-level
>> definitions by quite a bit!
>>
>> At optimization level 3 and above, Guile will assume that any top-level
>> binding in a declarative compilation unit that isn't exported from a
>> module can be completely inlined into its uses.  (Prior to this change,
>> -O3 was the same as -O2.)  Note that with this new
>> `seal-private-bindings' pass, private declarative bindings are no longer
>> available for access from the first-class module reflection API.  The
>> optimizations afforded by this pass can be useful when you need a speed
>> boost, but having them enabled at optimization level 3 means they are
>> not on by default, as they change Guile's behavior in ways that users
>> might not expect.
>>
>> ** By default, GOOPS classes are not redefinable
>>
>> It used to be that all GOOPS classes were redefinable, at least in
>> theory.  This facility was supported by an indirection in all "struct"
>> instances, even though only a subset of structs would need redefinition.
>> We wanted to remove this indirection, in order to speed up Guile
>> records, allow immutable Guile records to eventually be described by
>> classes, and allow for some optimizations in core GOOPS classes that
>> shouldn't be redefined anyway.
>>
>> Thus in GOOPS now there are classes that are redefinable and classes
>> that aren't.  By default, classes created with GOOPS are not
>> redefinable.  To make a class redefinable, it should be an instance of
>> `<redefinable-class>'.  See "Redefining a Class" in the manual for more
>> information.
>>
>> ** Define top-level bindings for aux syntax: `else', `=>', `...', `_'
>>
>> These auxiliary syntax definitions are specified to be defined in the
>> R6RS and the R7RS.  They were previously unbound, even in the R6RS
>> modules.  This change is not anticipated to cause any incompatibility
>> with existing Guile code, and improves things for R6RS and R7RS users.
>>
>> ** Conventional gettext alias is now `G_'
>>
>> Related to the last point, since the "Fix literal matching for
>> module-bound literals" change in the 2.2 series, it was no longer
>> possible to use the conventional `_' binding as an alias for `gettext',
>> because a local `_' definition would prevent `_' from being recognized
>> as auxiliary syntax for `match', `syntax-rules', and similar.  The new
>> recommended conventional alias for `gettext' is `G_'.
>>
>> ** Add --r6rs command-line option
>>
>> The new `install-r6rs!' procedure adapts Guile's defaults to be more
>> R6RS-compatible.  This procedure is called if the user passes `--r6rs'
>> as a command-line argument.  See "R6RS Incompatibilities" in the manual,
>> for full details.
>>
>> ** Add support for R7RS
>>
>> Thanks to Göran Weinholt and OKUMURA Yuki, Guile now implements the R7RS
>> modules.  As the R7RS library syntax is a subset of R6RS, to use R7RS
>> you just `(import (scheme base))' and off you go.  As with R6RS also,
>> there are some small lexical incompatibilities regarding hex escapes;
>> see "R6RS Support" in the manual, for full details.
>>
>> Also as with R6RS, there is an `install-r7rs!' procedure and a `--r7rs'
>> command-line option.
>>
>> ** Add #:re-export-and-replace argument to `define-module'
>>
>> This new keyword specifies a set of bindings to re-export, but also
>> marks them as intended to replace core bindings.  See "Creating Guile
>> Modules" in the manual, for full details.
>>
>> Note to make this change, we had to change the way replacement flags are
>> stored, to being associated with modules instead of individual variable
>> objects.  This means that users who #:re-export an imported binding that
>> was already marked as #:replace by another module will now see warnings,
>> as they need to use #:re-export-and-replace instead.
>>
>> ** `iota' in core and SRFI-1 `iota' are the same
>>
>> Previously, `iota' in core would not accept start and step arguments and
>> would return an empty list for negative count. Now there is only one
>> `iota' function with the extended semantics of SRFI-1.  Note that as an
>> incompatible change, core `iota' no longer accepts a negative count.
>>
>> * New deprecations
>>
>> ** scm_t_uint8, etc deprecated in favor of C99 stdint.h
>>
>> It used to be that Guile defined its own `scm_t_uint8' because C99
>> `uint8_t' wasn't widely enough available.  Now Guile finally made the
>> change to use C99 types, both internally and in Guile's public headers.
>>
>> Note that this also applies to SCM_T_UINT8_MAX, SCM_T_INT8_MIN, for intN
>> and uintN for N in 8, 16, 32, and 64.  Guile also now uses ptrdiff_t
>> instead of scm_t_ptrdiff, and similarly for intmax_t, uintmax_t,
>> intptr_t, and uintptr_t.
>>
>> ** The two-argument form of `record-constructor'
>>
>> Calling `record-constructor' with two arguments (the record type and a
>> list of field names) is deprecated.  Instead, call with just one
>> argument, and provide a wrapper around that constructor if needed.
>>
>> * Incompatible changes
>>
>> ** All deprecated code removed
>>
>> All code deprecated in Guile 2.2 has been removed.  See older NEWS, and
>> check that your programs can compile without linker warnings and run
>> without runtime warnings.  See "Deprecation" in the manual.
>>
>> In particular, the function `scm_generalized_vector_get_handle' which
>> was deprecated in 2.0.9 but remained in 2.2, has now finally been
>> removed. As a replacement, use `scm_array_get_handle' to get a handle
>> and `scm_array_handle_rank' to check the rank.
>>
>> ** Remove "self" field from vtables and "redefined" field from classes
>>
>> These fields were used as part of the machinery for class redefinition
>> and is no longer needed.
>>
>> ** VM hook manipulation simplified
>>
>> The low-level mechanism to instrument a running virtual machine for
>> debugging and tracing has been simplified.  See "VM Hooks" in the
>> manual, for more.
>>
>> * Changes to the distribution
>>
>> ** New effective version
>>
>> The "effective version" of Guile is now 3.0, which allows parallel
>> installation with other effective versions (for example, the older Guile
>> 2.2).  See "Parallel Installations" in the manual for full details.
>> Notably, the `pkg-config' file is now `guile-3.0', and there are new
>> `guile-3' and `guile-3.0' features for `cond-expand'.
>>
>>

[-- Attachment #2: Type: text/html, Size: 24310 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-13 21:32 ` Stefan Israelsson Tampe
  2020-01-13 21:33   ` Stefan Israelsson Tampe
@ 2020-01-14  9:57   ` Stefan Israelsson Tampe
  2020-01-14 11:16   ` Andy Wingo
  2 siblings, 0 replies; 24+ messages in thread
From: Stefan Israelsson Tampe @ 2020-01-14  9:57 UTC (permalink / raw)
  To: Andy Wingo; +Cc: Guile User, guile-sources, guile-devel

Note that the problem I have is that procedure-property and hash-table code
with procedure key's fail on me due to the fact that the identity of
functions varies in a non clear way.


On Mon, Jan 13, 2020 at 10:32 PM Stefan Israelsson Tampe <
stefan.itampe@gmail.com> wrote:

> Nice, but I think we are not there yet.
>
> In current guile (eq? f f) = #f for a procedure f. Try:
>
> (define-module (b)
>   #:export (f))
>
> (define (g x) x)
> (define (u x) g)
> (define (f x)
>   (pk eq?    (eq?  g (u x)))
>   (pk eqv?   (eqv? g (u x)))
>   (pk equal? (equal? g (u x)))
>   (pk (object-address g) (object-address (u x))))
>
> scheme@(guile-user)> (use-modules (b))
> ;;; note: source file /home/stis/b.scm
> ;;;       newer than compiled
> /home/stis/.cache/guile/ccache/3.0-LE-8-4.2/home/stis/
> b.scm.go
> ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
> ;;;       or pass the --no-auto-compile argument to disable.
> ;;; compiling /home/stis/b.scm
> ;;; compiled
> /home/stis/.cache/guile/ccache/3.0-LE-8-4.2/home/stis/b.scm.go
> scheme@(guile-user)> (f 1)
>
> ;;; (#<procedure eq? (#:optional _ _ . _)> #f)
>
> ;;; (#<procedure eqv? (#:optional _ _ . _)> #f)
>
> ;;; (#<procedure equal? (#:optional _ _ . _)> #f)
>
> ;;; (139824931374184 139824931374200)
>
>
> On Mon, Jan 13, 2020 at 9:39 AM Andy Wingo <wingo@pobox.com> wrote:
>
>> We are pleased to announce GNU Guile release 2.9.9.  This is the ninfth
>> and probably final pre-release of what will eventually become the 3.0
>> release series.
>>
>> Compared to the current stable series (2.2.x), the future Guile 3.0 adds
>> support for just-in-time native code generation, speeding up all Guile
>> programs.  See the NEWS extract at the end of the mail for full details.
>>
>> Compared to the previous prerelease (2.9.7), Guile 2.9.8 fixes a number
>> of bugs.
>>
>> The current plan is to make a 3.0.0 final release on 17 January 2020.
>> If there's nothing wrong with this prerelease, 3.0.0 will be essentially
>> identical to 2.9.9.  With that in mind, please test and make sure the
>> release works on your platform!  Please send any build reports (success
>> or failure) to guile-devel@gnu.org, along with platform details.  You
>> can file a bug by sending mail to bug-guile@gnu.org.
>>
>> The Guile web page is located at http://gnu.org/software/guile/, and
>> among other things, it contains a copy of the Guile manual and pointers
>> to more resources.
>>
>> Guile is an implementation of the Scheme programming language, packaged
>> for use in a wide variety of environments.  In addition to implementing
>> the R5RS, R6RS, and R7RS Scheme standards, Guile includes a module
>> system, full access to POSIX system calls, networking support, multiple
>> threads, dynamic linking, a foreign function call interface, powerful
>> string processing, and HTTP client and server implementations.
>>
>> Guile can run interactively, as a script interpreter, and as a Scheme
>> compiler to VM bytecode.  It is also packaged as a library so that
>> applications can easily incorporate a complete Scheme interpreter/VM.
>> An application can use Guile as an extension language, a clean and
>> powerful configuration language, or as multi-purpose "glue" to connect
>> primitives provided by the application.  It is easy to call Scheme code
>> From C code and vice versa.  Applications can add new functions, data
>> types, control structures, and even syntax to Guile, to create a
>> domain-specific language tailored to the task at hand.
>>
>> Guile 2.9.9 can be installed in parallel with Guile 2.2.x; see
>>
>> http://www.gnu.org/software/guile/manual/html_node/Parallel-Installations.html
>> .
>>
>> A more detailed NEWS summary follows these details on how to get the
>> Guile sources.
>>
>> Here are the compressed sources:
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.lz   (10MB)
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.xz   (12MB)
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.gz   (21MB)
>>
>> Here are the GPG detached signatures[*]:
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.lz.sig
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.xz.sig
>>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.gz.sig
>>
>> Use a mirror for higher download bandwidth:
>>   http://www.gnu.org/order/ftp.html
>>
>> Here are the SHA256 checksums:
>>
>>   59f136e5db36eba070cc5e68784e632dc2beae4b21fd6c7c8ed2c598cc992efc
>> guile-2.9.9.tar.lz
>>   bf71920cfa23e59fc6257bee84ef4dfeccf4f03e96bb8205592e09f9dbff2969
>> guile-2.9.9.tar.xz
>>   eafe394cf99d9dd1ab837e6d1b9b2b8d9f0cd13bc34e64ca92456ce1bc2b1925
>> guile-2.9.9.tar.gz
>>
>> [*] Use a .sig file to verify that the corresponding file (without the
>> .sig suffix) is intact.  First, be sure to download both the .sig file
>> and the corresponding tarball.  Then, run a command like this:
>>
>>   gpg --verify guile-2.9.9.tar.gz.sig
>>
>> If that command fails because you don't have the required public key,
>> then run this command to import it:
>>
>>   gpg --keyserver keys.gnupg.net --recv-keys
>> 4FD4D288D445934E0A14F9A5A8803732E4436885
>>
>> and rerun the 'gpg --verify' command.
>>
>> This release was bootstrapped with the following tools:
>>   Autoconf 2.69
>>   Automake 1.16.1
>>   Libtool 2.4.6
>>   Gnulib v0.1-1157-gb03f418
>>   Makeinfo 6.7
>>
>> An extract from NEWS follows.
>>
>>
>> Changes since alpha 2.9.8 (since 2.9.7):
>>
>> * Notable changes
>>
>> ** `define-module' #:autoload no longer pulls in the whole module
>>
>> One of the ways that a module can use another is "autoloads".  For
>> example:
>>
>>   (define-module (a) #:autoload (b) (make-b))
>>
>> In this example, module `(b)' will only be imported when the `make-b'
>> identifier is referenced.  However besides the imprecision about when a
>> given binding is actually referenced, this mechanism used to cause the
>> whole imported module to become available, not just the specified
>> bindings.  This has now been changed to only import the specified
>> bindings.
>>
>> This is a backward-incompatible change.  The fix is to mention all
>> bindings of interest in the autoload clause.  Feedback is welcome.
>>
>> ** `guard' no longer unwinds the stack for clause tests
>>
>> SRFI-34, and then R6RS and R7RS, defines a `guard' form that is a
>> shorthand for `with-exception-handler'.  The cond-like clauses for the
>> exception handling are specified to run with the continuation of the
>> `guard', while any re-propagation of the exception happens with the
>> continuation of the original `raise'.
>>
>> In practice, this means that one needs full `call-with-continuation' to
>> implement the specified semantics, to be able to unwind the stack to the
>> cond clauses, then rewind if none match.  This is not only quite
>> expensive, it is also error-prone as one usually doesn't want to rewind
>> dynamic-wind guards in an exceptional situation.  Additionally, as
>> continuations bind tightly to the current thread, it makes it impossible
>> to migrate a subcomputation with a different thread if a `guard' is live
>> on the stack, as is done in Fibers.
>>
>> Guile now works around these issues by running the test portion of the
>> guard expressions within the original `raise' continuation, and only
>> unwinding once a test matches.  This is an incompatible semantic change
>> but we think the situation is globally much better, and we expect that
>> very few people will be affected by the change.
>>
>> ** Improve SRFI-43 vector-fill!
>>
>> SRFI-43 vector-fill! now has the same performance whether an optional
>> range is provided or not, and is also provided in core.  As a side
>> effect, vector-fill! and vector_fill_x no longer work on non-vector
>> rank-1 arrays.  Such cases were handled incorrectly before; for example,
>> prior to this change:
>>
>>   (define a (make-vector 10 'x))
>>   (define b (make-shared-array a (lambda (i) (list (* 2 i))) 5))
>>   (vector-fill! b 'y)
>>
>>   => #1(y y y x x)
>>
>> This is now an error.  Instead, use array-fill!.
>>
>> ** Fix compilation on 32-bit targets
>>
>> A compile error introduced in 2.9.3 prevented compilation on 32-bit
>> targets.  This has been fixed.
>>
>> ** Fix a bug in closure conversion
>>
>> Thanks for Stefan Israelsson Tampe for the report.
>>
>> ** Fix omission in R7RS support
>>
>> Somewhat embarrassingly, the R7RS support added earlier in 2.9 failed to
>> include an implementation of `define-library'.  This oversight has been
>> corrected :)
>>
>> ** Optionally allow duplicate field names in core records
>>
>> See the new #:allow-duplicate-field-names? keyword argument to
>> `make-record-type' in the manual, for more.  This restores a needed
>> feature to R6RS records.
>>
>> ** Fix default value of thread-local fluids
>>
>> Before, `fluid-ref' on an unbound thread-local fluid was returning #f
>> instead of the default value of the fluid.  Thanks to Rob Browning for
>> the fix!
>>
>>
>>
>> Changes in alpha 2.9.x (since the stable 2.2 series):
>>
>> * Notable changes
>>
>> ** Just-in-time code generation
>>
>> Guile programs now run up to 4 times faster, relative to Guile 2.2,
>> thanks to just-in-time (JIT) native code generation.  Notably, this
>> brings the performance of "eval" as written in Scheme back to the level
>> of "eval" written in C, as in the days of Guile 1.8.
>>
>> See "Just-In-Time Native Code" in the manual, for more information.  JIT
>> compilation will be enabled automatically and transparently.  To disable
>> JIT compilation, configure Guile with `--enable-jit=no' or
>> `--disable-jit'.  The default is `--enable-jit=auto', which enables the
>> JIT if it is available.  See `./configure --help' for more.
>>
>> JIT compilation is enabled by default on x86-64, i686, ARMv7, and
>> AArch64 targets.
>>
>> ** Lower-level bytecode
>>
>> Relative to the virtual machine in Guile 2.2, Guile's VM instruction set
>> is now more low-level.  This allows it to express more advanced
>> optimizations, for example type check elision or integer
>> devirtualization, and makes the task of JIT code generation easier.
>>
>> Note that this change can mean that for a given function, the
>> corresponding number of instructions in Guile 3.0 may be higher than
>> Guile 2.2, which can lead to slowdowns when the function is interpreted.
>> We hope that JIT compilation more than makes up for this slight
>> slowdown.
>>
>> ** Interleaved internal definitions and expressions allowed
>>
>> It used to be that internal definitions had to precede all expressions
>> in their bodies.  This restriction has been relaxed.  If an expression
>> precedes an internal definition, it is treated as if it were a
>> definition of an unreferenced variable.  For example, the expression
>> `(foo)' transforms to the equivalent of `(define _ (begin (foo) #f))',
>> if it precedes other definitions.
>>
>> This change improves the readability of Guile programs, as it used to be
>> that program indentation tended to increase needlessly to allow nested
>> `let' and `letrec' to re-establish definition contexts after initial
>> expressions, for example for type-checks on procedure arguments.
>>
>> ** Record unification
>>
>> Guile used to have a number of implementations of structured data types
>> in the form of "records": a core facility, SRFI-9 (records), SRFI-35
>> (condition types -- a form of records) and R6RS records.  These
>> facilities were not compatible, as they all were built in different
>> ways.  This had the unfortunate corollary that SRFI-35 conditions were
>> not compatible with R6RS conditions.  To fix this problem, we have now
>> added the union of functionality from all of these record types into
>> core records: single-inheritance subtyping, mutable and immutable
>> fields, and so on.  See "Records" in the manual, for full details.
>>
>> R6RS records, SRFI-9 records, and the SRFI-35 and R6RS exception types
>> have been accordingly "rebased" on top of core records.
>>
>> ** Reimplementation of exceptions
>>
>> Since Guile's origins 25 years ago, `throw' and `catch' have been the
>> primary exception-handling primitives.  However these primitives have
>> two problems.  One is that it's hard to handle exceptions in a
>> structured way using `catch'.  Few people remember what the
>> corresponding `key' and `args' are that an exception handler would see
>> in response to a call to `error', for example.  In practice, this
>> results in more generic catch-all exception handling than one might
>> like.
>>
>> The other problem is that `throw', `catch', and especially
>> `with-throw-handler' are quite unlike what the rest of the Scheme world
>> uses.  R6RS and R7RS, for example, have mostly converged on
>> SRFI-34-style `with-exception-handler' and `raise' primitives, and
>> encourage the use of SRFI-35-style structured exception objects to
>> describe the error.  Guile's R6RS layer incorporates an adapter between
>> `throw'/`catch' and structured exception handling, but it didn't apply
>> to SRFI-34/SRFI-35, and we would have to duplicate it for R7RS.
>>
>> In light of these considerations, Guile has now changed to make
>> `with-exception-handler' and `raise-exception' its primitives for
>> exception handling and defined a hierarchy of R6RS-style exception types
>> in its core.  SRFI-34/35, R6RS, and the exception-handling components of
>> SRFI-18 (threads) have been re-implemented in terms of this core
>> functionality.  There is also a a compatibility layer that makes it so
>> that exceptions originating in `throw' can be handled by
>> `with-exception-hander', and vice-versa for `raise-exception' and
>> `catch'.
>>
>> Generally speaking, users will see no difference.  The one significant
>> difference is that users of SRFI-34 will see more exceptions flowing
>> through their `with-exception-handler'/`guard' forms, because whereas
>> before they would only see exceptions thrown by SRFI-34, now they will
>> see exceptions thrown by R6RS, R7RS, or indeed `throw'.
>>
>> Guile's situation is transitional.  Most exceptions are still signalled
>> via `throw'.  These will probably migrate over time to
>> `raise-exception', while preserving compatibility of course.
>>
>> See "Exceptions" in the manual, for full details on the new API.
>>
>> ** Optimization of top-level bindings within a compilation unit
>>
>> At optimization level 2 and above, Guile's compiler is now allowed to
>> inline top-level definitions within a compilation unit.  See
>> "Declarative Modules" in the manual, for full details.  This change can
>> improve the performance of programs with many small top-level
>> definitions by quite a bit!
>>
>> At optimization level 3 and above, Guile will assume that any top-level
>> binding in a declarative compilation unit that isn't exported from a
>> module can be completely inlined into its uses.  (Prior to this change,
>> -O3 was the same as -O2.)  Note that with this new
>> `seal-private-bindings' pass, private declarative bindings are no longer
>> available for access from the first-class module reflection API.  The
>> optimizations afforded by this pass can be useful when you need a speed
>> boost, but having them enabled at optimization level 3 means they are
>> not on by default, as they change Guile's behavior in ways that users
>> might not expect.
>>
>> ** By default, GOOPS classes are not redefinable
>>
>> It used to be that all GOOPS classes were redefinable, at least in
>> theory.  This facility was supported by an indirection in all "struct"
>> instances, even though only a subset of structs would need redefinition.
>> We wanted to remove this indirection, in order to speed up Guile
>> records, allow immutable Guile records to eventually be described by
>> classes, and allow for some optimizations in core GOOPS classes that
>> shouldn't be redefined anyway.
>>
>> Thus in GOOPS now there are classes that are redefinable and classes
>> that aren't.  By default, classes created with GOOPS are not
>> redefinable.  To make a class redefinable, it should be an instance of
>> `<redefinable-class>'.  See "Redefining a Class" in the manual for more
>> information.
>>
>> ** Define top-level bindings for aux syntax: `else', `=>', `...', `_'
>>
>> These auxiliary syntax definitions are specified to be defined in the
>> R6RS and the R7RS.  They were previously unbound, even in the R6RS
>> modules.  This change is not anticipated to cause any incompatibility
>> with existing Guile code, and improves things for R6RS and R7RS users.
>>
>> ** Conventional gettext alias is now `G_'
>>
>> Related to the last point, since the "Fix literal matching for
>> module-bound literals" change in the 2.2 series, it was no longer
>> possible to use the conventional `_' binding as an alias for `gettext',
>> because a local `_' definition would prevent `_' from being recognized
>> as auxiliary syntax for `match', `syntax-rules', and similar.  The new
>> recommended conventional alias for `gettext' is `G_'.
>>
>> ** Add --r6rs command-line option
>>
>> The new `install-r6rs!' procedure adapts Guile's defaults to be more
>> R6RS-compatible.  This procedure is called if the user passes `--r6rs'
>> as a command-line argument.  See "R6RS Incompatibilities" in the manual,
>> for full details.
>>
>> ** Add support for R7RS
>>
>> Thanks to Göran Weinholt and OKUMURA Yuki, Guile now implements the R7RS
>> modules.  As the R7RS library syntax is a subset of R6RS, to use R7RS
>> you just `(import (scheme base))' and off you go.  As with R6RS also,
>> there are some small lexical incompatibilities regarding hex escapes;
>> see "R6RS Support" in the manual, for full details.
>>
>> Also as with R6RS, there is an `install-r7rs!' procedure and a `--r7rs'
>> command-line option.
>>
>> ** Add #:re-export-and-replace argument to `define-module'
>>
>> This new keyword specifies a set of bindings to re-export, but also
>> marks them as intended to replace core bindings.  See "Creating Guile
>> Modules" in the manual, for full details.
>>
>> Note to make this change, we had to change the way replacement flags are
>> stored, to being associated with modules instead of individual variable
>> objects.  This means that users who #:re-export an imported binding that
>> was already marked as #:replace by another module will now see warnings,
>> as they need to use #:re-export-and-replace instead.
>>
>> ** `iota' in core and SRFI-1 `iota' are the same
>>
>> Previously, `iota' in core would not accept start and step arguments and
>> would return an empty list for negative count. Now there is only one
>> `iota' function with the extended semantics of SRFI-1.  Note that as an
>> incompatible change, core `iota' no longer accepts a negative count.
>>
>> * New deprecations
>>
>> ** scm_t_uint8, etc deprecated in favor of C99 stdint.h
>>
>> It used to be that Guile defined its own `scm_t_uint8' because C99
>> `uint8_t' wasn't widely enough available.  Now Guile finally made the
>> change to use C99 types, both internally and in Guile's public headers.
>>
>> Note that this also applies to SCM_T_UINT8_MAX, SCM_T_INT8_MIN, for intN
>> and uintN for N in 8, 16, 32, and 64.  Guile also now uses ptrdiff_t
>> instead of scm_t_ptrdiff, and similarly for intmax_t, uintmax_t,
>> intptr_t, and uintptr_t.
>>
>> ** The two-argument form of `record-constructor'
>>
>> Calling `record-constructor' with two arguments (the record type and a
>> list of field names) is deprecated.  Instead, call with just one
>> argument, and provide a wrapper around that constructor if needed.
>>
>> * Incompatible changes
>>
>> ** All deprecated code removed
>>
>> All code deprecated in Guile 2.2 has been removed.  See older NEWS, and
>> check that your programs can compile without linker warnings and run
>> without runtime warnings.  See "Deprecation" in the manual.
>>
>> In particular, the function `scm_generalized_vector_get_handle' which
>> was deprecated in 2.0.9 but remained in 2.2, has now finally been
>> removed. As a replacement, use `scm_array_get_handle' to get a handle
>> and `scm_array_handle_rank' to check the rank.
>>
>> ** Remove "self" field from vtables and "redefined" field from classes
>>
>> These fields were used as part of the machinery for class redefinition
>> and is no longer needed.
>>
>> ** VM hook manipulation simplified
>>
>> The low-level mechanism to instrument a running virtual machine for
>> debugging and tracing has been simplified.  See "VM Hooks" in the
>> manual, for more.
>>
>> * Changes to the distribution
>>
>> ** New effective version
>>
>> The "effective version" of Guile is now 3.0, which allows parallel
>> installation with other effective versions (for example, the older Guile
>> 2.2).  See "Parallel Installations" in the manual for full details.
>> Notably, the `pkg-config' file is now `guile-3.0', and there are new
>> `guile-3' and `guile-3.0' features for `cond-expand'.
>>
>>


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-13 21:32 ` Stefan Israelsson Tampe
  2020-01-13 21:33   ` Stefan Israelsson Tampe
  2020-01-14  9:57   ` Stefan Israelsson Tampe
@ 2020-01-14 11:16   ` Andy Wingo
  2020-01-14 12:18     ` Mikael Djurfeldt
  2 siblings, 1 reply; 24+ messages in thread
From: Andy Wingo @ 2020-01-14 11:16 UTC (permalink / raw)
  To: Stefan Israelsson Tampe; +Cc: guile-devel

On Mon 13 Jan 2020 22:32, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:

> In current guile (eq? f f) = #f for a procedure f. Try:

Note that procedure equality is explicitly unspecified by R6RS.  Guile's
declarative modules optimization took advantage of this to eta-expand
references to declaratively-bound top-level lambda expressions.  This
unlocks the "well-known" closure optimizations: closure elision,
contification, and so on.

However, the intention with the eta expansion was really to prevent the

  (module-add! mod 'foo foo)

from making the procedure not-well-known.  If that's the only reference
to `foo' outside the operator position, procedure identity for `foo' is
kept, because it's only accessed outside the module.  But then I
realized thanks to your mail (and the three or four times that people
stumbled against this beforehand) that we can preserve the optimizations
and peoples' intuitions about procedure equality if we restrict
eta-expansion to those procedures that are only referenced by value in
at most a single position.

It would be best to implement the eta-expansion after peval; doing it
where we do leaves some optimization opportunities on the table.  But I
have implemented this change in git and it should fix this issue.

Comparative benchmark results:

  https://wingolog.org/pub/guile-2.9.7-vs-guile-2.9.9-with-eq-change-microbenchmarks.png

Regards,

Andy



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 11:16   ` Andy Wingo
@ 2020-01-14 12:18     ` Mikael Djurfeldt
  2020-01-14 13:25       ` Stefan Israelsson Tampe
  2020-01-14 14:32       ` Andy Wingo
  0 siblings, 2 replies; 24+ messages in thread
From: Mikael Djurfeldt @ 2020-01-14 12:18 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 2232 bytes --]

Dear Andy,

I probably don't have a clue about what you are talking about (or at least
hope so), but this---the "eq change"---sounds scary to me.

One of the *strengths* of Scheme is that procedures are first class
citizens. As wonderfully show-cased in e.g. SICP this can be used to obtain
expressive and concise programs, where procedures can occur many times as
values outside operator position.

I would certainly *not* want to trade in an important optimization step in
those cases to obtain intuitive procedure equality. The risk is then that
you would tend to avoid passing around procedures as values.

Have I misunderstood something or do I have a point here?

Best regards,
Mikael

Den tis 14 jan. 2020 12:18Andy Wingo <wingo@pobox.com> skrev:

> On Mon 13 Jan 2020 22:32, Stefan Israelsson Tampe <stefan.itampe@gmail.com>
> writes:
>
> > In current guile (eq? f f) = #f for a procedure f. Try:
>
> Note that procedure equality is explicitly unspecified by R6RS.  Guile's
> declarative modules optimization took advantage of this to eta-expand
> references to declaratively-bound top-level lambda expressions.  This
> unlocks the "well-known" closure optimizations: closure elision,
> contification, and so on.
>
> However, the intention with the eta expansion was really to prevent the
>
>   (module-add! mod 'foo foo)
>
> from making the procedure not-well-known.  If that's the only reference
> to `foo' outside the operator position, procedure identity for `foo' is
> kept, because it's only accessed outside the module.  But then I
> realized thanks to your mail (and the three or four times that people
> stumbled against this beforehand) that we can preserve the optimizations
> and peoples' intuitions about procedure equality if we restrict
> eta-expansion to those procedures that are only referenced by value in
> at most a single position.
>
> It would be best to implement the eta-expansion after peval; doing it
> where we do leaves some optimization opportunities on the table.  But I
> have implemented this change in git and it should fix this issue.
>
> Comparative benchmark results:
>
>
> https://wingolog.org/pub/guile-2.9.7-vs-guile-2.9.9-with-eq-change-microbenchmarks.png
>
> Regards,
>
> Andy
>
>

[-- Attachment #2: Type: text/html, Size: 3154 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 12:18     ` Mikael Djurfeldt
@ 2020-01-14 13:25       ` Stefan Israelsson Tampe
  2020-01-14 14:32       ` Andy Wingo
  1 sibling, 0 replies; 24+ messages in thread
From: Stefan Israelsson Tampe @ 2020-01-14 13:25 UTC (permalink / raw)
  To: Mikael Djurfeldt; +Cc: Andy Wingo, guile-devel

[-- Attachment #1: Type: text/plain, Size: 2856 bytes --]

I agree about the scary part as it e.g. would make it impossible to use
procedures in hashmaps (where my trouble stems from) in any sane way, I
know how to fix
my code but there will be a lot of anger on the mailinglist and irc to
teach how to avoid the problems.

Fortunately probably the next release will have fixes to this and we will
regain the identity features.

Also it is scary that scheme spec allows compilers to abuse the usage of
procedure identities.





On Tue, Jan 14, 2020 at 1:18 PM Mikael Djurfeldt <mikael@djurfeldt.com>
wrote:

> Dear Andy,
>
> I probably don't have a clue about what you are talking about (or at least
> hope so), but this---the "eq change"---sounds scary to me.
>
> One of the *strengths* of Scheme is that procedures are first class
> citizens. As wonderfully show-cased in e.g. SICP this can be used to obtain
> expressive and concise programs, where procedures can occur many times as
> values outside operator position.
>
> I would certainly *not* want to trade in an important optimization step in
> those cases to obtain intuitive procedure equality. The risk is then that
> you would tend to avoid passing around procedures as values.
>
> Have I misunderstood something or do I have a point here?
>
> Best regards,
> Mikael
>
> Den tis 14 jan. 2020 12:18Andy Wingo <wingo@pobox.com> skrev:
>
>> On Mon 13 Jan 2020 22:32, Stefan Israelsson Tampe <
>> stefan.itampe@gmail.com> writes:
>>
>> > In current guile (eq? f f) = #f for a procedure f. Try:
>>
>> Note that procedure equality is explicitly unspecified by R6RS.  Guile's
>> declarative modules optimization took advantage of this to eta-expand
>> references to declaratively-bound top-level lambda expressions.  This
>> unlocks the "well-known" closure optimizations: closure elision,
>> contification, and so on.
>>
>> However, the intention with the eta expansion was really to prevent the
>>
>>   (module-add! mod 'foo foo)
>>
>> from making the procedure not-well-known.  If that's the only reference
>> to `foo' outside the operator position, procedure identity for `foo' is
>> kept, because it's only accessed outside the module.  But then I
>> realized thanks to your mail (and the three or four times that people
>> stumbled against this beforehand) that we can preserve the optimizations
>> and peoples' intuitions about procedure equality if we restrict
>> eta-expansion to those procedures that are only referenced by value in
>> at most a single position.
>>
>> It would be best to implement the eta-expansion after peval; doing it
>> where we do leaves some optimization opportunities on the table.  But I
>> have implemented this change in git and it should fix this issue.
>>
>> Comparative benchmark results:
>>
>>
>> https://wingolog.org/pub/guile-2.9.7-vs-guile-2.9.9-with-eq-change-microbenchmarks.png
>>
>> Regards,
>>
>> Andy
>>
>>

[-- Attachment #2: Type: text/html, Size: 4141 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 12:18     ` Mikael Djurfeldt
  2020-01-14 13:25       ` Stefan Israelsson Tampe
@ 2020-01-14 14:32       ` Andy Wingo
  2020-01-14 14:47         ` Stefan Israelsson Tampe
  2020-01-14 16:03         ` Mikael Djurfeldt
  1 sibling, 2 replies; 24+ messages in thread
From: Andy Wingo @ 2020-01-14 14:32 UTC (permalink / raw)
  To: Mikael Djurfeldt; +Cc: Andy Wingo, guile-devel

On Tue 14 Jan 2020 13:18, Mikael Djurfeldt <mikael@djurfeldt.com> writes:

> I probably don't have a clue about what you are talking about (or at
> least hope so), but this---the "eq change"---sounds scary to me.
>
> One of the *strengths* of Scheme is that procedures are first class
> citizens. As wonderfully show-cased in e.g. SICP this can be used to
> obtain expressive and concise programs, where procedures can occur
> many times as values outside operator position.
>
> I would certainly *not* want to trade in an important optimization
> step in those cases to obtain intuitive procedure equality. The risk
> is then that you would tend to avoid passing around procedures as
> values.

Is this true?

  (eq? '() '())

What about this?

  (eq? '(a) '(a))

And yet, are datums not first-class values?  What does being first-class
have to do with it?

Does it matter whether it's eq? or eqv?

What about:

  (eq? (lambda () 10) (lambda () 10))

What's the difference?

What's the difference in the lambda calculus between "\x.f x" and "f"?

What if in a partial evaluator, you see a `(eq? x y)`, and you notice
that `x' is bound to a lambda expression?  Can you say anything about
the value of the expression?

Does comparing procedures for equality mean anything at all?
https://cs-syd.eu/posts/2016-01-17-function-equality-in-haskell

Anyway :)  All that is a bit of trolling on my part.  What I mean to say
is that instincts are tricky when it comes to object identity, equality,
equivalence, and especially all of those combined with procedures.  The
R6RS (what can be more Schemely than a Scheme standard?) makes this
clear.

All that said, with the recent patch, I believe that Guile 3.0's
behavior preserves your intuitions.  Bug reports very welcome!

Andy



^ permalink raw reply	[flat|nested] 24+ messages in thread

* RE: GNU Guile 2.9.9 Released [beta]
@ 2020-01-14 14:39 dsmich
  0 siblings, 0 replies; 24+ messages in thread
From: dsmich @ 2020-01-14 14:39 UTC (permalink / raw)
  To: 'Andy Wingo'
  Cc: 'guile-user@gnu.org', 'guile-sources@gnu.org',
	'guile-devel@gnu.org'

[-- Attachment #1: Type: text/plain, Size: 293 bytes --]



	> We are pleased to announce GNU Guile release 2.9.9.

	When attempting to build on a Debian Jessie 32bit arm system, gcc
(Debian 4.9.2-10+deb8u2) 4.9.2

	I'm working on updating this system to Debian Stable, but it might
require wiping it and doing a fresh install.

	-Dale



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: error.log --]
[-- Type: text/x-log, Size: 22997 bytes --]

make  all-recursive
make[1]: Entering directory '/home/dsmith/src/guile-2.9.9'
Making all in lib
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/lib'
make  all-recursive
make[3]: Entering directory '/home/dsmith/src/guile-2.9.9/lib'
make[4]: Entering directory '/home/dsmith/src/guile-2.9.9/lib'
make[4]: Nothing to be done for 'all-am'.
make[4]: Leaving directory '/home/dsmith/src/guile-2.9.9/lib'
make[3]: Leaving directory '/home/dsmith/src/guile-2.9.9/lib'
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/lib'
Making all in meta
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/meta'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/meta'
Making all in libguile
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/libguile'
make  all-am
make[3]: Entering directory '/home/dsmith/src/guile-2.9.9/libguile'
  CC       libguile_3.0_la-jit.lo
jit.c:232:1: error: initializer element is not constant
 static const jit_gpr_t THREAD = JIT_V0;
 ^
jit.c:237:1: error: initializer element is not constant
 static const jit_gpr_t SP = JIT_R0;
 ^
jit.c:243:1: error: initializer element is not constant
 static const jit_gpr_t FP = JIT_R1;
 ^
jit.c:248:1: error: initializer element is not constant
 static const jit_gpr_t OLD_FP_FOR_RETURN_TRAMPOLINE = JIT_V1; /* T0 */
 ^
jit.c:251:1: error: initializer element is not constant
 static const jit_gpr_t T0 = JIT_V1;
 ^
jit.c:252:1: error: initializer element is not constant
 static const jit_gpr_t T1 = JIT_V2;
 ^
jit.c:253:1: error: initializer element is not constant
 static const jit_gpr_t T2 = JIT_R2;
 ^
jit.c:254:1: error: initializer element is not constant
 SCM_UNUSED static const jit_gpr_t T3_OR_FP = JIT_R1;
 ^
jit.c:255:1: error: initializer element is not constant
 SCM_UNUSED static const jit_gpr_t T4_OR_SP = JIT_R0;
 ^
jit.c:259:1: error: initializer element is not constant
 SCM_UNUSED static const jit_gpr_t T0_PRESERVED = JIT_V1;
 ^
jit.c:260:1: error: initializer element is not constant
 static const jit_gpr_t T1_PRESERVED = JIT_V2;
 ^
jit.c:974:1: warning: 'sp_u64_operand' defined but not used [-Wunused-function]
 sp_u64_operand (scm_jit_state *j, uint32_t slot)
 ^
jit.c:1028:1: warning: 'sp_s32_operand' defined but not used [-Wunused-function]
 sp_s32_operand (scm_jit_state *j, uint32_t src)
 ^
Makefile:3126: recipe for target 'libguile_3.0_la-jit.lo' failed
make[3]: *** [libguile_3.0_la-jit.lo] Error 1
  CC       libguile_3.0_la-keywords.lo
  CC       libguile_3.0_la-list.lo
  CC       libguile_3.0_la-load.lo
  CC       libguile_3.0_la-loader.lo
  CC       libguile_3.0_la-macros.lo
  CC       libguile_3.0_la-mallocs.lo
  CC       libguile_3.0_la-memoize.lo
  CC       libguile_3.0_la-modules.lo
  CC       libguile_3.0_la-null-threads.lo
  CC       libguile_3.0_la-numbers.lo
  CC       libguile_3.0_la-objprop.lo
  CC       libguile_3.0_la-options.lo
  CC       libguile_3.0_la-pairs.lo
  CC       libguile_3.0_la-poll.lo
  CC       libguile_3.0_la-ports.lo
  CC       libguile_3.0_la-print.lo
  CC       libguile_3.0_la-procprop.lo
  CC       libguile_3.0_la-procs.lo
  CC       libguile_3.0_la-programs.lo
  CC       libguile_3.0_la-promises.lo
  CC       libguile_3.0_la-r6rs-ports.lo
  CC       libguile_3.0_la-random.lo
  CC       libguile_3.0_la-rdelim.lo
  CC       libguile_3.0_la-read.lo
  CC       libguile_3.0_la-rw.lo
  CC       libguile_3.0_la-scmsigs.lo
  CC       libguile_3.0_la-script.lo
  CC       libguile_3.0_la-simpos.lo
  CC       libguile_3.0_la-smob.lo
  CC       libguile_3.0_la-sort.lo
  CC       libguile_3.0_la-srcprop.lo
  CC       libguile_3.0_la-srfi-1.lo
  CC       libguile_3.0_la-srfi-4.lo
  CC       libguile_3.0_la-srfi-13.lo
  CC       libguile_3.0_la-srfi-14.lo
  CC       libguile_3.0_la-srfi-60.lo
  CC       libguile_3.0_la-stackchk.lo
  CC       libguile_3.0_la-stacks.lo
  CC       libguile_3.0_la-stime.lo
  CC       libguile_3.0_la-strings.lo
  CC       libguile_3.0_la-strorder.lo
  CC       libguile_3.0_la-strports.lo
  CC       libguile_3.0_la-struct.lo
  CC       libguile_3.0_la-symbols.lo
  CC       libguile_3.0_la-syntax.lo
  CC       libguile_3.0_la-threads.lo
  CC       libguile_3.0_la-throw.lo
  CC       libguile_3.0_la-trees.lo
  CC       libguile_3.0_la-unicode.lo
  CC       libguile_3.0_la-uniform.lo
  CC       libguile_3.0_la-values.lo
  CC       libguile_3.0_la-variable.lo
  CC       libguile_3.0_la-vectors.lo
  CC       libguile_3.0_la-version.lo
  CC       libguile_3.0_la-vm.lo
In file included from ../libguile/pairs.h:26:0,
                 from alist.h:26,
                 from vm.c:38:
vm-engine.c: In function 'vm_regular_engine':
../libguile/scm.h:176:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 # define SCM_PACK(x) ((SCM) (x))
                       ^
../libguile/gc.h:49:72: note: in definition of macro 'SCM_GC_SET_CELL_OBJECT'
 #define SCM_GC_SET_CELL_OBJECT(x, n, v) ((((SCM *)SCM2PTR (x)) [n]) = (v))
                                                                        ^
../libguile/gc.h:51:38: note: in expansion of macro 'SCM_PACK'
   (SCM_GC_SET_CELL_OBJECT ((x), (n), SCM_PACK (v)))
                                      ^
../libguile/gc.h:67:36: note: in expansion of macro 'SCM_GC_SET_CELL_WORD'
 #define SCM_SET_CELL_WORD(x, n, v) SCM_GC_SET_CELL_WORD ((x), (n), (v))
                                    ^
vm-engine.c:1964:7: note: in expansion of macro 'SCM_SET_CELL_WORD'
       SCM_SET_CELL_WORD (SP_REF (obj), SP_REF_U64 (idx), SP_REF_U64 (val));
       ^
../libguile/scm.h:176:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 # define SCM_PACK(x) ((SCM) (x))
                       ^
../libguile/gc.h:49:72: note: in definition of macro 'SCM_GC_SET_CELL_OBJECT'
 #define SCM_GC_SET_CELL_OBJECT(x, n, v) ((((SCM *)SCM2PTR (x)) [n]) = (v))
                                                                        ^
../libguile/gc.h:51:38: note: in expansion of macro 'SCM_PACK'
   (SCM_GC_SET_CELL_OBJECT ((x), (n), SCM_PACK (v)))
                                      ^
../libguile/gc.h:67:36: note: in expansion of macro 'SCM_GC_SET_CELL_WORD'
 #define SCM_SET_CELL_WORD(x, n, v) SCM_GC_SET_CELL_WORD ((x), (n), (v))
                                    ^
vm-engine.c:1996:7: note: in expansion of macro 'SCM_SET_CELL_WORD'
       SCM_SET_CELL_WORD (SP_REF (obj), idx, SP_REF_U64 (val));
       ^
vm-engine.c: In function 'vm_debug_engine':
../libguile/scm.h:176:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 # define SCM_PACK(x) ((SCM) (x))
                       ^
../libguile/gc.h:49:72: note: in definition of macro 'SCM_GC_SET_CELL_OBJECT'
 #define SCM_GC_SET_CELL_OBJECT(x, n, v) ((((SCM *)SCM2PTR (x)) [n]) = (v))
                                                                        ^
../libguile/gc.h:51:38: note: in expansion of macro 'SCM_PACK'
   (SCM_GC_SET_CELL_OBJECT ((x), (n), SCM_PACK (v)))
                                      ^
../libguile/gc.h:67:36: note: in expansion of macro 'SCM_GC_SET_CELL_WORD'
 #define SCM_SET_CELL_WORD(x, n, v) SCM_GC_SET_CELL_WORD ((x), (n), (v))
                                    ^
vm-engine.c:1964:7: note: in expansion of macro 'SCM_SET_CELL_WORD'
       SCM_SET_CELL_WORD (SP_REF (obj), SP_REF_U64 (idx), SP_REF_U64 (val));
       ^
../libguile/scm.h:176:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 # define SCM_PACK(x) ((SCM) (x))
                       ^
../libguile/gc.h:49:72: note: in definition of macro 'SCM_GC_SET_CELL_OBJECT'
 #define SCM_GC_SET_CELL_OBJECT(x, n, v) ((((SCM *)SCM2PTR (x)) [n]) = (v))
                                                                        ^
../libguile/gc.h:51:38: note: in expansion of macro 'SCM_PACK'
   (SCM_GC_SET_CELL_OBJECT ((x), (n), SCM_PACK (v)))
                                      ^
../libguile/gc.h:67:36: note: in expansion of macro 'SCM_GC_SET_CELL_WORD'
 #define SCM_SET_CELL_WORD(x, n, v) SCM_GC_SET_CELL_WORD ((x), (n), (v))
                                    ^
vm-engine.c:1996:7: note: in expansion of macro 'SCM_SET_CELL_WORD'
       SCM_SET_CELL_WORD (SP_REF (obj), idx, SP_REF_U64 (val));
       ^
  CC       libguile_3.0_la-vports.lo
  CC       libguile_3.0_la-weak-set.lo
  CC       libguile_3.0_la-weak-table.lo
  CC       libguile_3.0_la-weak-vector.lo
  CC       libguile_3.0_la-lightening.lo
In file included from ./lightening/lightening/lightening.c:470:0:
./lightening/lightening/arm.c:35:3: error: initializer element is not constant
   _R0, _R1, _R2, _R3
   ^
./lightening/lightening/arm.c:35:3: error: (near initialization for 'abi_gpr_args[0]')
./lightening/lightening/lightening.c:1044:3: error: initializer element is not constant
   JIT_PLATFORM_CALLEE_SAVE_GPRS
   ^
./lightening/lightening/lightening.c:1044:3: error: (near initialization for 'platform_callee_save_gprs[0]')
./lightening/lightening/lightening.c:1045:1: warning: missing braces around initializer [-Wmissing-braces]
 };
 ^
./lightening/lightening/lightening.c:1045:1: warning: (near initialization for 'platform_callee_save_gprs[1]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1045:1: error: initializer element is not constant
./lightening/lightening/lightening.c:1045:1: error: (near initialization for 'platform_callee_save_gprs[1].regno')
./lightening/lightening/lightening.c:1048:3: error: initializer element is not constant
   JIT_V0, JIT_V1, JIT_V2
   ^
./lightening/lightening/lightening.c:1048:3: error: (near initialization for 'user_callee_save_gprs[0]')
./lightening/lightening/lightening.c:1048:3: warning: missing braces around initializer [-Wmissing-braces]
./lightening/lightening/lightening.c:1048:3: warning: (near initialization for 'user_callee_save_gprs[1]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1048:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1048:3: error: (near initialization for 'user_callee_save_gprs[1].regno')
./lightening/lightening/lightening.c:1050:3: warning: missing braces around initializer [-Wmissing-braces]
   , JIT_V3
   ^
./lightening/lightening/lightening.c:1050:3: warning: (near initialization for 'user_callee_save_gprs[2]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1050:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1050:3: error: (near initialization for 'user_callee_save_gprs[2].regno')
./lightening/lightening/lightening.c:1053:3: warning: missing braces around initializer [-Wmissing-braces]
   , JIT_V4
   ^
./lightening/lightening/lightening.c:1053:3: warning: (near initialization for 'user_callee_save_gprs[3]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1053:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1053:3: error: (near initialization for 'user_callee_save_gprs[3].regno')
./lightening/lightening/lightening.c:1056:3: warning: missing braces around initializer [-Wmissing-braces]
   , JIT_V5
   ^
./lightening/lightening/lightening.c:1056:3: warning: (near initialization for 'user_callee_save_gprs[4]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1056:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1056:3: error: (near initialization for 'user_callee_save_gprs[4].regno')
./lightening/lightening/lightening.c:1059:3: warning: missing braces around initializer [-Wmissing-braces]
   , JIT_V6
   ^
./lightening/lightening/lightening.c:1059:3: warning: (near initialization for 'user_callee_save_gprs[5]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1059:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1059:3: error: (near initialization for 'user_callee_save_gprs[5].regno')
./lightening/lightening/lightening.c:1070:2: warning: missing braces around initializer [-Wmissing-braces]
  };
  ^
./lightening/lightening/lightening.c:1070:2: warning: (near initialization for 'user_callee_save_gprs[6]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1070:2: error: initializer element is not constant
./lightening/lightening/lightening.c:1070:2: error: (near initialization for 'user_callee_save_gprs[6].regno')
./lightening/lightening/lightening.c:1077:3: error: initializer element is not constant
   , JIT_VF1
   ^
./lightening/lightening/lightening.c:1077:3: error: (near initialization for 'user_callee_save_fprs[0]')
./lightening/lightening/lightening.c:1080:3: warning: missing braces around initializer [-Wmissing-braces]
   , JIT_VF2
   ^
./lightening/lightening/lightening.c:1080:3: warning: (near initialization for 'user_callee_save_fprs[1]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1080:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1080:3: error: (near initialization for 'user_callee_save_fprs[1].regno')
./lightening/lightening/lightening.c:1083:3: warning: missing braces around initializer [-Wmissing-braces]
   , JIT_VF3
   ^
./lightening/lightening/lightening.c:1083:3: warning: (near initialization for 'user_callee_save_fprs[2]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1083:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1083:3: error: (near initialization for 'user_callee_save_fprs[2].regno')
./lightening/lightening/lightening.c:1086:3: warning: missing braces around initializer [-Wmissing-braces]
   , JIT_VF4
   ^
./lightening/lightening/lightening.c:1086:3: warning: (near initialization for 'user_callee_save_fprs[3]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1086:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1086:3: error: (near initialization for 'user_callee_save_fprs[3].regno')
./lightening/lightening/lightening.c:1089:3: warning: missing braces around initializer [-Wmissing-braces]
   , JIT_VF5
   ^
./lightening/lightening/lightening.c:1089:3: warning: (near initialization for 'user_callee_save_fprs[4]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1089:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1089:3: error: (near initialization for 'user_callee_save_fprs[4].regno')
./lightening/lightening/lightening.c:1092:3: warning: missing braces around initializer [-Wmissing-braces]
   , JIT_VF6
   ^
./lightening/lightening/lightening.c:1092:3: warning: (near initialization for 'user_callee_save_fprs[5]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1092:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1092:3: error: (near initialization for 'user_callee_save_fprs[5].regno')
./lightening/lightening/lightening.c:1095:3: warning: missing braces around initializer [-Wmissing-braces]
   , JIT_VF7
   ^
./lightening/lightening/lightening.c:1095:3: warning: (near initialization for 'user_callee_save_fprs[6]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1095:3: error: initializer element is not constant
./lightening/lightening/lightening.c:1095:3: error: (near initialization for 'user_callee_save_fprs[6].regno')
./lightening/lightening/lightening.c:1097:1: warning: missing braces around initializer [-Wmissing-braces]
 };
 ^
./lightening/lightening/lightening.c:1097:1: warning: (near initialization for 'user_callee_save_fprs[7]') [-Wmissing-braces]
./lightening/lightening/lightening.c:1097:1: error: initializer element is not constant
./lightening/lightening/lightening.c:1097:1: error: (near initialization for 'user_callee_save_fprs[7].regno')
Makefile:3546: recipe for target 'libguile_3.0_la-lightening.lo' failed
make[3]: *** [libguile_3.0_la-lightening.lo] Error 1
  CC       libguile_3.0_la-dynl.lo
  CC       libguile_3.0_la-posix.lo
  CC       libguile_3.0_la-net_db.lo
  CC       libguile_3.0_la-socket.lo
  CC       libguile_3.0_la-regex-posix.lo
  GEN      c-tokenize.o
  GEN      guile_filter_doc_snarfage
  SNARF  alist.doc
  SNARF  array-handle.doc
  SNARF  array-map.doc
  SNARF  arrays.doc
  SNARF  async.doc
  SNARF  atomic.doc
  SNARF  backtrace.doc
  SNARF  boolean.doc
  SNARF  bitvectors.doc
  SNARF  bytevectors.doc
  SNARF  chars.doc
  SNARF  control.doc
  SNARF  continuations.doc
  SNARF  debug.doc
  SNARF  deprecated.doc
  SNARF  deprecation.doc
  SNARF  dynl.doc
  SNARF  dynwind.doc
  SNARF  eq.doc
  SNARF  error.doc
  SNARF  eval.doc
  SNARF  evalext.doc
  SNARF  exceptions.doc
  SNARF  expand.doc
  SNARF  extensions.doc
  SNARF  fdes-finalizers.doc
  SNARF  feature.doc
  SNARF  filesys.doc
  SNARF  fluids.doc
  SNARF  foreign.doc
  SNARF  fports.doc
  SNARF  gc-malloc.doc
  SNARF  gc.doc
  SNARF  gettext.doc
  SNARF  generalized-arrays.doc
  SNARF  generalized-vectors.doc
  SNARF  goops.doc
  SNARF  gsubr.doc
  SNARF  guardians.doc
  SNARF  hash.doc
  SNARF  hashtab.doc
  SNARF  hooks.doc
  SNARF  i18n.doc
  SNARF  init.doc
  SNARF  ioext.doc
  SNARF  keywords.doc
  SNARF  list.doc
  SNARF  load.doc
  SNARF  macros.doc
  SNARF  mallocs.doc
  SNARF  memoize.doc
  SNARF  modules.doc
  SNARF  numbers.doc
  SNARF  objprop.doc
  SNARF  options.doc
  SNARF  pairs.doc
  SNARF  ports.doc
  SNARF  print.doc
  SNARF  procprop.doc
  SNARF  procs.doc
  SNARF  promises.doc
  SNARF  r6rs-ports.doc
  SNARF  random.doc
  SNARF  rdelim.doc
  SNARF  read.doc
  SNARF  rw.doc
  SNARF  scmsigs.doc
  SNARF  script.doc
  SNARF  simpos.doc
  SNARF  smob.doc
  SNARF  sort.doc
  SNARF  srcprop.doc
  SNARF  srfi-1.doc
  SNARF  srfi-4.doc
  SNARF  srfi-13.doc
  SNARF  srfi-14.doc
  SNARF  srfi-60.doc
  SNARF  stackchk.doc
  SNARF  stacks.doc
  SNARF  stime.doc
  SNARF  strings.doc
  SNARF  strorder.doc
  SNARF  strports.doc
  SNARF  struct.doc
  SNARF  symbols.doc
  SNARF  syntax.doc
  SNARF  threads.doc
  SNARF  throw.doc
  SNARF  trees.doc
  SNARF  unicode.doc
  SNARF  uniform.doc
  SNARF  values.doc
  SNARF  variable.doc
  SNARF  vectors.doc
  SNARF  version.doc
  SNARF  vports.doc
  SNARF  weak-set.doc
  SNARF  weak-table.doc
  SNARF  weak-vector.doc
  SNARF  posix.doc
  SNARF  net_db.doc
  SNARF  socket.doc
  SNARF  regex-posix.doc
make[3]: Target 'all-am' not remade because of errors.
make[3]: Leaving directory '/home/dsmith/src/guile-2.9.9/libguile'
Makefile:2426: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/libguile'
Making all in bootstrap
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/bootstrap'
  BOOTSTRAP GUILEC ice-9/eval.go
/home/dsmith/src/guile-2.9.9/meta/guild: 3: exec: /home/dsmith/src/guile-2.9.9/libguile/guile: not found
Makefile:1930: recipe for target 'ice-9/eval.go' failed
make[2]: *** [ice-9/eval.go] Error 127
make[2]: Target 'all' not remade because of errors.
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/bootstrap'
Making all in module
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/module'
make[2]: *** No rule to make target '../bootstrap/ice-9/eval.go', needed by 'ice-9/and-let-star.go'.
make[2]: Target 'all' not remade because of errors.
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/module'
Making all in guile-readline
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/guile-readline'
make  all-am
make[3]: Entering directory '/home/dsmith/src/guile-2.9.9/guile-readline'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/dsmith/src/guile-2.9.9/guile-readline'
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/guile-readline'
Making all in examples
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/examples'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/examples'
Making all in emacs
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/emacs'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/emacs'
Making all in test-suite
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/test-suite'
Making all in standalone
make[3]: Entering directory '/home/dsmith/src/guile-2.9.9/test-suite/standalone'
  SNARF  test-asmobs-lib.x
make  all-am
make[4]: Entering directory '/home/dsmith/src/guile-2.9.9/test-suite/standalone'
  CC       libtest_asmobs_la-test-asmobs-lib.lo
make[4]: *** No rule to make target '../../libguile/libguile-3.0.la', needed by 'libtest-asmobs.la'.
  CC       libtest_ffi_la-test-ffi-lib.lo
  CC       libtest_extensions_la-test-extensions-lib.lo
make[4]: Target 'all-am' not remade because of errors.
make[4]: Leaving directory '/home/dsmith/src/guile-2.9.9/test-suite/standalone'
Makefile:2069: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/home/dsmith/src/guile-2.9.9/test-suite/standalone'
make[3]: Entering directory '/home/dsmith/src/guile-2.9.9/test-suite'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/dsmith/src/guile-2.9.9/test-suite'
Makefile:1879: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Target 'all' not remade because of errors.
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/test-suite'
Making all in benchmark-suite
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/benchmark-suite'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/benchmark-suite'
Making all in gc-benchmarks
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/gc-benchmarks'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/gc-benchmarks'
Making all in am
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/am'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/am'
Making all in doc
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9/doc'
Making all in ref
make[3]: Entering directory '/home/dsmith/src/guile-2.9.9/doc/ref'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/dsmith/src/guile-2.9.9/doc/ref'
Making all in r5rs
make[3]: Entering directory '/home/dsmith/src/guile-2.9.9/doc/r5rs'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/dsmith/src/guile-2.9.9/doc/r5rs'
make[3]: Entering directory '/home/dsmith/src/guile-2.9.9/doc'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/home/dsmith/src/guile-2.9.9/doc'
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9/doc'
make[2]: Entering directory '/home/dsmith/src/guile-2.9.9'
make[2]: *** No rule to make target 'libguile/guile-procedures.texi', needed by 'libguile/guile-procedures.txt'.
make[2]: Target 'all-am' not remade because of errors.
make[2]: Leaving directory '/home/dsmith/src/guile-2.9.9'
Makefile:1849: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/dsmith/src/guile-2.9.9'
Makefile:1735: recipe for target 'all' failed
make: *** [all] Error 2

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 14:32       ` Andy Wingo
@ 2020-01-14 14:47         ` Stefan Israelsson Tampe
  2020-01-14 16:15           ` Andy Wingo
  2020-01-14 16:03         ` Mikael Djurfeldt
  1 sibling, 1 reply; 24+ messages in thread
From: Stefan Israelsson Tampe @ 2020-01-14 14:47 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 2453 bytes --]

Yes, your patch is indicating when you should use the same identity e.g.
all uses of procedures in a higher order position such as an argument or a
return
value. But I looked at your patch, which looks good but I saw that for
operator position you decrease the count. Why? Also you are free to use one
version in
argument / return position and another one in operator position the only
limit is to use the same identity for on operator position. Finally don't
you need to count
usage of returning a variable as well?

On Tue, Jan 14, 2020 at 3:34 PM Andy Wingo <wingo@pobox.com> wrote:

> On Tue 14 Jan 2020 13:18, Mikael Djurfeldt <mikael@djurfeldt.com> writes:
>
> > I probably don't have a clue about what you are talking about (or at
> > least hope so), but this---the "eq change"---sounds scary to me.
> >
> > One of the *strengths* of Scheme is that procedures are first class
> > citizens. As wonderfully show-cased in e.g. SICP this can be used to
> > obtain expressive and concise programs, where procedures can occur
> > many times as values outside operator position.
> >
> > I would certainly *not* want to trade in an important optimization
> > step in those cases to obtain intuitive procedure equality. The risk
> > is then that you would tend to avoid passing around procedures as
> > values.
>
> Is this true?
>
>   (eq? '() '())
>
> What about this?
>
>   (eq? '(a) '(a))
>
> And yet, are datums not first-class values?  What does being first-class
> have to do with it?
>
> Does it matter whether it's eq? or eqv?
>
> What about:
>
>   (eq? (lambda () 10) (lambda () 10))
>
> What's the difference?
>
> What's the difference in the lambda calculus between "\x.f x" and "f"?
>
> What if in a partial evaluator, you see a `(eq? x y)`, and you notice
> that `x' is bound to a lambda expression?  Can you say anything about
> the value of the expression?
>
> Does comparing procedures for equality mean anything at all?
> https://cs-syd.eu/posts/2016-01-17-function-equality-in-haskell
>
> Anyway :)  All that is a bit of trolling on my part.  What I mean to say
> is that instincts are tricky when it comes to object identity, equality,
> equivalence, and especially all of those combined with procedures.  The
> R6RS (what can be more Schemely than a Scheme standard?) makes this
> clear.
>
> All that said, with the recent patch, I believe that Guile 3.0's
> behavior preserves your intuitions.  Bug reports very welcome!
>
> Andy
>
>

[-- Attachment #2: Type: text/html, Size: 3235 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 14:32       ` Andy Wingo
  2020-01-14 14:47         ` Stefan Israelsson Tampe
@ 2020-01-14 16:03         ` Mikael Djurfeldt
       [not found]           ` <CAGua6m2cm2iFTf6EB4MuDR4qNDJ1kt1EjwRCBgLKS+qxncxp+w@mail.gmail.com>
  2020-01-14 20:54           ` Andy Wingo
  1 sibling, 2 replies; 24+ messages in thread
From: Mikael Djurfeldt @ 2020-01-14 16:03 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 2449 bytes --]

Hmm... it seems like both Stefan and you have interpreted my post exactly
the opposite way compared to how it was meant. :)

I completely agree that procedure equality is not strongly connected to the
first citizen-ness.

What I wanted to say is that I probably prefer you to *reverse* the recent
patch because I prefer to have good optimization also when procedures are
referenced by value in more than one non-operator position. I prefer this
over having (eq? p p) => #t for the reasons I stated.

Best regards,
Mikael

Den tis 14 jan. 2020 15:33Andy Wingo <wingo@pobox.com> skrev:

> On Tue 14 Jan 2020 13:18, Mikael Djurfeldt <mikael@djurfeldt.com> writes:
>
> > I probably don't have a clue about what you are talking about (or at
> > least hope so), but this---the "eq change"---sounds scary to me.
> >
> > One of the *strengths* of Scheme is that procedures are first class
> > citizens. As wonderfully show-cased in e.g. SICP this can be used to
> > obtain expressive and concise programs, where procedures can occur
> > many times as values outside operator position.
> >
> > I would certainly *not* want to trade in an important optimization
> > step in those cases to obtain intuitive procedure equality. The risk
> > is then that you would tend to avoid passing around procedures as
> > values.
>
> Is this true?
>
>   (eq? '() '())
>
> What about this?
>
>   (eq? '(a) '(a))
>
> And yet, are datums not first-class values?  What does being first-class
> have to do with it?
>
> Does it matter whether it's eq? or eqv?
>
> What about:
>
>   (eq? (lambda () 10) (lambda () 10))
>
> What's the difference?
>
> What's the difference in the lambda calculus between "\x.f x" and "f"?
>
> What if in a partial evaluator, you see a `(eq? x y)`, and you notice
> that `x' is bound to a lambda expression?  Can you say anything about
> the value of the expression?
>
> Does comparing procedures for equality mean anything at all?
> https://cs-syd.eu/posts/2016-01-17-function-equality-in-haskell
>
> Anyway :)  All that is a bit of trolling on my part.  What I mean to say
> is that instincts are tricky when it comes to object identity, equality,
> equivalence, and especially all of those combined with procedures.  The
> R6RS (what can be more Schemely than a Scheme standard?) makes this
> clear.
>
> All that said, with the recent patch, I believe that Guile 3.0's
> behavior preserves your intuitions.  Bug reports very welcome!
>
> Andy
>

[-- Attachment #2: Type: text/html, Size: 3353 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 14:47         ` Stefan Israelsson Tampe
@ 2020-01-14 16:15           ` Andy Wingo
  2020-01-14 16:36             ` Stefan Israelsson Tampe
  0 siblings, 1 reply; 24+ messages in thread
From: Andy Wingo @ 2020-01-14 16:15 UTC (permalink / raw)
  To: Stefan Israelsson Tampe; +Cc: guile-devel

On Tue 14 Jan 2020 15:47, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:

> Yes, your patch is indicating when you should use the same identity
> e.g. all uses of procedures in a higher order position such as an
> argument or a return value. But I looked at your patch, which looks
> good but I saw that for operator position you decrease the count. Why?
> Also you are free to use one version in argument / return position and
> another one in operator position the only limit is to use the same
> identity for on operator position. Finally don't you need to count
> usage of returning a variable as well?

Not sure what the bug is.  Do you have a test case that shows the
behavior that you think is not good?

Andy



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 16:15           ` Andy Wingo
@ 2020-01-14 16:36             ` Stefan Israelsson Tampe
  2020-01-14 17:56               ` Stefan Israelsson Tampe
  0 siblings, 1 reply; 24+ messages in thread
From: Stefan Israelsson Tampe @ 2020-01-14 16:36 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1511 bytes --]

1. I don't understand why you decrement the count in operator position
2. I don't see that you increase the count when a procedure is returned
from a lambda

Example
(define (f a) a)
(define (g)
    (hash-set! H f 1) ; (*)
    (f 1)) ;(**)
(define (h)
   (pk (hash-ref H f))) ; (*)

(g)
(h)

=> '(#f) as count in your patch is counted up twice (*) and down ones (**)
in total count = 1 so you will not maintain the identity of f and you will
get a bad printout

Then we also have this example
(define (f a) a)
(define (u) f)
(define (g) (hash-set! H (u) 1))
(define (h) (pk (hash-ref H f)))

(g)
(h)
This will again print (#f) as the count will be 1.

/Stefan























On Tue, Jan 14, 2020 at 5:16 PM Andy Wingo <wingo@pobox.com> wrote:

> On Tue 14 Jan 2020 15:47, Stefan Israelsson Tampe <stefan.itampe@gmail.com>
> writes:
>
> > Yes, your patch is indicating when you should use the same identity
> > e.g. all uses of procedures in a higher order position such as an
> > argument or a return value. But I looked at your patch, which looks
> > good but I saw that for operator position you decrease the count. Why?
> > Also you are free to use one version in argument / return position and
> > another one in operator position the only limit is to use the same
> > identity for on operator position. Finally don't you need to count
> > usage of returning a variable as well?
>
> Not sure what the bug is.  Do you have a test case that shows the
> behavior that you think is not good?
>
> Andy
>

[-- Attachment #2: Type: text/html, Size: 2581 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 16:36             ` Fwd: " Stefan Israelsson Tampe
@ 2020-01-14 16:47               ` Mikael Djurfeldt
  2020-01-14 17:21                 ` Taylan Kammer
  2020-01-14 17:27                 ` Stefan Israelsson Tampe
  0 siblings, 2 replies; 24+ messages in thread
From: Mikael Djurfeldt @ 2020-01-14 16:47 UTC (permalink / raw)
  To: Stefan Israelsson Tampe; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 4561 bytes --]

It might be reasonable to keep the patch for now in order not to introduce
novel behavior this short before the 3.0 release.

But especially in light of Andy's work, I do regret introducing
procedure-properties. It's a more LISPy feature than Schemey. Did you see
Andy's argument about procedure equality below?

I would have preferred to postpone the release and drop procedure equality,
procedure-properties etc. It can be handy and convenient, yes, but there is
a reason why R6RS didn't require (eq? p p) -> #t...

Best regards,
Mikael

On Tue, Jan 14, 2020 at 5:37 PM Stefan Israelsson Tampe <
stefan.itampe@gmail.com> wrote:

>
>
> ---------- Forwarded message ---------
> From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
> Date: Tue, Jan 14, 2020 at 5:23 PM
> Subject: Re: GNU Guile 2.9.9 Released [beta]
> To: Mikael Djurfeldt <mikael@djurfeldt.com>
>
>
> This is how it always have been in guile, without this patch you cannot
> use procedure-property, use a function as a key to hash maps etc. If
> this patch goes you need to forbid usage
> of procedures as keys to hashmap, nuke procedure properties and friends or
> mark it as internal to avoid luring schemers into using a faulty method.
> This patch improves the use of higher order functions
> not risk it. For example I often classify functions into different
> categories and maintain this information as a property on the function via
> a hashmap. This is a quite natural way of programming. Without it you need
> to put the procedures in a datastructure and track that datastructure that
> will uglify a lot of code. It is manageable but when the opposite is
> similarly speeded code but much nicer and enjoyable code with absolutely no
> risk in
> higher order functionality countrary as you state (because higher order
> worked flawlessly before in guile and the patch is restoring that).
>
> On Tue, Jan 14, 2020 at 5:07 PM Mikael Djurfeldt <mikael@djurfeldt.com>
> wrote:
>
>> Hmm... it seems like both Stefan and you have interpreted my post exactly
>> the opposite way compared to how it was meant. :)
>>
>> I completely agree that procedure equality is not strongly connected to
>> the first citizen-ness.
>>
>> What I wanted to say is that I probably prefer you to *reverse* the
>> recent patch because I prefer to have good optimization also when
>> procedures are referenced by value in more than one non-operator position.
>> I prefer this over having (eq? p p) => #t for the reasons I stated.
>>
>> Best regards,
>> Mikael
>>
>> Den tis 14 jan. 2020 15:33Andy Wingo <wingo@pobox.com> skrev:
>>
>>> On Tue 14 Jan 2020 13:18, Mikael Djurfeldt <mikael@djurfeldt.com>
>>> writes:
>>>
>>> > I probably don't have a clue about what you are talking about (or at
>>> > least hope so), but this---the "eq change"---sounds scary to me.
>>> >
>>> > One of the *strengths* of Scheme is that procedures are first class
>>> > citizens. As wonderfully show-cased in e.g. SICP this can be used to
>>> > obtain expressive and concise programs, where procedures can occur
>>> > many times as values outside operator position.
>>> >
>>> > I would certainly *not* want to trade in an important optimization
>>> > step in those cases to obtain intuitive procedure equality. The risk
>>> > is then that you would tend to avoid passing around procedures as
>>> > values.
>>>
>>> Is this true?
>>>
>>>   (eq? '() '())
>>>
>>> What about this?
>>>
>>>   (eq? '(a) '(a))
>>>
>>> And yet, are datums not first-class values?  What does being first-class
>>> have to do with it?
>>>
>>> Does it matter whether it's eq? or eqv?
>>>
>>> What about:
>>>
>>>   (eq? (lambda () 10) (lambda () 10))
>>>
>>> What's the difference?
>>>
>>> What's the difference in the lambda calculus between "\x.f x" and "f"?
>>>
>>> What if in a partial evaluator, you see a `(eq? x y)`, and you notice
>>> that `x' is bound to a lambda expression?  Can you say anything about
>>> the value of the expression?
>>>
>>> Does comparing procedures for equality mean anything at all?
>>> https://cs-syd.eu/posts/2016-01-17-function-equality-in-haskell
>>>
>>> Anyway :)  All that is a bit of trolling on my part.  What I mean to say
>>> is that instincts are tricky when it comes to object identity, equality,
>>> equivalence, and especially all of those combined with procedures.  The
>>> R6RS (what can be more Schemely than a Scheme standard?) makes this
>>> clear.
>>>
>>> All that said, with the recent patch, I believe that Guile 3.0's
>>> behavior preserves your intuitions.  Bug reports very welcome!
>>>
>>> Andy
>>>
>>

[-- Attachment #2: Type: text/html, Size: 6326 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 16:47               ` Mikael Djurfeldt
@ 2020-01-14 17:21                 ` Taylan Kammer
  2020-01-14 17:27                 ` Stefan Israelsson Tampe
  1 sibling, 0 replies; 24+ messages in thread
From: Taylan Kammer @ 2020-01-14 17:21 UTC (permalink / raw)
  To: mikael, Stefan Israelsson Tampe; +Cc: guile-devel

During the R7RS-small discussion, I remember Will Clinger suggesting to
keep (eqv? proc1 proc2) => #t but unspecifying it for eq?.  Would that
help in Guile's case?  I don't remember the exact optimization he
suggested this for.


- Taylan

On 14.01.2020 17:47, Mikael Djurfeldt wrote:
> It might be reasonable to keep the patch for now in order not to
> introduce novel behavior this short before the 3.0 release.
> 
> But especially in light of Andy's work, I do regret introducing
> procedure-properties. It's a more LISPy feature than Schemey. Did you
> see Andy's argument about procedure equality below?
> 
> I would have preferred to postpone the release and drop procedure
> equality, procedure-properties etc. It can be handy and convenient, yes,
> but there is a reason why R6RS didn't require (eq? p p) -> #t...
> 
> Best regards,
> Mikael
> 
> On Tue, Jan 14, 2020 at 5:37 PM Stefan Israelsson Tampe
> <stefan.itampe@gmail.com <mailto:stefan.itampe@gmail.com>> wrote:
> 
> 
> 
>     ---------- Forwarded message ---------
>     From: *Stefan Israelsson Tampe* <stefan.itampe@gmail.com
>     <mailto:stefan.itampe@gmail.com>>
>     Date: Tue, Jan 14, 2020 at 5:23 PM
>     Subject: Re: GNU Guile 2.9.9 Released [beta]
>     To: Mikael Djurfeldt <mikael@djurfeldt.com
>     <mailto:mikael@djurfeldt.com>>
> 
> 
>     This is how it always have been in guile, without this patch you
>     cannot use procedure-property, use a function as a key to hash maps
>     etc. If this patch goes you need to forbid usage
>     of procedures as keys to hashmap, nuke procedure properties and
>     friends or mark it as internal to avoid luring schemers into using a
>     faulty method. This patch improves the use of higher order functions
>     not risk it. For example I often classify functions into different
>     categories and maintain this information as a property on the
>     function via a hashmap. This is a quite natural way of programming.
>     Without it you need
>     to put the procedures in a datastructure and track that
>     datastructure that will uglify a lot of code. It is manageable but
>     when the opposite is similarly speeded code but much nicer and
>     enjoyable code with absolutely no risk in
>     higher order functionality countrary as you state (because higher
>     order worked flawlessly before in guile and the patch is restoring
>     that).
> 
>     On Tue, Jan 14, 2020 at 5:07 PM Mikael Djurfeldt
>     <mikael@djurfeldt.com <mailto:mikael@djurfeldt.com>> wrote:
> 
>         Hmm... it seems like both Stefan and you have interpreted my
>         post exactly the opposite way compared to how it was meant. :)
> 
>         I completely agree that procedure equality is not strongly
>         connected to the first citizen-ness.
> 
>         What I wanted to say is that I probably prefer you to *reverse*
>         the recent patch because I prefer to have good optimization also
>         when procedures are referenced by value in more than one
>         non-operator position. I prefer this over having (eq? p p) => #t
>         for the reasons I stated.
> 
>         Best regards,
>         Mikael
> 
>         Den tis 14 jan. 2020 15:33Andy Wingo <wingo@pobox.com
>         <mailto:wingo@pobox.com>> skrev:
> 
>             On Tue 14 Jan 2020 13:18, Mikael Djurfeldt
>             <mikael@djurfeldt.com <mailto:mikael@djurfeldt.com>> writes:
> 
>             > I probably don't have a clue about what you are talking
>             about (or at
>             > least hope so), but this---the "eq change"---sounds scary
>             to me.
>             >
>             > One of the *strengths* of Scheme is that procedures are
>             first class
>             > citizens. As wonderfully show-cased in e.g. SICP this can
>             be used to
>             > obtain expressive and concise programs, where procedures
>             can occur
>             > many times as values outside operator position.
>             >
>             > I would certainly *not* want to trade in an important
>             optimization
>             > step in those cases to obtain intuitive procedure
>             equality. The risk
>             > is then that you would tend to avoid passing around
>             procedures as
>             > values.
> 
>             Is this true?
> 
>               (eq? '() '())
> 
>             What about this?
> 
>               (eq? '(a) '(a))
> 
>             And yet, are datums not first-class values?  What does being
>             first-class
>             have to do with it?
> 
>             Does it matter whether it's eq? or eqv?
> 
>             What about:
> 
>               (eq? (lambda () 10) (lambda () 10))
> 
>             What's the difference?
> 
>             What's the difference in the lambda calculus between "\x.f
>             x" and "f"?
> 
>             What if in a partial evaluator, you see a `(eq? x y)`, and
>             you notice
>             that `x' is bound to a lambda expression?  Can you say
>             anything about
>             the value of the expression?
> 
>             Does comparing procedures for equality mean anything at all?
>             https://cs-syd.eu/posts/2016-01-17-function-equality-in-haskell
> 
>             Anyway :)  All that is a bit of trolling on my part.  What I
>             mean to say
>             is that instincts are tricky when it comes to object
>             identity, equality,
>             equivalence, and especially all of those combined with
>             procedures.  The
>             R6RS (what can be more Schemely than a Scheme standard?)
>             makes this
>             clear.
> 
>             All that said, with the recent patch, I believe that Guile 3.0's
>             behavior preserves your intuitions.  Bug reports very welcome!
> 
>             Andy
> 



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 16:47               ` Mikael Djurfeldt
  2020-01-14 17:21                 ` Taylan Kammer
@ 2020-01-14 17:27                 ` Stefan Israelsson Tampe
  1 sibling, 0 replies; 24+ messages in thread
From: Stefan Israelsson Tampe @ 2020-01-14 17:27 UTC (permalink / raw)
  To: Mikael Djurfeldt; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 5569 bytes --]

I'm not stupid and I don't see any good reason why you cannot maintain a
way to keep function identities. I could go as far as having a primitive to
mark a procedure for keeping the identity.

But No  No, please apply the patch. For example the nice thing with python
on guile is that python functions is also scheme functions and vice versa
without the procedure identity (eq? f f) = #t you will need
to wrap every single scheme call and totally destroy python on guile. It
will be a mess. So I would probably not make a python on guile release for
guile 3.0. Also Not guile log because it also
is highly invested using procedures as hash keys. What I would probably do
is to apply wingos patch and demand other who want guile 3.0 and python on
guile and guile-log to do the same.

Regards
Stefan

On Tue, Jan 14, 2020 at 5:47 PM Mikael Djurfeldt <mikael@djurfeldt.com>
wrote:

> It might be reasonable to keep the patch for now in order not to introduce
> novel behavior this short before the 3.0 release.
>
> But especially in light of Andy's work, I do regret introducing
> procedure-properties. It's a more LISPy feature than Schemey. Did you see
> Andy's argument about procedure equality below?
>
> I would have preferred to postpone the release and drop procedure
> equality, procedure-properties etc. It can be handy and convenient, yes,
> but there is a reason why R6RS didn't require (eq? p p) -> #t...
>
> Best regards,
> Mikael
>
> On Tue, Jan 14, 2020 at 5:37 PM Stefan Israelsson Tampe <
> stefan.itampe@gmail.com> wrote:
>
>>
>>
>> ---------- Forwarded message ---------
>> From: Stefan Israelsson Tampe <stefan.itampe@gmail.com>
>> Date: Tue, Jan 14, 2020 at 5:23 PM
>> Subject: Re: GNU Guile 2.9.9 Released [beta]
>> To: Mikael Djurfeldt <mikael@djurfeldt.com>
>>
>>
>> This is how it always have been in guile, without this patch you cannot
>> use procedure-property, use a function as a key to hash maps etc. If
>> this patch goes you need to forbid usage
>> of procedures as keys to hashmap, nuke procedure properties and friends
>> or mark it as internal to avoid luring schemers into using a faulty method.
>> This patch improves the use of higher order functions
>> not risk it. For example I often classify functions into different
>> categories and maintain this information as a property on the function via
>> a hashmap. This is a quite natural way of programming. Without it you need
>> to put the procedures in a datastructure and track that datastructure
>> that will uglify a lot of code. It is manageable but when the opposite is
>> similarly speeded code but much nicer and enjoyable code with absolutely no
>> risk in
>> higher order functionality countrary as you state (because higher order
>> worked flawlessly before in guile and the patch is restoring that).
>>
>> On Tue, Jan 14, 2020 at 5:07 PM Mikael Djurfeldt <mikael@djurfeldt.com>
>> wrote:
>>
>>> Hmm... it seems like both Stefan and you have interpreted my post
>>> exactly the opposite way compared to how it was meant. :)
>>>
>>> I completely agree that procedure equality is not strongly connected to
>>> the first citizen-ness.
>>>
>>> What I wanted to say is that I probably prefer you to *reverse* the
>>> recent patch because I prefer to have good optimization also when
>>> procedures are referenced by value in more than one non-operator position.
>>> I prefer this over having (eq? p p) => #t for the reasons I stated.
>>>
>>> Best regards,
>>> Mikael
>>>
>>> Den tis 14 jan. 2020 15:33Andy Wingo <wingo@pobox.com> skrev:
>>>
>>>> On Tue 14 Jan 2020 13:18, Mikael Djurfeldt <mikael@djurfeldt.com>
>>>> writes:
>>>>
>>>> > I probably don't have a clue about what you are talking about (or at
>>>> > least hope so), but this---the "eq change"---sounds scary to me.
>>>> >
>>>> > One of the *strengths* of Scheme is that procedures are first class
>>>> > citizens. As wonderfully show-cased in e.g. SICP this can be used to
>>>> > obtain expressive and concise programs, where procedures can occur
>>>> > many times as values outside operator position.
>>>> >
>>>> > I would certainly *not* want to trade in an important optimization
>>>> > step in those cases to obtain intuitive procedure equality. The risk
>>>> > is then that you would tend to avoid passing around procedures as
>>>> > values.
>>>>
>>>> Is this true?
>>>>
>>>>   (eq? '() '())
>>>>
>>>> What about this?
>>>>
>>>>   (eq? '(a) '(a))
>>>>
>>>> And yet, are datums not first-class values?  What does being first-class
>>>> have to do with it?
>>>>
>>>> Does it matter whether it's eq? or eqv?
>>>>
>>>> What about:
>>>>
>>>>   (eq? (lambda () 10) (lambda () 10))
>>>>
>>>> What's the difference?
>>>>
>>>> What's the difference in the lambda calculus between "\x.f x" and "f"?
>>>>
>>>> What if in a partial evaluator, you see a `(eq? x y)`, and you notice
>>>> that `x' is bound to a lambda expression?  Can you say anything about
>>>> the value of the expression?
>>>>
>>>> Does comparing procedures for equality mean anything at all?
>>>> https://cs-syd.eu/posts/2016-01-17-function-equality-in-haskell
>>>>
>>>> Anyway :)  All that is a bit of trolling on my part.  What I mean to say
>>>> is that instincts are tricky when it comes to object identity, equality,
>>>> equivalence, and especially all of those combined with procedures.  The
>>>> R6RS (what can be more Schemely than a Scheme standard?) makes this
>>>> clear.
>>>>
>>>> All that said, with the recent patch, I believe that Guile 3.0's
>>>> behavior preserves your intuitions.  Bug reports very welcome!
>>>>
>>>> Andy
>>>>
>>>

[-- Attachment #2: Type: text/html, Size: 7625 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 16:36             ` Stefan Israelsson Tampe
@ 2020-01-14 17:56               ` Stefan Israelsson Tampe
  0 siblings, 0 replies; 24+ messages in thread
From: Stefan Israelsson Tampe @ 2020-01-14 17:56 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1832 bytes --]

I'll apply your patch and see if it works. After reading it more carefully
I think I understand your decrement count. Nice code!

On Tue, Jan 14, 2020 at 5:36 PM Stefan Israelsson Tampe <
stefan.itampe@gmail.com> wrote:

> 1. I don't understand why you decrement the count in operator position
> 2. I don't see that you increase the count when a procedure is returned
> from a lambda
>
> Example
> (define (f a) a)
> (define (g)
>     (hash-set! H f 1) ; (*)
>     (f 1)) ;(**)
> (define (h)
>    (pk (hash-ref H f))) ; (*)
>
> (g)
> (h)
>
> => '(#f) as count in your patch is counted up twice (*) and down ones (**)
> in total count = 1 so you will not maintain the identity of f and you will
> get a bad printout
>
> Then we also have this example
> (define (f a) a)
> (define (u) f)
> (define (g) (hash-set! H (u) 1))
> (define (h) (pk (hash-ref H f)))
>
> (g)
> (h)
> This will again print (#f) as the count will be 1.
>
> /Stefan
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> On Tue, Jan 14, 2020 at 5:16 PM Andy Wingo <wingo@pobox.com> wrote:
>
>> On Tue 14 Jan 2020 15:47, Stefan Israelsson Tampe <
>> stefan.itampe@gmail.com> writes:
>>
>> > Yes, your patch is indicating when you should use the same identity
>> > e.g. all uses of procedures in a higher order position such as an
>> > argument or a return value. But I looked at your patch, which looks
>> > good but I saw that for operator position you decrease the count. Why?
>> > Also you are free to use one version in argument / return position and
>> > another one in operator position the only limit is to use the same
>> > identity for on operator position. Finally don't you need to count
>> > usage of returning a variable as well?
>>
>> Not sure what the bug is.  Do you have a test case that shows the
>> behavior that you think is not good?
>>
>> Andy
>>
>

[-- Attachment #2: Type: text/html, Size: 3104 bytes --]

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-13  8:39 Andy Wingo
                   ` (2 preceding siblings ...)
  2020-01-13 21:32 ` Stefan Israelsson Tampe
@ 2020-01-14 20:13 ` Stefan Israelsson Tampe
  2020-01-14 21:17   ` Andy Wingo
  3 siblings, 1 reply; 24+ messages in thread
From: Stefan Israelsson Tampe @ 2020-01-14 20:13 UTC (permalink / raw)
  To: Andy Wingo; +Cc: Guile User, guile-sources, guile-devel

Okey, here is another case that fails with the patch that prevents identity
misses for toplevels e.g we need similar fixes for anonymous functions.

(define-module (b)
  #:export (q))

(define h (make-hash-table))
(define (method f)
  (hash-set! h f 1)
  f)
(define q (method (lambda x x)))

(pk (hash-ref h q))

This fails with (#f)

I solved this in my code by placing the method function in another module.



On Mon, Jan 13, 2020 at 9:39 AM Andy Wingo <wingo@pobox.com> wrote:

> We are pleased to announce GNU Guile release 2.9.9.  This is the ninfth
> and probably final pre-release of what will eventually become the 3.0
> release series.
>
> Compared to the current stable series (2.2.x), the future Guile 3.0 adds
> support for just-in-time native code generation, speeding up all Guile
> programs.  See the NEWS extract at the end of the mail for full details.
>
> Compared to the previous prerelease (2.9.7), Guile 2.9.8 fixes a number
> of bugs.
>
> The current plan is to make a 3.0.0 final release on 17 January 2020.
> If there's nothing wrong with this prerelease, 3.0.0 will be essentially
> identical to 2.9.9.  With that in mind, please test and make sure the
> release works on your platform!  Please send any build reports (success
> or failure) to guile-devel@gnu.org, along with platform details.  You
> can file a bug by sending mail to bug-guile@gnu.org.
>
> The Guile web page is located at http://gnu.org/software/guile/, and
> among other things, it contains a copy of the Guile manual and pointers
> to more resources.
>
> Guile is an implementation of the Scheme programming language, packaged
> for use in a wide variety of environments.  In addition to implementing
> the R5RS, R6RS, and R7RS Scheme standards, Guile includes a module
> system, full access to POSIX system calls, networking support, multiple
> threads, dynamic linking, a foreign function call interface, powerful
> string processing, and HTTP client and server implementations.
>
> Guile can run interactively, as a script interpreter, and as a Scheme
> compiler to VM bytecode.  It is also packaged as a library so that
> applications can easily incorporate a complete Scheme interpreter/VM.
> An application can use Guile as an extension language, a clean and
> powerful configuration language, or as multi-purpose "glue" to connect
> primitives provided by the application.  It is easy to call Scheme code
> From C code and vice versa.  Applications can add new functions, data
> types, control structures, and even syntax to Guile, to create a
> domain-specific language tailored to the task at hand.
>
> Guile 2.9.9 can be installed in parallel with Guile 2.2.x; see
>
> http://www.gnu.org/software/guile/manual/html_node/Parallel-Installations.html
> .
>
> A more detailed NEWS summary follows these details on how to get the
> Guile sources.
>
> Here are the compressed sources:
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.lz   (10MB)
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.xz   (12MB)
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.gz   (21MB)
>
> Here are the GPG detached signatures[*]:
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.lz.sig
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.xz.sig
>   http://alpha.gnu.org/gnu/guile/guile-2.9.9.tar.gz.sig
>
> Use a mirror for higher download bandwidth:
>   http://www.gnu.org/order/ftp.html
>
> Here are the SHA256 checksums:
>
>   59f136e5db36eba070cc5e68784e632dc2beae4b21fd6c7c8ed2c598cc992efc
> guile-2.9.9.tar.lz
>   bf71920cfa23e59fc6257bee84ef4dfeccf4f03e96bb8205592e09f9dbff2969
> guile-2.9.9.tar.xz
>   eafe394cf99d9dd1ab837e6d1b9b2b8d9f0cd13bc34e64ca92456ce1bc2b1925
> guile-2.9.9.tar.gz
>
> [*] Use a .sig file to verify that the corresponding file (without the
> .sig suffix) is intact.  First, be sure to download both the .sig file
> and the corresponding tarball.  Then, run a command like this:
>
>   gpg --verify guile-2.9.9.tar.gz.sig
>
> If that command fails because you don't have the required public key,
> then run this command to import it:
>
>   gpg --keyserver keys.gnupg.net --recv-keys
> 4FD4D288D445934E0A14F9A5A8803732E4436885
>
> and rerun the 'gpg --verify' command.
>
> This release was bootstrapped with the following tools:
>   Autoconf 2.69
>   Automake 1.16.1
>   Libtool 2.4.6
>   Gnulib v0.1-1157-gb03f418
>   Makeinfo 6.7
>
> An extract from NEWS follows.
>
>
> Changes since alpha 2.9.8 (since 2.9.7):
>
> * Notable changes
>
> ** `define-module' #:autoload no longer pulls in the whole module
>
> One of the ways that a module can use another is "autoloads".  For
> example:
>
>   (define-module (a) #:autoload (b) (make-b))
>
> In this example, module `(b)' will only be imported when the `make-b'
> identifier is referenced.  However besides the imprecision about when a
> given binding is actually referenced, this mechanism used to cause the
> whole imported module to become available, not just the specified
> bindings.  This has now been changed to only import the specified bindings.
>
> This is a backward-incompatible change.  The fix is to mention all
> bindings of interest in the autoload clause.  Feedback is welcome.
>
> ** `guard' no longer unwinds the stack for clause tests
>
> SRFI-34, and then R6RS and R7RS, defines a `guard' form that is a
> shorthand for `with-exception-handler'.  The cond-like clauses for the
> exception handling are specified to run with the continuation of the
> `guard', while any re-propagation of the exception happens with the
> continuation of the original `raise'.
>
> In practice, this means that one needs full `call-with-continuation' to
> implement the specified semantics, to be able to unwind the stack to the
> cond clauses, then rewind if none match.  This is not only quite
> expensive, it is also error-prone as one usually doesn't want to rewind
> dynamic-wind guards in an exceptional situation.  Additionally, as
> continuations bind tightly to the current thread, it makes it impossible
> to migrate a subcomputation with a different thread if a `guard' is live
> on the stack, as is done in Fibers.
>
> Guile now works around these issues by running the test portion of the
> guard expressions within the original `raise' continuation, and only
> unwinding once a test matches.  This is an incompatible semantic change
> but we think the situation is globally much better, and we expect that
> very few people will be affected by the change.
>
> ** Improve SRFI-43 vector-fill!
>
> SRFI-43 vector-fill! now has the same performance whether an optional
> range is provided or not, and is also provided in core.  As a side
> effect, vector-fill! and vector_fill_x no longer work on non-vector
> rank-1 arrays.  Such cases were handled incorrectly before; for example,
> prior to this change:
>
>   (define a (make-vector 10 'x))
>   (define b (make-shared-array a (lambda (i) (list (* 2 i))) 5))
>   (vector-fill! b 'y)
>
>   => #1(y y y x x)
>
> This is now an error.  Instead, use array-fill!.
>
> ** Fix compilation on 32-bit targets
>
> A compile error introduced in 2.9.3 prevented compilation on 32-bit
> targets.  This has been fixed.
>
> ** Fix a bug in closure conversion
>
> Thanks for Stefan Israelsson Tampe for the report.
>
> ** Fix omission in R7RS support
>
> Somewhat embarrassingly, the R7RS support added earlier in 2.9 failed to
> include an implementation of `define-library'.  This oversight has been
> corrected :)
>
> ** Optionally allow duplicate field names in core records
>
> See the new #:allow-duplicate-field-names? keyword argument to
> `make-record-type' in the manual, for more.  This restores a needed
> feature to R6RS records.
>
> ** Fix default value of thread-local fluids
>
> Before, `fluid-ref' on an unbound thread-local fluid was returning #f
> instead of the default value of the fluid.  Thanks to Rob Browning for
> the fix!
>
>
>
> Changes in alpha 2.9.x (since the stable 2.2 series):
>
> * Notable changes
>
> ** Just-in-time code generation
>
> Guile programs now run up to 4 times faster, relative to Guile 2.2,
> thanks to just-in-time (JIT) native code generation.  Notably, this
> brings the performance of "eval" as written in Scheme back to the level
> of "eval" written in C, as in the days of Guile 1.8.
>
> See "Just-In-Time Native Code" in the manual, for more information.  JIT
> compilation will be enabled automatically and transparently.  To disable
> JIT compilation, configure Guile with `--enable-jit=no' or
> `--disable-jit'.  The default is `--enable-jit=auto', which enables the
> JIT if it is available.  See `./configure --help' for more.
>
> JIT compilation is enabled by default on x86-64, i686, ARMv7, and
> AArch64 targets.
>
> ** Lower-level bytecode
>
> Relative to the virtual machine in Guile 2.2, Guile's VM instruction set
> is now more low-level.  This allows it to express more advanced
> optimizations, for example type check elision or integer
> devirtualization, and makes the task of JIT code generation easier.
>
> Note that this change can mean that for a given function, the
> corresponding number of instructions in Guile 3.0 may be higher than
> Guile 2.2, which can lead to slowdowns when the function is interpreted.
> We hope that JIT compilation more than makes up for this slight
> slowdown.
>
> ** Interleaved internal definitions and expressions allowed
>
> It used to be that internal definitions had to precede all expressions
> in their bodies.  This restriction has been relaxed.  If an expression
> precedes an internal definition, it is treated as if it were a
> definition of an unreferenced variable.  For example, the expression
> `(foo)' transforms to the equivalent of `(define _ (begin (foo) #f))',
> if it precedes other definitions.
>
> This change improves the readability of Guile programs, as it used to be
> that program indentation tended to increase needlessly to allow nested
> `let' and `letrec' to re-establish definition contexts after initial
> expressions, for example for type-checks on procedure arguments.
>
> ** Record unification
>
> Guile used to have a number of implementations of structured data types
> in the form of "records": a core facility, SRFI-9 (records), SRFI-35
> (condition types -- a form of records) and R6RS records.  These
> facilities were not compatible, as they all were built in different
> ways.  This had the unfortunate corollary that SRFI-35 conditions were
> not compatible with R6RS conditions.  To fix this problem, we have now
> added the union of functionality from all of these record types into
> core records: single-inheritance subtyping, mutable and immutable
> fields, and so on.  See "Records" in the manual, for full details.
>
> R6RS records, SRFI-9 records, and the SRFI-35 and R6RS exception types
> have been accordingly "rebased" on top of core records.
>
> ** Reimplementation of exceptions
>
> Since Guile's origins 25 years ago, `throw' and `catch' have been the
> primary exception-handling primitives.  However these primitives have
> two problems.  One is that it's hard to handle exceptions in a
> structured way using `catch'.  Few people remember what the
> corresponding `key' and `args' are that an exception handler would see
> in response to a call to `error', for example.  In practice, this
> results in more generic catch-all exception handling than one might
> like.
>
> The other problem is that `throw', `catch', and especially
> `with-throw-handler' are quite unlike what the rest of the Scheme world
> uses.  R6RS and R7RS, for example, have mostly converged on
> SRFI-34-style `with-exception-handler' and `raise' primitives, and
> encourage the use of SRFI-35-style structured exception objects to
> describe the error.  Guile's R6RS layer incorporates an adapter between
> `throw'/`catch' and structured exception handling, but it didn't apply
> to SRFI-34/SRFI-35, and we would have to duplicate it for R7RS.
>
> In light of these considerations, Guile has now changed to make
> `with-exception-handler' and `raise-exception' its primitives for
> exception handling and defined a hierarchy of R6RS-style exception types
> in its core.  SRFI-34/35, R6RS, and the exception-handling components of
> SRFI-18 (threads) have been re-implemented in terms of this core
> functionality.  There is also a a compatibility layer that makes it so
> that exceptions originating in `throw' can be handled by
> `with-exception-hander', and vice-versa for `raise-exception' and
> `catch'.
>
> Generally speaking, users will see no difference.  The one significant
> difference is that users of SRFI-34 will see more exceptions flowing
> through their `with-exception-handler'/`guard' forms, because whereas
> before they would only see exceptions thrown by SRFI-34, now they will
> see exceptions thrown by R6RS, R7RS, or indeed `throw'.
>
> Guile's situation is transitional.  Most exceptions are still signalled
> via `throw'.  These will probably migrate over time to
> `raise-exception', while preserving compatibility of course.
>
> See "Exceptions" in the manual, for full details on the new API.
>
> ** Optimization of top-level bindings within a compilation unit
>
> At optimization level 2 and above, Guile's compiler is now allowed to
> inline top-level definitions within a compilation unit.  See
> "Declarative Modules" in the manual, for full details.  This change can
> improve the performance of programs with many small top-level
> definitions by quite a bit!
>
> At optimization level 3 and above, Guile will assume that any top-level
> binding in a declarative compilation unit that isn't exported from a
> module can be completely inlined into its uses.  (Prior to this change,
> -O3 was the same as -O2.)  Note that with this new
> `seal-private-bindings' pass, private declarative bindings are no longer
> available for access from the first-class module reflection API.  The
> optimizations afforded by this pass can be useful when you need a speed
> boost, but having them enabled at optimization level 3 means they are
> not on by default, as they change Guile's behavior in ways that users
> might not expect.
>
> ** By default, GOOPS classes are not redefinable
>
> It used to be that all GOOPS classes were redefinable, at least in
> theory.  This facility was supported by an indirection in all "struct"
> instances, even though only a subset of structs would need redefinition.
> We wanted to remove this indirection, in order to speed up Guile
> records, allow immutable Guile records to eventually be described by
> classes, and allow for some optimizations in core GOOPS classes that
> shouldn't be redefined anyway.
>
> Thus in GOOPS now there are classes that are redefinable and classes
> that aren't.  By default, classes created with GOOPS are not
> redefinable.  To make a class redefinable, it should be an instance of
> `<redefinable-class>'.  See "Redefining a Class" in the manual for more
> information.
>
> ** Define top-level bindings for aux syntax: `else', `=>', `...', `_'
>
> These auxiliary syntax definitions are specified to be defined in the
> R6RS and the R7RS.  They were previously unbound, even in the R6RS
> modules.  This change is not anticipated to cause any incompatibility
> with existing Guile code, and improves things for R6RS and R7RS users.
>
> ** Conventional gettext alias is now `G_'
>
> Related to the last point, since the "Fix literal matching for
> module-bound literals" change in the 2.2 series, it was no longer
> possible to use the conventional `_' binding as an alias for `gettext',
> because a local `_' definition would prevent `_' from being recognized
> as auxiliary syntax for `match', `syntax-rules', and similar.  The new
> recommended conventional alias for `gettext' is `G_'.
>
> ** Add --r6rs command-line option
>
> The new `install-r6rs!' procedure adapts Guile's defaults to be more
> R6RS-compatible.  This procedure is called if the user passes `--r6rs'
> as a command-line argument.  See "R6RS Incompatibilities" in the manual,
> for full details.
>
> ** Add support for R7RS
>
> Thanks to Göran Weinholt and OKUMURA Yuki, Guile now implements the R7RS
> modules.  As the R7RS library syntax is a subset of R6RS, to use R7RS
> you just `(import (scheme base))' and off you go.  As with R6RS also,
> there are some small lexical incompatibilities regarding hex escapes;
> see "R6RS Support" in the manual, for full details.
>
> Also as with R6RS, there is an `install-r7rs!' procedure and a `--r7rs'
> command-line option.
>
> ** Add #:re-export-and-replace argument to `define-module'
>
> This new keyword specifies a set of bindings to re-export, but also
> marks them as intended to replace core bindings.  See "Creating Guile
> Modules" in the manual, for full details.
>
> Note to make this change, we had to change the way replacement flags are
> stored, to being associated with modules instead of individual variable
> objects.  This means that users who #:re-export an imported binding that
> was already marked as #:replace by another module will now see warnings,
> as they need to use #:re-export-and-replace instead.
>
> ** `iota' in core and SRFI-1 `iota' are the same
>
> Previously, `iota' in core would not accept start and step arguments and
> would return an empty list for negative count. Now there is only one
> `iota' function with the extended semantics of SRFI-1.  Note that as an
> incompatible change, core `iota' no longer accepts a negative count.
>
> * New deprecations
>
> ** scm_t_uint8, etc deprecated in favor of C99 stdint.h
>
> It used to be that Guile defined its own `scm_t_uint8' because C99
> `uint8_t' wasn't widely enough available.  Now Guile finally made the
> change to use C99 types, both internally and in Guile's public headers.
>
> Note that this also applies to SCM_T_UINT8_MAX, SCM_T_INT8_MIN, for intN
> and uintN for N in 8, 16, 32, and 64.  Guile also now uses ptrdiff_t
> instead of scm_t_ptrdiff, and similarly for intmax_t, uintmax_t,
> intptr_t, and uintptr_t.
>
> ** The two-argument form of `record-constructor'
>
> Calling `record-constructor' with two arguments (the record type and a
> list of field names) is deprecated.  Instead, call with just one
> argument, and provide a wrapper around that constructor if needed.
>
> * Incompatible changes
>
> ** All deprecated code removed
>
> All code deprecated in Guile 2.2 has been removed.  See older NEWS, and
> check that your programs can compile without linker warnings and run
> without runtime warnings.  See "Deprecation" in the manual.
>
> In particular, the function `scm_generalized_vector_get_handle' which
> was deprecated in 2.0.9 but remained in 2.2, has now finally been
> removed. As a replacement, use `scm_array_get_handle' to get a handle
> and `scm_array_handle_rank' to check the rank.
>
> ** Remove "self" field from vtables and "redefined" field from classes
>
> These fields were used as part of the machinery for class redefinition
> and is no longer needed.
>
> ** VM hook manipulation simplified
>
> The low-level mechanism to instrument a running virtual machine for
> debugging and tracing has been simplified.  See "VM Hooks" in the
> manual, for more.
>
> * Changes to the distribution
>
> ** New effective version
>
> The "effective version" of Guile is now 3.0, which allows parallel
> installation with other effective versions (for example, the older Guile
> 2.2).  See "Parallel Installations" in the manual for full details.
> Notably, the `pkg-config' file is now `guile-3.0', and there are new
> `guile-3' and `guile-3.0' features for `cond-expand'.
>
>


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 16:03         ` Mikael Djurfeldt
       [not found]           ` <CAGua6m2cm2iFTf6EB4MuDR4qNDJ1kt1EjwRCBgLKS+qxncxp+w@mail.gmail.com>
@ 2020-01-14 20:54           ` Andy Wingo
  1 sibling, 0 replies; 24+ messages in thread
From: Andy Wingo @ 2020-01-14 20:54 UTC (permalink / raw)
  To: Mikael Djurfeldt; +Cc: Andy Wingo, guile-devel

On Tue 14 Jan 2020 17:03, Mikael Djurfeldt <mikael@djurfeldt.com> writes:

> Hmm... it seems like both Stefan and you have interpreted my post
> exactly the opposite way compared to how it was meant. :)

Hah!  My apologies :)

> What I wanted to say is that I probably prefer you to *reverse* the
> recent patch because I prefer to have good optimization also when
> procedures are referenced by value in more than one non-operator
> position. I prefer this over having (eq? p p) => #t for the reasons I
> stated.

I understand this also!  However what Stefan is saying echoes what I've
heard from other people.  There are some cases where eta-converting all
lexical procedure references helps nobody -- it makes (eqv? p p) be
false in places where many people expect it would be true, without
enabling significant optimizations.  In that case, the choice is pretty
clear.  But if there are significant optimizations left on the table, I
would hesitate a lot before chasing an ideal of procedure identity in
cases where the procedure's behavior cannot possibly differ.  Anyway
that's not where we are currently, thankfully!

Cheers,

Andy



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 20:13 ` Stefan Israelsson Tampe
@ 2020-01-14 21:17   ` Andy Wingo
  2020-01-14 21:48     ` Stefan Israelsson Tampe
  0 siblings, 1 reply; 24+ messages in thread
From: Andy Wingo @ 2020-01-14 21:17 UTC (permalink / raw)
  To: Stefan Israelsson Tampe; +Cc: Guile User, guile-devel

On Tue 14 Jan 2020 21:13, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:

> Okey, here is another case that fails with the patch that prevents identity misses for toplevels e.g we need similar fixes for anonymous functions.
>
> (define-module (b)
>   #:export (q))
>
> (define h (make-hash-table))
> (define (method f)
>   (hash-set! h f 1)
>   f)
> (define q (method (lambda x x)))
>
> (pk (hash-ref h q))
>
> This fails with (#f)
>
> I solved this in my code by placing the method function in another module.

Interestingly, this case is not really related to the declarative
bindings optimization, letrectification, or other things.  It's the same
as:

  (let ((h (make-hash-table)))
    (define (method f)
      (hash-set! h f 1)
      f)
    (let* ((q (let ((f (lambda x x)))
                (method f))))
      (pk (hash-ref h q))))

I.e. no top-level bindings are needed.  This prints #f in releases as
old as 2.0.14 and probably older :)  It optimizes as:

  (let* ((h (make-hash-table))
         (q (begin
              (hash-set! h (lambda x x) 1)
              (lambda x x))))
    (pk (hash-ref h q)))

So, not a recent change.  Of course we can discuss whether it's the
right thing or not!

Andy



^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 21:17   ` Andy Wingo
@ 2020-01-14 21:48     ` Stefan Israelsson Tampe
  2020-01-15 19:58       ` Andy Wingo
  0 siblings, 1 reply; 24+ messages in thread
From: Stefan Israelsson Tampe @ 2020-01-14 21:48 UTC (permalink / raw)
  To: Andy Wingo; +Cc: Guile User, guile-devel

I have a fix for this by pushing the method idiom to another module. So it
is not a burning issue.

Strange that I did not dee this error before in the 2.x series ever. Isn't
it so that
for procedures define in a (let () ...) the case you are
mentioning happened before but
I was on the impression that no inlining was done for defines on
different places in the
module before

I also have a request to be able to silence warning of unbound variables
that is not so for e.g. a python
implementation. Previously I modded message.scm and compile.scm so that I
can add symbols that will not
issue a warning when compiling.

It consists of

(define %dont-warn-list (make-fluid '()))

;; Exported
(define %add-to-warn-list
  (lambda (sym)
    (fluid-set! (M %dont-warn-list)
                (cons sym
                      (fluid-ref
                       (M %dont-warn-list))))))

And inside the warning emitter one checks for matches in the don't warn
list and mute if it matches.

For this to work we need also change the compiler as in compile.scm (see
the %dont-warn-list line ...

(define-set-C compile-file
  (lambda* (file #:key
                 (output-file      #f)
                 (from             ((C default-language)   file))
                 (to               'bytecode)
                 (env              ((C default-environment) from))
                 (opts             '())
                 (canonicalization 'relative))

    (with-fluids (((C %in-compile                     )   #t               )
 ((C %in-file                        )   file             )
                  ((@@ (system base message) %dont-warn-list)
                                                          '()              )
                  ((C %file-port-name-canonicalization)   canonicalization )
                  ((C %current-file%                  )   file))


It would also be fabulous to direct the compiler depeneding on extensions
of the file which is also something I have to make the python environment
nicer.






On Tue, Jan 14, 2020 at 10:17 PM Andy Wingo <wingo@pobox.com> wrote:

> On Tue 14 Jan 2020 21:13, Stefan Israelsson Tampe <stefan.itampe@gmail.com>
> writes:
>
> > Okey, here is another case that fails with the patch that prevents
> identity misses for toplevels e.g we need similar fixes for anonymous
> functions.
> >
> > (define-module (b)
> >   #:export (q))
> >
> > (define h (make-hash-table))
> > (define (method f)
> >   (hash-set! h f 1)
> >   f)
> > (define q (method (lambda x x)))
> >
> > (pk (hash-ref h q))
> >
> > This fails with (#f)
> >
> > I solved this in my code by placing the method function in another
> module.
>
> Interestingly, this case is not really related to the declarative
> bindings optimization, letrectification, or other things.  It's the same
> as:
>
>   (let ((h (make-hash-table)))
>     (define (method f)
>       (hash-set! h f 1)
>       f)
>     (let* ((q (let ((f (lambda x x)))
>                 (method f))))
>       (pk (hash-ref h q))))
>
> I.e. no top-level bindings are needed.  This prints #f in releases as
> old as 2.0.14 and probably older :)  It optimizes as:
>
>   (let* ((h (make-hash-table))
>          (q (begin
>               (hash-set! h (lambda x x) 1)
>               (lambda x x))))
>     (pk (hash-ref h q)))
>
> So, not a recent change.  Of course we can discuss whether it's the
> right thing or not!
>
> Andy
>


^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: GNU Guile 2.9.9 Released [beta]
  2020-01-14 21:48     ` Stefan Israelsson Tampe
@ 2020-01-15 19:58       ` Andy Wingo
  0 siblings, 0 replies; 24+ messages in thread
From: Andy Wingo @ 2020-01-15 19:58 UTC (permalink / raw)
  To: Stefan Israelsson Tampe; +Cc: Andy Wingo, Guile User, guile-devel

On Tue 14 Jan 2020 22:48, Stefan Israelsson Tampe <stefan.itampe@gmail.com> writes:

> Strange that I did not dee this error before in the 2.x series
> ever. Isn't it so that for procedures define in a (let () ...) the
> case you are mentioning happened before but I was on the impression
> that no inlining was done for defines on different places in the
> module before

This is correct, yes.  The declarative bindings optimization makes
toplevel bindings more like letrec bindings, which exposes them to this
other optimization.  My point was that since Guile 2.0, procedure
identity has not been firmly guaranteed in all cases.

Andy



^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2020-01-15 19:58 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-01-14 14:39 GNU Guile 2.9.9 Released [beta] dsmich
  -- strict thread matches above, loose matches on Subject: below --
2020-01-13  8:39 Andy Wingo
2020-01-13  8:44 ` Andy Wingo
2020-01-13 17:26 ` John Cowan
2020-01-13 21:32 ` Stefan Israelsson Tampe
2020-01-13 21:33   ` Stefan Israelsson Tampe
2020-01-14  9:57   ` Stefan Israelsson Tampe
2020-01-14 11:16   ` Andy Wingo
2020-01-14 12:18     ` Mikael Djurfeldt
2020-01-14 13:25       ` Stefan Israelsson Tampe
2020-01-14 14:32       ` Andy Wingo
2020-01-14 14:47         ` Stefan Israelsson Tampe
2020-01-14 16:15           ` Andy Wingo
2020-01-14 16:36             ` Stefan Israelsson Tampe
2020-01-14 17:56               ` Stefan Israelsson Tampe
2020-01-14 16:03         ` Mikael Djurfeldt
     [not found]           ` <CAGua6m2cm2iFTf6EB4MuDR4qNDJ1kt1EjwRCBgLKS+qxncxp+w@mail.gmail.com>
2020-01-14 16:36             ` Fwd: " Stefan Israelsson Tampe
2020-01-14 16:47               ` Mikael Djurfeldt
2020-01-14 17:21                 ` Taylan Kammer
2020-01-14 17:27                 ` Stefan Israelsson Tampe
2020-01-14 20:54           ` Andy Wingo
2020-01-14 20:13 ` Stefan Israelsson Tampe
2020-01-14 21:17   ` Andy Wingo
2020-01-14 21:48     ` Stefan Israelsson Tampe
2020-01-15 19:58       ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).