1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
Commit graph

21299 commits

Author SHA1 Message Date
Morgan Smith
a58c2d21f4
doc: Remove reference to long-gone tutorial.
The tutorial was removed in commit f75c5849cd.

* doc/README: Remove reference to a tutorial that no longer exists

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Morgan Smith
6ea7c858a6
HACKING: Update mailing list URL.
* HACKING: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Morgan Smith
93119355b9
doc: Remove all remaining references to GDS.
This finished what this previous commit was meant to do:
767dbb1af3

* .gitignore: Remove "gds-test.debug" and "gds-test.transcript".
* doc/ref/Makefile.am (PICTURES): Remove "gds.eps", "gds.pdf", and "gds.txt".
* doc/ref/gds.dia:
* doc/ref/gds.eps:
* doc/ref/gds.pdf:
* doc/ref/gds.txt: Delete files

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Hannes Müller
ff4d79074c
libguile/scm.h: Allow compilation with ‘-Werror=undef’.
* libguile/scm.h: BUILDING_LIBGUILE is not always defined. This is
signaled by -Werror=undef in code using libguile. This patch fixes
commit dc3a3a84f9
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Hannes Müller
5abb24efe4
Fix make-custom-port in case encoding is #f
* module/ice-9/custom-ports.scm (make-custom-port): Code fails if
(fluid-ref %default-port-encoding) returns #f. In fact this was the
case why readline support on MSYS2 failed for guile 3.0.10, ref.
https://github.com/msys2/MSYS2-packages/issues/5079
But later used canonicalize-encoding is prepared to handle #f for
encoding. So allow encoding to also handle this case.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Werner Lemberg
25c9440e4d
Add LIB_GETRANDOM to Libs.private in .pc files
The omission was discovered while cross-compiling LilyPond with mingw
11.0.1: without this addition, linking with libguile causes the error

  undefined reference to `BCryptGenRandom'

* meta/Makefile.am (dependency_substitutions): Add ‘LIB_GETRANDOM’.
* meta/guile-3.0-uninstalled.pc.in (Libs.private): Likewise.
* meta/guile-3.0.pc.in (Libs.private): Likewise.
* NEWS: Update.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2025-02-28 22:12:03 +01:00
Ludovic Courtès
b3a4dea943
doc: Update ‘release.org’.
* doc/release.org: Update links to CI and the web site.  Clarify what’s
optional.  Remove references to discontinued services.
2025-02-28 22:12:02 +01:00
Tomas Volf
c1353972ee srfi-19: Fix ~V converter in date->string.
The ~V is supposed to print ISO week number, not a week number.  This
commit fixes that.

* module/srfi/srfi-19.scm (date-week-number-iso): New procedure taken
  from the reference implementation.
  (directives)<#\V>: Use it.
* test-suite/tests/srfi-19.test ("date->string ~V"): Add tests taken
  from the reference test suite.
* doc/ref/srfi-modules.texi (SRFI-19 Date to string): Mention ISO-8601
  in description for ~V.

Fixes <https://bugs.gnu.org/74841>.
Edited by lloda <lloda@sarc.name>.
2025-02-28 10:28:06 +01:00
Tomas Volf
46a0ee7779 Fix typos in comments.
* module/sxml/xpath.scm: Fix typo in a comment.
* module/sxml/upstream/SXPath-old.scm: Same.
* doc/ref/sxml.texi (SXPath): Reflect in the documentation.
* doc/ref/texinfo.texi (string-utils): Fix same typo.
* module/texinfo/string-utils.scm (expand-tabs): Same.

Fixes <https://bugs.gnu.org/76621>.
Edited by lloda <lloda@sarc.name>.
2025-02-28 09:58:29 +01:00
Andy Wingo
c8a169d388 Fix string-utf8-length to have unboxed representation
* module/language/cps/utils.scm (primcall-raw-representations): Add
string-utf8-length.
2025-02-20 12:38:28 +01:00
Andy Wingo
5d3f561d7d Merge remote-tracking branch 'lightening/main' 2025-01-29 16:52:29 +01:00
Andy Wingo
d418f80803 Merge branch 'main' into 'main'
RISC-V Support

See merge request wingo/lightening!14
2025-01-29 15:43:49 +00:00
Ekaitz Zarraga
105a9c7958 riscv: error if not little endian 2025-01-29 14:53:04 +01:00
Ekaitz Zarraga
7c20ba7767 riscv: float/double call convention implementation
RISC-V uses a0-a7 registers for argument passing. Float/double arguments
use f0-f7 first and continue in a0-a7 if needed.

Once registers are consumed, stack is used.

This commit changes how lightening passes arguments in order to allow
this behavior.
2025-01-29 14:53:04 +01:00
Ekaitz Zarraga
ce8b8e4778 riscv: change stack alignment to 16 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
285cfd284a riscv: fix hi20/lo12 calculations for negative numbers 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
cbda249dc5 riscv: better movi 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
746660bf08 riscv: movi: use addiw in RV64 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
019cd02410 riscv: movi: sign extend hi 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
741af987a3 riscv: fix load size for ldxi instructions 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
33eddc7b62 riscv: simplify load from pool 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
8c7990d4a1 riscv: fix literal pool guard jump address calc 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
fb527804f9 riscv: add get_callr_temp 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
c6008fd0ab riscv: fix the B and J type size check 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
93380fc377 riscv: clean patch jumps 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
f6f2a757c3 riscv: don't pack veneers, use padding 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
76549a674a riscv: Pack the veneer struct 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
775d11b21e riscv: Add fence 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
3edd48b046 Fix CI 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
797fe5067c Add RISCV to CI and makefile 2025-01-29 14:28:13 +01:00
Ekaitz Zarraga
cbd72e71a7 RISC-V Support 2025-01-29 14:01:52 +01:00
Ekaitz Zarraga
23c4e36dca Makefile: RISCV support and optional vars
Optional variables are needed because the structure of the makefile
is prepared to run on Guix but Guix doesn't support RISCV yet, so it's
better to set them as optional and let the user decide how do they want
to compile this thing.
2025-01-29 14:01:52 +01:00
Andy Wingo
41a2a60fa1 Merge branch 'reinterpret' into 'main'
Add movr_f_i, movr_i_f, movr_d_l, movr_l_d

See merge request wingo/lightening!27
2025-01-29 11:17:25 +00:00
Andy Wingo
11918685e1 Add movr_f_i, movr_i_f, movr_d_l, movr_l_d
These move values verbatim between FPRs and GPRs.
2025-01-29 12:14:59 +01:00
Andy Wingo
624d78625b Avoid accidentally-quadratic use of intmap-keys
* module/language/cps/utils.scm (compute-reachable-functions): Rework to
not call intmap-keys on a data structure that we are building up in a
loop.
2025-01-27 10:24:01 +01:00
Maxim Cournoyer
f109baebc0 doc/srfi-64: Fix typos and add examples.
* doc/ref/srfi-modules.texi (SRFI-64 Writing Basic Test Suites): Fix
  typo.  Add default test runner example.  Add test-approximate and
  test-error examples.  Document valid error types in Guile for test-error.

  (SRFI-64 Conditonal Test Suites and Other Advanced Features): Fix typo.

Fixes <https://bugs.gnu.org/75041>.

Suggested-by: Arne Babenhauserheide <arne_bab@web.de>
2025-01-24 10:54:01 +01:00
Rob Browning
48b1c4eff4 fport_print: handle ttyname ENODEV
In some situations, ttyname may return ENODEV even though isatty is
true.  From ttyname(3):

  A process that keeps a file descriptor that refers to a pts(4) device
  open when switching to another mount namespace that uses a different
  /dev/ptmx instance may still accidentally find that a device path of
  the same name for that file descriptor exists.  However, this device
  path refers to a different device and thus can't be used to access the
  device that the file descriptor refers to.  Calling ttyname() or
  ttyname_r() on the file descriptor in the new mount namespace will
  cause these functions to return NULL and set errno to ENODEV.

Observed in a Debian riscv64 porterbox schroot.

When ttyname fails with ENODEV, just include the file descriptor integer
value instead.  Call ttyname() directly to avoid having to catch the
ENODEV.

* libguile/fports.c (fport_print): fall back to the integer fd when
ttyname() fails with ENODEV.
2025-01-23 12:49:33 -06:00
Rob Browning
63756efbc5 Don't hold lock during scm_async_tick in readdir and ttyname
Only hold scm_i_misc_mutex while making the C calls.  This also avoids
the need for a dynamic-wind.  Add SCM_I_LOCKED_SYSCALL (similar to
SCM_SYSCALL) to handle the locking and EINTR loop.

libguile/filesys.c (scm_readdir): rely on SCM_I_LOCKED_SYSCALL to limit
locking.
libguile/filesys.c (scm_ttyname): rely on SCM_I_LOCKED_SYSCALL to limit
locking.
libguile/syscalls.h: add SCM_I_LOCKED_SYSCALL.
2025-01-22 19:24:07 -06:00
Andy Wingo
4a6347c371 Optimize ordering edges in fix-letrec
* module/language/tree-il/fix-letrec.scm (compute-sccs): Instead of
depending on all previous complex bindings, we can just depend on the
most recent one.  Decreases the graph size.
2025-01-22 16:51:28 +01:00
Andy Wingo
47dce42edb Use transient intset/intmap optimizations when computing SCCs
* module/language/cps/graphs.scm (compute-sorted-strongly-connected-components):
Use more transient data structures.
2025-01-22 16:50:52 +01:00
Andy Wingo
60c1e5cc42 Fix bad algorithmic growth in fix-letrec
We were using list sets, which when you end up with thousands of
bindings in an SCC reaches the point where we are off the quadratic end
of the curve.  Fix to use intsets and intmaps instead.

* module/language/tree-il/fix-letrec.scm (compute-ids): New function.
(compute-referenced-and-assigned): Rename from analyze-lexicals, and
compute intsets.
(make-compute-free-variables): Rename from free-variables, return a
procedure instead of a hash table, and use intsets.  Use a global cache
to avoid quadratic behavior with regard to binding depth.
(compute-complex): Compute a global set of "complex" variables, as an
intset.
(compute-sccs): Use intsets and intmaps to compute the free-variable and
ordering edges.
(fix-scc, fix-term): Refactorings.
(reorder-bindings): Avoid a linear search.
(fix-letrec): Refactor.
2025-01-22 14:56:32 +01:00
Andy Wingo
787e49f137 Fix a check in the Tree-IL verifier
* module/language/tree-il/debug.scm (verify-tree-il): Fix
pattern-matching.
2025-01-22 12:14:30 +01:00
Yuval Langer
0b501477f9 Fix faulty SRFI-31 example. 2025-01-20 10:52:49 +01:00
Daniel Llorens
bf3c632b82 Fix bug in srfi-111 box printer
* module/srfi/srfi-111.scm: Add missing port.
* test-suite/tests/srfi-111.test: Test.
2025-01-16 15:47:03 +01:00
Mikael Djurfeldt
8ac25f3fae README: Add dependency on autopoint 2025-01-13 22:51:35 +01:00
Tomas Volf
f6359a4715
doc: srfi-19: Use day' instead of date' for `make-date'.
Looking at the SRFI-19 specification, the argument is called `day', not
`date'.  Even the accessor is called `date-day'.  So adjust the
documentation to match.

Also adjust the (web http) module, which was using `date' as well.

* doc/ref/srfi-modules.texi (SRFI-19 Date): Use `day' instead of `date'.
* module/web/http.scm (parse-rfc-822-date, parse-rfc-850-date)
(parse-asctime-date): Same.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-22 22:46:11 +01:00
Maxim Cournoyer
98ffeacf2c
doc: Document SRFI-64.
This is an import of the 'Abstract', 'Rationale', and 'Specification'
sections from the upstream specification text, with some manual
adjustment.

* doc/ref/srfi-modules.texi (SRFI 64): New subsection.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-22 22:46:11 +01:00
Ekaitz Zarraga
c9d0a0c48c
doc: Add explanation on how to avoid escaping in SXML
* doc/ref/sxml.texi (Reading and Writing XML): Add explanation on using
  a procedure to avoid escaping.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-22 22:46:11 +01:00
Ekaitz Zarraga
d987e7e7cb
doc: Fix typo in SXML section.
* doc/ref/sxml.texi (Reading and Writing XML): Remove "."

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-22 22:45:59 +01:00
Ekaitz Zarraga
6750f6cc80
PEG: string-peg: Add HTML5 grammar test.
* test-suite/tests/peg.test (comment-grammar): Z can be anything.
("simple comment with forbidden char"): Remove.
(html-grammar, html-example): New variables.
("parsing with complex grammars"): New test.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-22 22:17:39 +01:00