Commit Graph

228 Commits

Author SHA1 Message Date
Denis Buzdalov
da916b68d4 [ fix ] Correctly manage the empty file case while reading a file 2023-12-21 13:30:30 -06:00
Denis Buzdalov
b495fe83f0 [ fix ] Support waiting for popen2-created processes
This fixes problem of creation the garbage of zombie processes on POSIX
systems. This also makes behaviour of `popen2` identical in Windows,
namely, all resources are freed only when waiting, giving at the same
time an ability to observe the exit code afterwards.
2023-12-19 23:03:31 +03:00
Steve Dunham
e2ceb97fd8 [ gambit ] fix pack / unpack segfault with gambit scheme 2023-11-29 15:32:17 +00:00
CodingCellist
d80bc1537d
[ base ] Add bindings for ieee Double number consts (#3116) 2023-11-09 14:01:40 +00:00
Aleksei Volkov
af7ba2fa67
[ ttc ] Compare modification time with nanosecond precision (#3046) 2023-08-31 11:55:57 +01:00
Jens Petersen
48dbc3251b implement DESTDIR support for distros
both 'make install' and 'idris2 --install*' should respect DESTDIR now
2023-08-22 16:44:13 +01:00
Steve Dunham
dc43ce2056 [ fix ] fix scheme002 test on windows 2023-08-03 23:16:14 +01:00
Steve Dunham
8d7791ba55
[ base ] Add getTermCols and getTermLines to base library and fix pri… (#3009) 2023-07-18 09:42:47 -05:00
Steve Dunham
9544162bc4
[ new ] Add support for bi-directional pipes on POSIX systems (resolves #2935) (#2944) 2023-04-15 09:39:17 -05:00
Steve Dunham
081938bad8 [ base ] Add support for unbuffered stdin 2023-03-07 13:28:25 -08:00
G. Allais
310a8f12cd
[ new ] missing buffer primitives (#2893) 2023-02-26 17:50:52 +00:00
Zoe Stafford
ff822a747b
Js char io (#2887)
* Implement `{get,put}Char` for javascript backend

* Update changelog
2023-02-13 15:48:07 +00:00
Mathew Polzin
2e9c7fb8b5
Create a separate Makefile for the Idris 2 support libraries. (#2869)
* Create a separate Makefile for the Idris 2 support libraries.

* Update INSTALL.md

* satisfy natural language linter

* Add to CHANGELOG

* Update CHANGELOG.md
2023-02-09 16:49:49 -06:00
Mathew Polzin
ad12f8335c
[ new ] popen/pclose for the NodeJS backend. (#2857)
* implement popen and pclose (to an extent) for NodeJS

* bring node020 back into tests.

* ah, I see what was being done here. Fix the idris for the test.

* fix test's unreachable clause warning

* fix expectation

* Add note to CHANGELOG

* small tweaks to get popen into merge-ready state.
2023-01-30 09:38:42 -06:00
Zoe Stafford
ae974af1d1
Use built-in bigint truncation on js backend 2023-01-08 12:50:26 +00:00
Zoe Stafford
ae2d4efc17 add javascript support to System.Clock
This may behave incorrectly when used with web workers
2022-12-22 11:47:44 +00:00
Johann Rudloff
018ef1fd8b [chez] Detect AArch64 machine/OS combinations correctly 2022-12-20 20:28:26 +01:00
Kamil Shakirov
73733f03ff Cleanup after rebase 2022-11-15 16:38:13 +01:00
Kamil Shakirov
502aa6f4fc Do not install papers library 2022-11-15 16:38:13 +01:00
Kamil Shakirov
dccb80d0bf [ fix ] Fix Makefile targets for linear and papers libraries 2022-11-15 16:38:13 +01:00
Hattori, Hiroki
5c9f8e36a1
[ RefC ] Add 16 and 32 bit access to base/Data.Buffer . (#2609)
* Fix symbom mangling

* Revert "Fix symbom mangling"

This reverts commit 6481e80155.

* Fix typo

* [RefC] Add missed prims of setBuffer* .

* [ fix ] formatting

* [ re #2609 ] Use 'UInt' instead of 'Word'

More descriptive/to the point / Less assumed knowledge.

There are no *LE suffixes for UInt8, since endianness is to do with
multiple bytes and UInt8 is a single one.

Co-authored-by: Guillaume Allais <guillaume.allais@ens-lyon.org>
Co-authored-by: Thomas E. Hansen <teh6@st-andrews.ac.uk>
2022-11-15 12:15:06 +01:00
CodingCellist
9cd92f1fc4
[ re #2742 ] Count no. processors online rather than configured (#2754)
* [ re #2742 ] Count no. processors online rather than configured

Seems there might be some oddities with what is reported when, e.g.
reporting the maximum number of processors supported by the currently
installed motherboard, regardless of which processor is socketed.

* [ #2754 ] Update CHANGELOG
2022-11-11 11:12:24 +01:00
Gregory Werbin
e0d6d0881e Remove unnecessary use of LDFLAGS 2022-11-11 09:33:09 +01:00
Gregory Werbin
1020437aad Use CPPFLAGS when needed 2022-11-11 09:33:09 +01:00
Sam Phillips
795eeb23c5 Make Racket backend channels behave same as Chez.
Add tests for both that demonstrate equivalent behavior.
2022-10-04 10:24:27 +02:00
Ben Hormann
ca5f1f1938 [ fix #2279 ] Racket bootstrap unsafe-fx 2022-09-23 18:55:31 +01:00
running-grass
36f930ef87
[ fix ] typo (#2656) 2022-09-21 12:14:49 +01:00
Guillaume Allais
c38e6bcfa9 [ lint ] once and for all 2022-09-21 12:12:34 +01:00
stefan-hoeck
188de8b4cc [ fix ] issue 2616 2022-09-12 02:10:13 -07:00
Hattori, Hiroki
4ba651bb8e
[RefC] Add sysCodegen primitive to avoid compiler error. (#2613) 2022-09-08 00:44:14 +01:00
ProofOfKeags
68a144bf18
Support System.Signal for node backend (#2556)
* first pass at signal support for node backend

* change signal values to int's

* implements defaultSignal

* return -1 as expected by calling API if any error is raised by nodejs runtime

* finishes signal support for nodejs

* extract repetitive foreign import identifiers

* fix comments
2022-07-10 10:18:58 +01:00
Jesse Nava
db13a35bf5 [ fix ] Ensure casting from String to Double results in floating numbers on scheme backends 2022-05-09 18:36:17 +01:00
György Kurucz
7a5f63eab0 [ fix ] Add missing cases for BITS types in extractInt
e79e4277 ("[ fix ] Make Bits types use int switch statement in RefC")
made the RefC backend generate code calling `extractInt` with Bits
types, bit did not add the extra cases to `extractInt`. This commit adds
the missing cases.

Fixes #2452
2022-05-04 10:18:58 +01:00
György Kurucz
7618491536 [ refactor ] Use switch statement in extractInt in the RefC runtime
Modern compilers should be smart enough regardless and generate
efficient code for the sequence of ifs, this is really just a syntax
change to make the code shorter.
2022-05-04 10:18:58 +01:00
György Kurucz
a05f091a90 [ refactor ] Format support/refc/runtime.c with clang-format 2022-05-04 10:18:58 +01:00
vfrinken
b1f45f2748
RefC backend improvements (#2425)
* RefC backend improvements

1. OnCollect had the wrong number of arguments. The code creator expects
   3 arguments, but onCollect in prim.h expected 4 arguments. The first of which
   was an erased arguments. That is now fixed.

2. OnCollect did not call `newReference` when creating a new reference to the pointer
   and the freeing function

3. OnCollect and OnCollectAny still had a spurious printf statement

Those issues have been fixed, the test case can be found in
  tests/refc/garbageCollect

4. The IORef mechanism expects that the %World token will be passed around
   consistently. This is not the case. States in Control.App make use of
   IORefs, but the function created from Control.App.prim_app_bind
   had the world token erased to NULL.
   Now, IORefs are managed using a global variable,
   IORef_Storage * global_IORef_Storage;
   referenced in cBackend.h, defined in the created .c file, and set to NULL
   in main();

5. While multithreading and forking is still not supported, compiling a program
   that makes use of Control.App demands a C implementation of prim_fork.
   Files support/refc/threads.c and support/refc/threads.h provide a
   dummy implementation for it, so that Control.App programs compile and run.

A test for these 2 issues is given in tests/refc/issue2424

* format changes

to make the linter happy

* format changes

to make the linter happy

* format changes

to make the linter happy

* spelling mistake braket -> bracket

Co-authored-by: Volkmar Frinken <volkmar@onutechnology.com>
2022-04-27 13:59:32 +01:00
Zoe Stafford
68bcacf3ec
[base] add missing node ffi functions (#2427) 2022-04-22 15:45:52 +01:00
Guillaume Allais
b4662a8537 [ fix ] show keywords & bound variables 2022-04-14 12:17:11 +01:00
Mathew Polzin
c91a768486
System NodeJS additions (#2401) 2022-04-07 10:09:30 +01:00
stefan-hoeck
51eb854a60 [ fix ] euclidian mod and div for scheme backends 2022-03-08 17:40:29 +00:00
stefan-hoeck
405f80946b [ fix ] euclidian div and mod for JS backend 2022-03-08 17:40:29 +00:00
octeep
768d164ec9
[ network ] add binary support for socket + fix recvAll (#2308) 2022-02-16 20:12:24 +00:00
stefan-hoeck
b50ecb7bc2 [ fix ] add let in JS array conversion 2022-01-21 09:55:34 +00:00
Mathew Polzin
4220c644cf
Add a few missing NodeJS FFI functions to System (#2271)
* support for system command via node backend.

* Add env var set/unset

* fix env unset function

* Update libs/base/System.idr

* modify system test to cover node and chez.

* Add base tests for env get/set
2022-01-18 22:43:03 -08:00
Edwin Brady
26a47ddafe
Make prim_js2idris_array iterative (#2267)
I was getting a stack overflow on the tailrec002 test, caused by this
primitive being recursive. I've made it iterative. I'm no JS expert but
I've tested its behaviour against the old version.
2022-01-16 19:15:26 +00:00
Jason Dagit
6388c75fe0 idris_system: include sys wait 2021-12-25 21:50:56 -08:00
Denis Buzdalov
7834539240
[ re #238 ] Fix program error condition of git diff call in Golden (#2119)
* [ fix ] Fix returned status of the `system` function

* [ re #238 ] Fix program error condition of `git diff` call in `Golden`

According to documentation, not only negative exit code means error
2021-12-22 13:33:37 -08:00
octeep
c14ce31db8 Fix compilation on OpenBSD
Co-authored-by: Johann Rudloff <johann@sinyax.net>

Co-authored-by: Johann Rudloff <johann@sinyax.net>
2021-12-12 11:42:33 -08:00
John Mager
9b2811f263 Make RefC search for files in data dirs
Previously, the RefC files were located in IDRIS2_PREFIX. This is
decoupled to allow users to change the prefix (for ad-hoc library
install locations, for example).
2021-12-10 14:30:46 +00:00
Ben Hormann
d1e90a5b8e
[ performance ] bitops arithmetic speedup (#2081) 2021-11-17 11:54:19 +00:00