On Sat, Feb 10, 2024 at 04:07:12PM +0200, Al wrote:
> On 2024-02-10 15:38, Peter Bex wrote:
>
> > That's because you're using fixnum mode. As I explained, using literals
> > that might be too large for fixnums break the fixnum mode's premise that
> > everything must be a fixnum.
>
> Oh. So it
On 2024-02-10 15:38, Peter Bex wrote:
That's because you're using fixnum mode. As I explained, using literals
that might be too large for fixnums break the fixnum mode's premise that
everything must be a fixnum.
Oh. So it refuses to emit C code that might break on 32-bit at runtime
(silent
On Sat, Feb 10, 2024 at 02:32:16PM +0200, Al wrote:
> That would be fine but where does that happen? csc actually barfs on my
> Scheme code (as per the subject line), instead of emitting C code to
> encode/decode into a string at runtime, as you mention.
That's because you're using fixnum mode.
L
> On 10 Feb 2024, at 13:30, Peter Bex wrote:
>
> On Sat, Feb 10, 2024 at 12:24:36PM +, Pietro Cerutti wrote:
>> This is not how I reason about referential transparency. It is a property of
>> functions applied to values, not variables.
>> The fact that you can define x to different
On 2024-02-10 14:28, Peter Bex wrote:
CHICKEN's type system differentiates between "pure" and "clean". A "pure"
Hope this clears things up a bit!
Ah, that's what I was looking for. So I shouldn't declare procedures
using vector-ref as pure, but as clean. Now how do I declare a scheme
On 2024-02-10 13:00, Peter Bex wrote:
These so-called "big-fixnums" are compiled into a string literal which gets
decoded on-the-fly at runtime into either a fixnum (on 64-bit) or a bignum (on 32-bit).
That would be fine but where does that happen? csc actually barfs on my
Scheme code (as
On Sat, Feb 10, 2024 at 12:24:36PM +, Pietro Cerutti wrote:
> This is not how I reason about referential transparency. It is a property of
> functions applied to values, not variables.
> The fact that you can define x to different values or even rebind it in the
> scope of a let binding
On Sat, Feb 10, 2024 at 11:12:04AM +, siiky via wrote:
> Hi Al,
>
> > On a practical level, I would be sad if vector-ref, for example, was
> > "impure", and thus compiling a vector-ref invalidated all previously-
> > checked globals for the current scope. Likewise, I would prefer to
> >
> On 10 Feb 2024, at 11:10, Al wrote:
>
> On 2024-02-10 11:53, Pietro Cerutti wrote:
>
>> I don't see why vector-ref would be any less pure than, say, a let binding.
>> Or do you mean vector-set! ?
>>
> vector-ref, applied to a global, could return different values even when
> called with
> On 10 Feb 2024, at 11:10, Al wrote:
>
> On 2024-02-10 11:53, Pietro Cerutti wrote:
>
>> I don't see why vector-ref would be any less pure than, say, a let binding.
>> Or do you mean vector-set! ?
>>
> vector-ref, applied to a global, could return different values even when
> called with
Hi Al,
On a practical level, I would be sad if vector-ref, for example, was
"impure", and thus compiling a vector-ref invalidated all previously-
checked globals for the current scope. Likewise, I would prefer to
declare a procedure using vector-ref as pure, to let csc know that it
does not
On Sat, Feb 10, 2024 at 08:12:38AM +0200, Al wrote:
> 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
On 2024-02-10 11:53, Pietro Cerutti wrote:
I don't see why vector-ref would be any less pure than, say, a let
binding. Or do you mean vector-set! ?
vector-ref, applied to a global, could return different values even when
called with the same arguments. Between calls, some other code could
> On 10 Feb 2024, at 10:45, Al wrote:
>
> On 2024-02-10 11:20, Pietro Cerutti wrote:
>
>> Both Haskell and CHICKEN ultimately compile to obiect code. That is not
>> important: the important thing is the abstract machine you're programming
>> against. This is why I specified "observable" in
> On 9 Feb 2024, at 21:06, Al wrote:
> 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?
Back to your original question, to make sure I understand:
On 2024-02-10 11:20, Pietro Cerutti wrote:
Both Haskell and CHICKEN ultimately compile to obiect code. That is
not important: the important thing is the abstract machine you're
programming against. This is why I specified "observable" in my
previous reply.
I agree. And if we step out of the
> On 10 Feb 2024, at 09:27, Al wrote:
>
> On 2024-02-10 10:13, Pietro Cerutti wrote:
>
>> I don't get your question: those two things are the same thing :)
>>
>> Referential transparency means you can substitute an expression with its
>> expansion down to a value. If anything happening in
On 2024-02-10 10:13, Pietro Cerutti wrote:
I don't get your question: those two things are the same thing :)
Referential transparency means you can substitute an expression with
its expansion down to a value. If anything happening in between causes
(observable *) changes, you can't do it
> On 10 Feb 2024, at 09:06, Al wrote:
>
>
>>> * only side-effect free, or ...
>>>
>>> * also return the same value when called with the same arguments?
>>
>> The first implies the second: to be able to choose from a set of return
>> values for the same given argument, you do need to have
* only side-effect free, or ...
* also return the same value when called with the same arguments?
The first implies the second: to be able to choose from a set of
return values for the same given argument, you do need to have
side-effects, e.g., interact with a RNG which maintains state,
20 matches
Mail list logo