Commit Graph

64 Commits

Author SHA1 Message Date
Edwin Brady
8c9eec15a8 Calculate OS from scheme code
This way if you distribute scheme it won't have an OS hard coded based
on the machine it was generated on
2020-05-18 19:03:41 +01:00
Edwin Brady
c7ef44996a Fix codegen in Chez/Racket
Paths in the chez startup script need to be relative to allow it to be
relocatable; racket needs some libraries for buffers.
2020-05-18 09:43:16 +01:00
Edwin Brady
a130952928 Switch buffers back to scheme FFI
It's just easier to deal with the memory management! But we should do
something more flexible here later.
2020-05-17 22:49:41 +01:00
Edwin Brady
4c35210025
Merge pull request #370 from ska80/fix-makefiles
Refactor makefiles
2020-05-16 17:34:51 +01:00
Edwin Brady
560449e087 Check bounds on substring
Fixes #379
2020-05-16 13:50:37 +01:00
Edwin Brady
263d5fa3a1 More system functions
exit, and getting the whole environment
2020-05-16 13:02:48 +01:00
Edwin Brady
dc67515611 Fix and test directory code 2020-05-14 12:40:48 +01:00
Kamil Shakirov
3acd7a0805 Remove Chicken CG deps from CI tests 2020-05-14 01:19:52 +06:00
Kamil Shakirov
0e7e05382a Merge branch 'master' into fix-makefiles 2020-05-13 23:37:40 +06:00
Edwin Brady
68081ed86c Some scheme generation fixes
In racket, importing date and srfi/19 fails. Also some minor edits to
gambit support code.
2020-05-13 12:41:38 +01:00
Edwin Brady
18dff43d2b Move Concurrency.Raw to new FFI 2020-05-13 12:18:21 +01:00
Kamil Shakirov
982629509b Merge branch 'master' into fix-makefiles 2020-05-13 16:25:15 +06:00
Kamil Shakirov
2ad471a5e3 Refactor makefiles to use some common options 2020-05-13 16:23:07 +06:00
Edwin Brady
1b36dd99b1 Move putChar, getChar etc primitives to C
Back ends can still shortcut these and use their own primitives, but
doing things this way gives consistent behaviour between the simple IO
primitives and file IO, and allow us to use stdin/stdout consistently
(e.g. to flush stdout).
This also fixes the behaviour of 'replWith' to be consistent with the
Idris 1 version.
2020-05-13 11:09:05 +01:00
Kamil Shakirov
8261b361e0 Merge branch 'master' into fix-makefiles 2020-05-13 09:05:29 +06:00
Edwin Brady
2d1d7be949 Move directory code to C
...and remove the scheme support for it on the way
2020-05-13 00:09:52 +01:00
Edwin Brady
cadd7e1322 Move more support code to C
System mostly calls C now, except for getting command line arguments,
which may be too back end dependent so maybe we should think of another
approach here later.
2020-05-12 23:31:39 +01:00
Edwin Brady
3ab68fb7c8 Add some more file operations
I've also added some windows support headers (taken straight from the
rts/Idris 1) but I have no way to test, and the Makefile doesn't build
them. Please can someone who is familiar with windows fix this? Thanks!
2020-05-12 22:49:58 +01:00
Edwin Brady
38e43f2c17 Move file management to C support library
This removes the need for some external primitives, and allows the
details to be shared between all the backends (plus we don't have to do
things a certain way just because Scheme chooses to)
2020-05-12 22:35:14 +01:00
Kamil Shakirov
1c8036dc58 Fix building shared libraries with correct extensions 2020-05-12 20:34:49 +06:00
G. Allais
f72f91c67a
[ fix ] build by installing support before tests (#369) 2020-05-12 15:23:42 +01:00
Edwin Brady
7adb4d3342 Move buffer API to C
It's slightly different wrt to file reading and writing, and now
requires the created buffer to be explicitly freed (since unlike Idris 1
the run time can't be told to manage C values) but this makes the buffer
code more portable by not requiring it to run via scheme.
Performance appears more or less the same as before.
2020-05-11 18:10:08 +01:00
Edwin Brady
6681131957 Make a start on C support code
It would be nice to have some common routines that all back ends that
can talk to C can use, rather than relying on Scheme for standard
library code.
2020-05-11 18:10:08 +01:00
Edwin Brady
15c6a0d137 Remove chicken back end
(Which was commented out anyway)
Three scheme back ends is enough to maintain, and Gambit does the same
job as chicken (fast startup of the interpreter, generating via C) but
seems to deal with the code Idris generates better.
2020-05-09 13:57:27 +01:00
Edwin Brady
158b6fb4dc
Merge pull request #347 from ziman/fix-racket
Fix order of arguments in write-string for Racket
2020-05-09 13:10:22 +01:00
Edwin Brady
5a81884d2b
Merge branch 'master' into system.clock 2020-05-09 12:57:10 +01:00
Edwin Brady
600412f9f3
Merge pull request #354 from rgrover/system.random
Add System.Random
2020-05-09 12:54:23 +01:00
Rohit Grover
edb063eb50 Add System.Clock to fetch current time for various clock types. 2020-05-09 17:21:23 +12:00
Rohit Grover
a190408aa1 add srand to allow setting the random seed 2020-05-07 21:41:04 +12:00
Abdelhakim Qbaich
1fb84ca255 Further tweaks to Gambit support file 2020-05-07 03:11:41 -04:00
Rohit Grover
7cfb3419cb Add System.Random 2020-05-06 11:26:58 +12:00
Abdelhakim Qbaich
21ef0ddb43 Improving support file of Gambit 2020-05-03 17:37:39 -04:00
Matus Tejiscak
50c9531efd Fix order of arguments in write-string for Racket. 2020-05-02 19:21:02 +02:00
Abdelhakim Qbaich
3f1a1b4e9b Macro for FFI with C structs on Gambit 2020-05-01 23:27:45 -04:00
Abdelhakim Qbaich
3f1e88814f Vector related fixes for Gambit 2020-05-01 23:27:45 -04:00
Abdelhakim Qbaich
19e78ca3ef Extracting errno for an os-exception in Gambit 2020-05-01 23:27:45 -04:00
Abdelhakim Qbaich
0182c7147a Support library for Gambit Scheme 2020-05-01 23:27:45 -04:00
Kamil Shakirov
cce312bb15 Check for EOF when reading from an input port
1) Check for EOF when reading from an input port (Chez backend).

2) Fix `getLine` to read and return a string without the trailing newline.
2020-04-24 12:32:58 +06:00
Edwin Brady
71cae356e2
Merge pull request #281 from ziman/fix-cast-double-int
Fix cast to integral types
2020-04-21 11:24:09 +01:00
Edwin Brady
8fccd5f2a3 Properly erase constructor arguments
That is, really erase the argument position rather than just putting
'erased there. It doesn't make a huge difference to the generated scheme
performance, but since we can always do this for constructors, we might
as well.
2020-04-19 19:43:51 +01:00
Matus Tejiscak
41ef3fdd2a Don't use exact-floor in cast-string-int. 2020-04-14 22:44:32 +02:00
Matus Tejiscak
c3b6b130fd Also fix up cast-string-int. 2020-04-14 22:44:32 +02:00
Matus Tejiscak
7a3ebd9a2f Use exact-floor. 2020-04-14 22:44:32 +02:00
Matus Tejiscak
18962eeacf Fix casting in integral division. 2020-04-14 22:44:32 +02:00
Matus Tejiscak
cf177f95a4 Fix conversion from Double to integral types. 2020-04-14 22:44:32 +02:00
Edwin Brady
31a2c46383
Merge pull request #250 from ziman/fix-cast
Fix runtime error in `the Int (cast "")`
2020-03-31 18:17:23 +01:00
Edwin Brady
b0e55b53eb A bit more library support 2020-03-30 13:06:59 +01:00
Matus Tejiscak
16e027218b Use cond and equal? in destroy-prefix. 2020-03-29 22:26:42 +02:00
Matus Tejiscak
2cadbd2cd1 Fix runtime error in (the Int (cast "")). 2020-03-29 20:33:46 +02:00
Edwin Brady
2938e86421 Ints in buffers are 32 bit
...for consistency with Idris 1 (probably to be revisited later). So,
when working via the scheme primitives, we need to read/write 32 bits.
2020-03-27 20:54:39 +00:00