[racket-users] Error building racket BC snapshot from source

2020-04-18 Thread bedeke
Hello,

I was trying to build racket snapshot using the using the files on the utah 
server[1].
Afterwards I basically do make && make DESTDIR="${pkgdir}" install

This is part of a PKGBUILD script I have been using reliably on arch for 
the last few years.
However somewhere around the beginning of this month it didn't work, 
Complaining about references
to Chez-Scheme [3]
Using the files on the northwestern server[2], this script does work.
Have the make commands changed?


[1]: 
http://www.cs.utah.edu/plt/snapshots/current/installers/racket-current-src-builtpkgs.tgz
[2]: 
https://plt.eecs.northwestern.edu/snapshots/current/installers/racket-test-current-src-pre-built.tgz
[3]: last part of build output
make[4]: Entering directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
make install-wx_xt
make[5]: Entering directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
make install-common
make[6]: Entering directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
:
make[6]: Leaving directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
cd ..; rm -f "/home/bert/builds/racket-snap/pkg/racket/usr/lib/gracketcgc"
cd ..; rm -f "/home/bert/builds/racket-snap/pkg/racket/usr/lib/gracket"
cd ..; echo 'MROPTIONS=' >> 
"/home/bert/builds/racket-snap/pkg/racket/usr/lib/buildinfo"
cd ..; echo "MRLIBS=" >> 
"/home/bert/builds/racket-snap/pkg/racket/usr/lib/buildinfo"
cd ..; echo "MRLDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro -pthread 
-L../racket" >> "/home/bert/builds/racket-snap/pkg/racket/usr/lib/buildinfo"
cd ..; mkdir -p "/home/bert/builds/racket-snap/pkg/racket/usr/lib";
make[5]: Leaving directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
make install-wx_xt-3m
make[5]: Entering directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
make install-lib-3m-wx_xt
make[6]: Entering directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
:
make[6]: Leaving directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
cd ..; libtool --mode=install cp gracket/gracket3m 
"/home/bert/builds/racket-snap/pkg/racket/usr/lib/gracket"
libtool: install: cp gracket/.libs/gracket3m 
/home/bert/builds/racket-snap/pkg/racket/usr/lib/gracket
cd ..; strip "/home/bert/builds/racket-snap/pkg/racket/usr/lib/gracket"
../racket/racket3m  -cu 
"/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/../gracket/../racket/collects-path.rkt"
 
"/home/bert/builds/racket-snap/pkg/racket/usr/lib/gracket" ../collects 
../etc
make[5]: Leaving directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
make install-wx_xt-3m-final
make[5]: Entering directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
:
make[5]: Leaving directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
make[4]: Leaving directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/gracket'
make[3]: Leaving directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build'
make install-common-middle
make[3]: Entering directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build'
make copytree-run
make[4]: Entering directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build'
racket/racketcgc  -u \
  
"/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/../../collects/setup/unixstyle-install.rkt"
 
\
  make-install-copytree 
"/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build/../.." \
  "/home/bert/builds/racket-snap/pkg/racket/usr/bin" 
"/home/bert/builds/racket-snap/pkg/racket/usr/collects" 
"/home/bert/builds/racket-snap/pkg/racket/usr/doc" 
"/home/bert/builds/racket-snap/pkg/racket/usr/lib" 
"/home/bert/builds/racket-snap/pkg/racket/usr/include" 
"/home/bert/builds/racket-snap/pkg/racket/usr/lib" 
"/home/bert/builds/racket-snap/pkg/racket/usr/share" 
"/home/bert/builds/racket-snap/pkg/racket/usr/etc" 
"/home/bert/builds/racket-snap/pkg/racket/usr/share/applications" 
"/home/bert/builds/racket-snap/pkg/racket/usr/man" "yes"
read-compiled-linklet: virtual-machine mismatch  expected: "racket"  found: 
"chez-scheme"  in: 
/home/bert/builds/racket-snap/src/racket-7.7.0.2/collects/setup/compiled/unixstyle-install_rkt.zo
  context...:
   read-linklet-or-directory
   read-dispatch
   read-syntax
   default-load-handler
   standard-module-name-resolver
   module-path-index-resolve
   [repeats 1 more time]
   module-declared?
make[4]: *** [Makefile:163: copytree-run] Error 1
make[4]: Leaving directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build'
make[3]: *** [Makefile:142: install-common-middle] Error 2
make[3]: Leaving directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build'
make[2]: *** [Makefile:196: install-3m-common] Error 2
make[2]: Leaving directory 
'/home/bert/builds/racket-snap/src/racket-7.7.0.2/src/build'

[racket-users] type-checking error with immutable vectors in for loop

2019-11-25 Thread bedeke
Hello,

the following doesn't typecheck. Is it a bug? Should I avoid 
Immutable-Vectors?
#lang typed/racket/base
;DrRacket, version 7.5.0.3 [3m].

(require racket/sequence)

(define-type M (Immutable-Vectorof Number))

(define s
  (in-list (ann (list (vector-immutable 1 2 3)
  (vector-immutable 2 3 4)
  (vector-immutable 3 4 5))
(Listof M

(for/list : (Listof M)
  ([m s])
  m)

Kr,
Bert

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/1b1bc126-61d4-476f-bbfd-2bb7fce20aae%40googlegroups.com.


Re: [racket-users] polymorphic datastructures in typed/racket

2019-11-18 Thread bedeke
Classes:
cool, so I can make a function that produces a polymorphic subclass of C1, 
but not a straight polymorphic subclass. I can work with that.
It seems in this case, if I want to implement a new method for the subclass 
C2 I can not use
```
(define-type (D-class A)(Class ... #:implements (C-class A) ...)
```
Or is there also a special way to make this work?

If not, at least I can define a new type in which I copy the complete Class 
type again + the new method, so it's not a big problem.

Structs:
what I got working was this:
```
#lang typed/racket/base

(struct (A) S ([f1 : (-> A A A)]
   [f2 : (-> Any Boolean : #:+ A)])
  #:prefab
  )

(: S-of-type? (All (A) (-> Any
   (-> Any Boolean : #:+ A)
   Boolean
   : #:+ (implies #t (S A)
(define (S-of-type? obj fct) (and (S? obj)(eq? fct (S-f2 obj

(define C ((inst S Number) + number?))
(S-of-type? C number?)
(S-of-type? C real?)
```

It works on a prefab structure, but not on a normal structure. I was hoping 
to use this as a way to get the type at runtime. But since it only works 
with prefab structures, It doesn't work... (or better said, too many 
objects can pass this test).
For a normal structure I hoped the guarantee that it was created with (S 
...) would be enough extra info to be sure that if f2 is eq? then S must be 
of type A for f2 of type (-> Any Boolean : #:+ A)

But anyway, I feel that for what I need, classes are really the better 
option, so I will try to type it with the tip you gave me, or if that 
doesn't work, go for untyped.

Thank you very much,
Bert

On Monday, 18 November 2019 20:30:09 UTC+1, Sam Tobin-Hochstadt wrote:
>
> It is possible to get the contracts of values, (see `value-contract`) 
> but Typed Racket doesn't know how to do that, and it would be 
> problematic anyway since the value isn't around until runtime, but TR 
> runs at compile time. 
>
> Sam 
>
> On Mon, Nov 18, 2019 at 12:24 PM David Storrs  > wrote: 
> > 
> > 
> > 
> > On Mon, Nov 18, 2019 at 12:23 PM David Storrs  > wrote: 
> >> 
> >> 
> >> 
> >> On Mon, Nov 18, 2019 at 10:09 AM Sam Tobin-Hochstadt <
> sa...@cs.indiana.edu > wrote: 
> >>> 
> >>> 
> >>> Third, your version with structs can't work because you can't tell 
> >>> what type a function expects -- that information is not there at 
> >>> runtime. 
> >> 
> >> 
> >> If there is a contract assigned to a function, is it possible to get 
> that function and analyze it? 
> > 
> > 
> > Correction:  Get that *contract* and analyze it. 
> > 
> >> 
> >>> 
> >>> Sam 
> >>> 
> >>> On Wed, Nov 6, 2019 at 2:51 PM bedeke  > wrote: 
> >>> > 
> >>> > Hello, 
> >>> > 
> >>> > I was trying to type some polymorphic classes but I got stuck early 
> on making a polymorphic subclass 
> >>> > 
> >>> > #lang typed/racket/base 
> >>> > 
> >>> > ;*1* 
> >>> > (require typed/racket/class) 
> >>> > 
> >>> > (define-type (C-class A)(Class [init-field [x A]])) 
> >>> > 
> >>> > (define C1% 
> >>> >  (class object% 
> >>> >  #:∀ (A) 
> >>> >  (init-field [x : A]) 
> >>> >  (super-new))) 
> >>> > 
> >>> > (define C2% 
> >>> >  (class (inst C1% A) 
> >>> >  #:∀ (A) 
> >>> >  (super-new))) 
> >>> > 
> >>> > (new (inst C2% Integer) [x 4]) 
> >>> > 
> >>> > C1% is recognised as a C-class, but explicitly calling C1% a C-class 
> (omitting the #:forall (A) ) doesn't work 
> >>> > In the next step I don't seem to find the right way to make C2% a 
> polymorphic subclass of C1% 
> >>> > 
> >>> > 
> >>> > 
> >>> > Having failed that I went with structures. This I got mostly 
> working, but I would like to have some niceties. 
> >>> > One was to parameterize a structure, but this lead to a problem of 
> not being able to check some 
> >>> > types at runtime. I thought I got close, but I stranded on getting 
> fields of structures without knowing the instantiation type 
> >>> > ;*2* 
> >>> > (struct (A) S ([f1 : (-> A A A)] 
> >>> >[f2 : (-> A Boolean : A)])) 
> >>> > 
> >>> > (: S-of-type? (-> (-> Any Boolean : A)

[racket-users] Re: polymorphic datastructures in typed/racket

2019-11-17 Thread bedeke
Hi,

I managed to do the second part using prefab structures, but then I can't 
be sure it was created with the right constructor.
Since it seems not doable to get this working with classes I will go back 
to untyped code.

On Wednesday, 6 November 2019 20:51:39 UTC+1, bedeke wrote:
>
> Hello,
>
> I was trying to type some polymorphic classes but I got stuck early on 
> making a polymorphic subclass
>
> #lang typed/racket/base
>
> ;*1*
> (require typed/racket/class)
>
> (define-type (C-class A)(Class [init-field [x A]]))
>
> (define C1% 
>  (class object%
>  #:∀ (A)
>  (init-field [x : A])
>  (super-new)))
>
> (define C2%
>  (class (inst C1% A)
>  #:∀ (A)
>  (super-new)))
>
> (new (inst C2% Integer) [x 4])
>
> C1% is recognised as a C-class, but explicitly calling C1% a C-class 
> (omitting the #:forall (A) ) doesn't work
> In the next step I don't seem to find the right way to make C2% a 
> polymorphic subclass of C1%
>
>
>
> Having failed that I went with structures. This I got mostly working, but 
> I would like to have some niceties.
> One was to parameterize a structure, but this lead to a problem of not 
> being able to check some
> types at runtime. I thought I got close, but I stranded on getting fields 
> of structures without knowing the instantiation type
> ;*2*
> (struct (A) S ([f1 : (-> A A A)]
>[f2 : (-> A Boolean : A)]))
>
> (: S-of-type? (-> (-> Any Boolean : A) Any Boolean
>   : #:+ (implies #t (S A))
> #:- (implies #f (! (S A)
> (define (S-of-type? fct A)
>   (and (S? A) (eq? fct (S-f2 A
> ;  ^ how can I acces a field of this polymorfic struct
>
>
>
> And another thing I tried but failed to get working is to sub-type a 
> structure based
> on a narrower type for one of the fields.
> ;*3*
> (struct (A) B ([f1 : (Vectorof A)]
>[f2 : Integer])
>   #:transparent)
>
> (: B1? (All (A) (-> (B A) Boolean)))
> (define (B1? b)(= (B-f2 b) 1))
> (define b (B (vector 3) 1))
> (assert b B1?)
> b
> (define-type B1 B1?)
> ;(define-new-subtype B1 B1?)
> ;(define-type B1 (All (A)(Struct (B (Vectorof A) 1
>
>
> Are any of these things doable? Or are there better ways to tackle this 
> problems?
>
>
> What I got working is in 
>
> https://github.com/bdeket/polynomials/blob/alg-dic-pol/polynomials/math/private/polynomial/poly-struct.rkt
>  
> (WIP)
>
> Kind regards,
> Bert
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/9e47b782-9fd5-40ac-ba74-8b0e53619858%40googlegroups.com.


[racket-users] polymorphic datastructures in typed/racket

2019-11-06 Thread bedeke
Hello,

I was trying to type some polymorphic classes but I got stuck early on 
making a polymorphic subclass

#lang typed/racket/base

;*1*
(require typed/racket/class)

(define-type (C-class A)(Class [init-field [x A]]))

(define C1% 
 (class object%
 #:∀ (A)
 (init-field [x : A])
 (super-new)))

(define C2%
 (class (inst C1% A)
 #:∀ (A)
 (super-new)))

(new (inst C2% Integer) [x 4])

C1% is recognised as a C-class, but explicitly calling C1% a C-class 
(omitting the #:forall (A) ) doesn't work
In the next step I don't seem to find the right way to make C2% a 
polymorphic subclass of C1%



Having failed that I went with structures. This I got mostly working, but I 
would like to have some niceties.
One was to parameterize a structure, but this lead to a problem of not 
being able to check some
types at runtime. I thought I got close, but I stranded on getting fields 
of structures without knowing the instantiation type
;*2*
(struct (A) S ([f1 : (-> A A A)]
   [f2 : (-> A Boolean : A)]))

(: S-of-type? (-> (-> Any Boolean : A) Any Boolean
  : #:+ (implies #t (S A))
#:- (implies #f (! (S A)
(define (S-of-type? fct A)
  (and (S? A) (eq? fct (S-f2 A
;  ^ how can I acces a field of this polymorfic struct



And another thing I tried but failed to get working is to sub-type a 
structure based
on a narrower type for one of the fields.
;*3*
(struct (A) B ([f1 : (Vectorof A)]
   [f2 : Integer])
  #:transparent)

(: B1? (All (A) (-> (B A) Boolean)))
(define (B1? b)(= (B-f2 b) 1))
(define b (B (vector 3) 1))
(assert b B1?)
b
(define-type B1 B1?)
;(define-new-subtype B1 B1?)
;(define-type B1 (All (A)(Struct (B (Vectorof A) 1


Are any of these things doable? Or are there better ways to tackle this 
problems?


What I got working is in 
https://github.com/bdeket/polynomials/blob/alg-dic-pol/polynomials/math/private/polynomial/poly-struct.rkt
 
(WIP)

Kind regards,
Bert

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/3c4bcedd-5677-4972-97a3-04e33ca30816%40googlegroups.com.


Re: [racket-users] Re: [standard-fish] Summer competiton 2019

2019-08-14 Thread bedeke
A cap for an Escher-like egg-face.

long live the plot library.
code at http://pasterack.org/pastes/39958
B.









-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/88470573-c570-4fe8-b7c6-683e59871156%40googlegroups.com.


Re: [racket-users] out of memory with streams

2019-03-12 Thread bedeke

On Tuesday, 12 March 2019 19:21:12 UTC+1, Ben Greenman wrote:
>
> You can also use sequences: 
>
> #lang racket/base 
> (require racket/sequence) 
>
> (sequence-ref (in-producer (let ([i 0]) (lambda () (begin0 i (set! i 
> (+ i 1)) 
>   2000) 
> (sequence-ref (in-naturals) 
>   2000) 
>

Thank you.

The actual sequence was building a list for each element.
I had a recursive algorithm to produce this. But the total list was 
definitely too big. So I was hoping that by turning it into a stream I 
could avoid keeping every element in memory.
In the end I used a generator and modified the algorithm to track state...

KR.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] out of memory with streams

2019-03-12 Thread bedeke


On Tuesday, 12 March 2019 16:06:59 UTC+1, Matthias Felleisen wrote:
>
>
>
> > On Mar 12, 2019, at 10:48 AM, bedeke > 
> wrote: 
> > 
> > 
> > Sorry for not being clear. 
> > I knew that increasing the memory limit could make this run without 
> problems since the data in each cell of the stream is so small. 
> > I was running this example with a memory limit of 128MB. 
> > I made my own quick stream implementation, and this runs the above 
> example with the low memory limit without problems and without noticeable 
> GC happening. At the cost of having to reevaluate every stream from the 
> beginning. 
> > I was just curious if there was a stream implementation that avoids 
> memoization. 
>
>
> The very notion of ‘stream’ implies memoization. What I am surprised about 
> is that racket/stream (unlike #lang lazy) does not memoize exceptions, 
> which is even more expensive — Matthias 
>
>
Ok,

thank you. Then I will search in a different direction.
I wanted to avoid generators, but it looks like this will be the better 
option.

B.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] out of memory with streams

2019-03-12 Thread bedeke


On Tuesday, 12 March 2019 14:50:38 UTC+1, Matthias Felleisen wrote:
>
>
>
> On Mar 12, 2019, at 3:10 AM, bedeke > 
> wrote:
>
> Hello,
>
> when running any of the following the program runs out of memory:
>
> #lang racket/base
> (require racket/stream)
>
> (stream-ref (let ([i 0])(stream-cons i (let 
> loop ()(set! i (+ i 1))(stream-cons i (loop)
> 2000)
> (stream-ref (for/stream ([i (in-naturals)]) i)
>   2000)
>
> I guess this is because of memoization, but I was hoping that since I 
> don't keep a reference to the first element of the stream, it would be 
> discarded. This doesn't seem to be happening.
> Is there a way to disable memoization for streams? Or is there an other 
> issue?
>
> (the actual stream I want to build/traverse without keeping it in memory 
> is at http://pasterack.org/pastes/63574)
>
>  
>
> I ran this program: 
>
> #lang racket/base
>
> (require racket/stream)
> (stream-ref (let ([i 0]) (stream-cons i (let loop () (set! i (+ i 1)) 
> (stream-cons i (loop) 2000)
>
> ;; please write this: the above is Fortran in Racket 
> (stream-ref (let loop ([i 0]) (stream-cons i (loop (+ i 1 2000)
>
>
> I got (with serious GC happening between the two results): 
>
> Welcome to DrRacket, version 7.2.0.6--2018-05-23(-/f) [3m].
> Language: racket/base, with debugging; memory limit: 2048 MB.
> 2000
> 2000
>
>
>
Sorry for not being clear.
I knew that increasing the memory limit could make this run without 
problems since the data in each cell of the stream is so small.
I was running this example with a memory limit of 128MB.
I made my own quick stream implementation, and this runs the above example 
with the low memory limit without problems and without noticeable GC 
happening. At the cost of having to reevaluate every stream from the 
beginning.
I was just curious if there was a stream implementation that avoids 
memoization.

KR,
Bert


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] out of memory with streams

2019-03-12 Thread bedeke
Hello,

when running any of the following the program runs out of memory:

#lang racket/base
(require racket/stream)

(stream-ref (let ([i 0])(stream-cons i (let loop ()(set! i (+ i 1))(stream-cons 
i (loop)
2000)
(stream-ref (for/stream ([i (in-naturals)]) i)
  2000)

I guess this is because of memoization, but I was hoping that since I don't 
keep a reference to the first element of the stream, it would be discarded. 
This doesn't seem to be happening.
Is there a way to disable memoization for streams? Or is there an other 
issue?

(the actual stream I want to build/traverse without keeping it in memory is 
at http://pasterack.org/pastes/63574)

Kind regards,
Bert

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.