Re: (declare (pure ...))

2024-02-10 Thread Al
ame thing, so either the one or the other should stand. Though I'm not sure what "local variables or data contained in local variables" actually means. I think it means you can't "set!" globals. -- Al

Re: "cannot coerce inexact literal to fixnum"

2024-02-10 Thread Al
around and meaningful conversion to Scheme ints, but I don't think that exists. It does that (more or less), as I explained. And it *wouldn't* work, Yeah, I understand why now. I suppose the best way is to use foreign values. Maybe I should switch the arithmetic code to C too. Thanks. -- Al

Re: "cannot coerce inexact literal to fixnum"

2024-02-10 Thread Al
rwise, how do I write Scheme code to truncate a signed number to unsigned32? Resort to foreign values as I did above (or write foreign functions)? -- Al

Re: (declare (pure ...))

2024-02-10 Thread Al
#purity says: "Using the (... --> ...) syntax, you can declare a procedure to not modify local state, i.e. not causing any side-effects on local variables or data contained in local variables". -- Al

Re: (declare (pure ...))

2024-02-10 Thread Al
procedure means (can memoize the value or not, need to re-check globals or closures afterwards or not etc). -- Al

Re: (declare (pure ...))

2024-02-10 Thread Al
Now how do I declare a scheme procedure as "clean" -- I don't see that in the manual? I'll check out the source, though grep'ing for vector-ref is obviously not an option. -- Al

Re: "cannot coerce inexact literal to fixnum"

2024-02-09 Thread Al
On 2024-02-10 02:42, Al wrote: ... if I enable fixnum, csc chokes on both the third and fourth display's with: "Error: cannot coerce inexact literal `2147483647' to fixnum". It compiles and runs fine if those lines are commented out (or if fixnum is disabled). So the error

Re: (declare (pure ...))

2024-02-10 Thread Al
that vector-ref, or some procedure that uses vector-ref on a global identifier (but does not call set! / vector-set! on globals) does not, uh, modify any globals. -- Al

compiler types: records / collections interaction

2024-02-09 Thread Al
to compile unsafe code everywhere, just where  I'm using the correct types. Thanks, Al

(declare (pure ...))

2024-02-09 Thread Al
Hi, what does (declare (pure ..)) mean to csc? Is the function supposed to be * only side-effect free, or ... * also return the same value when called with the same arguments? Thanks, Al

"cannot coerce inexact literal to fixnum"

2024-02-09 Thread Al
g here. Tried with both 5.3.0 and 5.3.1-pre. -- Al

compile-time deserialization

2023-12-26 Thread Al
Hi, suppose I need to reference data from "file.txt" in my Scheme program. I could use read-char / read / open-input-file etc (or other (chicken io) procedures) to read the the contents of the file into a variable. However, such deserialization happens at run-time. If I compile my program

chicken (un)install, deployment

2024-02-03 Thread Al
(which can then be processed by "chicken-install -from-list"). But still it installs unconditionally. I could add an extra step to check if "csi import egg... What to do? Maybe I should convert my project to egg format? -- Al

csi from git version: slow?

2024-02-24 Thread Al
rsion" / debug flags / expensive interpreter features that differ compared to stable? I customized only config.make by changing the C_COMPILER and PREFIX. Thanks, Al

Re: "cannot coerce inexact literal to fixnum"

2024-02-24 Thread Al
for these, I wonder what type the indexes should be declared to minimize typechecks at the interface between C and Chicken...? Perhaps even how to make them inline-able to simple C array ops? Best, Al

integer64 foreign type ( manual/Foreign%20type%20specifiers.html )

2024-03-02 Thread Al
"C_int64_to_num" which seems to return bignums when out of fixnum range; no flonums, no gaps, values print out as integers, (exact? ...) prints #t even for (u)int64-max. Is the documentation out of date? Thanks, Al

Re: integer64 foreign type ( manual/Foreign%20type%20specifiers.html )

2024-03-02 Thread Al
e building with C_COMPILER_OPTIMIZATION_OPTIONS set to -march=native. This flag (maybe any flags, I don't know yet) not only make csi but also csc output twice as slow for my program, for all 4 CC / chicken-version combos (on my platform, CPU etc -- I'll write more in the other thread). -- Al

passing constants as "textual literals" to foreign-lambdas?

2024-03-04 Thread Al
ign-primitive / foreign-lambda* specializations of compute() with certain constant args. This doesn't seem so nice though. Thanks, Al