Matthew Flatt | 21 May 2013 14:42
Picon
Favicon
Gravatar

Re: proposal for moving to packages: repository

At Tue, 21 May 2013 00:09:49 -0700, Sam Tobin-Hochstadt wrote:
> On Mon, May 20, 2013 at 6:07 PM, Matthew Flatt <mflatt@...> wrote:
> >
> > To put it another way and overstate a little: I'm trying to get buy-in
> > from dev to make the switch to packages wholesale. The little bit of
> > staging in the plan is to make the conversion itself easier, and not to
> > simplify the switch for developers.
> 
> Can you spell out how the directory movement you described will make
> the conversion easier?

I think we won't get an ideal package split on the first N tries, and
it will be easier to move files and directories around in one
repository (using `git mv') instead of among multiple repositories.
When we finally have mostly the right split, then we can use `git
filter-branch'.

_________________________
  Racket Developers list:
  http://lists.racket-lang.org/dev

Alex Moiseenko | 21 May 2013 03:57
Picon
Favicon

tcp_listen error handling

Hi. I've successfully started Racket 5.3.4.7 with Geiser server through JNI + SDL2 on Android (and this
combination mostly works with small hacks), but got some issues due to racket's implementation. This is
last one I'm trying to understand. What should be here instead of the "address" expression?

2349    } else {
2350      scheme_raise_exn(MZEXN_FAIL_NETWORK,
2351                       "tcp-listen: host not found\n"
2352                       " address: %s\n"
2353                       " system error: %N",
2354                       address, 1, err);
2355      return NULL;
2356    }
2357  }
https://github.com/plt/racket/blob/master/src/racket/src/network.c#L2354

It looks like there should be (but i'm not sure)

   address ? address : "#f" // as i see at another place, because it's possible to have NULL according to the:

https://github.com/plt/racket/blob/master/src/racket/src/network.c#L2147

Without such change I got segfault because sch_vsprintf tried to process NULL pointer, when i forgot to
grant internet permissions for my application and tried to call start-geiser function (getaddrinfo
returns fail in this situation and this `else` block is called).

--

-- 
Alex Moiseenko
_________________________
  Racket Developers list:
  http://lists.racket-lang.org/dev
(Continue reading)

Matthew Flatt | 20 May 2013 22:42
Picon
Favicon
Gravatar

proposal for moving to packages

I used to think that we'd take advantage of the package manager by
gradually pulling parts out of the Racket git repo and making them
packages.

Now, I think we should just shift directly to a small-ish Racket core,
making everything else a package immediately. "Core" means enough to
run `raco pkg'.

A key point to remember is that "package" does not mean "omitted from
the distribution". Instead, we'll construct a distribution by
combining the core with a selected set of packages. Initially the
selected set of packages will cover everything in the current
distribution.

Jay and I have been lining up the pieces for this change (it's
difficult to make a meaningful proposal without trying a lot of the
work, first), and I provide a sketch of the overall plan below.

This plan has two prominent implications:

 * The current git repo's directory structure will change.

   Anyone who currently works with the Racket repo will need to adapt
   to the new directory structure (and probably git <submodules in the
   future). All of the code currently in the Racket git repo will stay
   there (for now), but using it will involve at least one new step:
   linking packages within the repo into the core build --- probably
   by running some setup script.

 * The main Racket distributions at http://racket-lang.org/download/
(Continue reading)

Eric Dobson | 20 May 2013 02:55
Picon
Gravatar

Re: [plt] Push #26861: master branch updated

This doesn't pass with contract checking enabled. make-StructTop
requires a Struct? not any old Type?. Is there a reason that the type
is not just bottom?

On Sun, May 19, 2013 at 5:33 PM,  <asumu@...> wrote:
> asumu has updated `master' from d9102ac7e7 to 3eb4a75613.
>   http://git.racket-lang.org/plt/d9102ac7e7..3eb4a75613
>
> =====[ One Commit ]=====================================================
> Directory summary:
>   46.8% collects/tests/typed-racket/fail/
>   53.1% collects/typed-racket/private/
>
> ~~~~~~~~~~
>
> 3eb4a75 Asumu Takikawa <asumu@...> 2013-05-19 20:31
> :
> | Fix parsing of (Struct ...) types.
> |
> | This was a regression that appeared in 5.3.1
> :
>   A collects/tests/typed-racket/fail/bad-struct-top.rkt
>   M collects/typed-racket/private/parse-type.rkt | 4 ++--
>
> =====[ Overall Diff ]===================================================
>
> collects/tests/typed-racket/fail/bad-struct-top.rkt
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --- /dev/null
> +++ NEW/collects/tests/typed-racket/fail/bad-struct-top.rkt
(Continue reading)

Asumu Takikawa | 18 May 2013 01:30
Favicon

set!-transformers and syntax-local-value/immediate

Hi all,

I'm confused about an aspect of set! and rename transformers. I'll
explain with this example:

  #lang racket

  ;; a macro that uses `syntax-local-value/immediate`
  (define-syntax (lookup stx)
    (syntax-case stx ()
      [(_ id)
       (let-values ([(f _) (syntax-local-value/immediate #'id)])
         (displayln (rename-transformer? f))
         (displayln (set!-transformer? f))
         #'0)]))

  ;; f is a set!-transformer
  (let-syntax ([f (make-set!-transformer values)])
    (lookup f))

  ;; sanity check
  (rename-transformer? (make-set!-transformer values))

In this example, `f` is bound to a set!-transformer. The macro `lookup`
will look up the value bound to `f` at compile-time, and I expected that
the result would be the set! transformer.

However, it seems like the set! transformer is somehow being turned into
a rename transformer (note the two print statements produce #t and #f
respectively). The last line suggests that set! transformers are not
(Continue reading)

Matthew Eric Bassett | 15 May 2013 14:40

calling make-keyword-procedure from inside a thread produces a stack overflow in scheme_uncopy_stack

This is related to 
http://www.mail-archive.com/users-GvBox1K3Ixw1Q5oZIJT9Xw <at> public.gmane.org/msg17597.html.
Forgive 
me for posting it again, I wanted to make sure it didn't disappear into 
a black hole.

Launching a racket thread that calls make-keyword-procedure may produce 
a seg fault.  For instance,

(let loop () (thread (make-keyword-procedure (lambda (x y) '()))) 
(loop))

Reliably causes a seg fault.  Repeatedly calling

(thread (make-keyword-procedure (lambda (x y) '())))

will eventually (but not consistently) produce a seg fault.  Functions 
defined with make-keyword-procedure, such as const and thunk* suffer the 
same fate (plain ol' thunk is fine).

A coredump of the racket repl from this segfault shows a stack overflow 
in scheme_uncopy_stack, with the Scheme_Jumpup_Buf zeroed out.  Please 
see our gdp session at http://pastebin.com/aBx2FTcK (This is from racket 
compiled without optimization)  or cause your own seg fault with the 
above code.

Perhaps we're being incredibly daft to write code where we'd need to 
const or thunk* something inside a thread, or perhaps this is a bug in 
racket.  We might just be incredibly daft by calling a const inside a 
thread, or this is a bug in racket, or something else is up.  In any 
(Continue reading)

Eric Dobson | 14 May 2013 05:51
Picon
Gravatar

Re: [plt] Push #26832: master branch updated

On Mon, May 13, 2013 at 2:14 PM,  <asumu@...> wrote:
> asumu has updated `master' from a857256c77 to f3e6276f9b.
>   http://git.racket-lang.org/plt/a857256c77..f3e6276f9b
>
> =====[ One Commit ]=====================================================
> Directory summary:
>   29.0% collects/tests/typed-racket/succeed/
>   70.9% collects/typed-racket/typecheck/
>
> ~~~~~~~~~~
>
> f3e6276 Asumu Takikawa <asumu@...> 2013-05-13 16:47
> :
> | Make `define-type` work at top-level
> |
> | Closes PR 12913
> :
>   A collects/tests/typed-racket/succeed/pr12913.rkt
>   M collects/typed-racket/typecheck/tc-toplevel.rkt | 14 +++++++++++---
>
> =====[ Overall Diff ]===================================================
>
> collects/tests/typed-racket/succeed/pr12913.rkt
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> --- /dev/null
> +++ NEW/collects/tests/typed-racket/succeed/pr12913.rkt
>  <at>  <at>  -0,0 +1,10  <at>  <at> 
> +#lang racket
> +
> +;; Test that `define-type` works at the top-level
(Continue reading)

Eli Barzilay | 13 May 2013 03:49
Favicon
Gravatar

svn server going mostly read-only

JFYI, I've made the svn server be mostly read-only.
--

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!
_________________________
  Racket Developers list:
  http://lists.racket-lang.org/dev

Jon Zeppieri | 12 May 2013 19:38
Picon

Immediate characters

My branch with immediately represented characters is available at:

https://github.com/97jaz/racket/tree/immediate-chars

I'm interested to hear any opinions from the members of this list on
the implementation.

For my own part, I'm ambivalent on the matter of actually
incorporating this work into the official tree. Benchmarks that are
heavy on character manipulation -- and there are few enough of these
-- benefit from this change, to varying degrees.

A few micro-benchmarks

1. Constructing a list of 10,000,000 characters using integer->char on
integers chosen randomly from [0, 256) (average of 5 runs, CPU time):

immediate-chars: 4248.8
Racket v5.3.4.10: 4297.2

2. Constructing a list of 10,000,000 characters using integer->char on
integers chosen randomly from the entire field of valid Unicode code
points (average of 5 runs, CPU time):

immediate-chars: 4441.4
Racket v5.3.4.10: 5953.0

3. The 'wc' shootout benchmark:

immediate-chars: 3789
(Continue reading)

Jay McCarthy | 11 May 2013 03:23
Picon
Gravatar

bitmap-dc% ignores alpha on set-pixel

No matter what the input color's alpha is, set-pixel uses 100%
opacity. Similarly, get-pixel ignores the alpha in the image.

I think we should change this with the patch below, but I wonder if
there is some deeper reason it works this way and it shouldn't change.
Matthew?

Jay

diff --git a/collects/racket/draw/private/bitmap-dc.rkt
b/collects/racket/draw/private/bitmap-dc.rkt
index 08bb51c..5d9e241 100644
--- a/collects/racket/draw/private/bitmap-dc.rkt
+++ b/collects/racket/draw/private/bitmap-dc.rkt
 <at>  <at>  -119,14 +119,18  <at>  <at> 
       (internal-get-bitmap))

     (define/public (set-pixel x y c)
-      (let ([s (bytes 255 (color-red c) (color-green c) (color-blue c))])
+      (let ([s (bytes (inexact->exact (round (* 255 (color-alpha c))))
+                      (color-red c)
+                      (color-green c)
+                      (color-blue c))])
         (set-argb-pixels x y 1 1 s)))

     (define/public (get-pixel x y c)
       (let-values ([(w h) (get-size)])
         (let ([b (make-bytes 4)])
           (get-argb-pixels x y 1 1 b)
-          (send c set (bytes-ref b 1) (bytes-ref b 2) (bytes-ref b 3))
(Continue reading)

Jon Zeppieri | 11 May 2013 03:19
Picon

Another JIT question

My experiment with immediately represented characters has gotten to a
state where a non-JIT build passes all tests, but a JIT build fails
(as in, segfaults) on the following program:

#\c

It also fails on:

(integer->char 99)

and:

(define (foo x) (integer->char x))
(foo 99)

but not on:

(define (foo x) (write (integer->char x)))
(foo 99)

So there seems to be a problem returning a character from a jitted
function back to the repl. I haven't been able to figure out where
this occurs, though. gdb's stack traces don't seem very useful for
jitted code, and I can't use Sam's disassembler, because the process
dies.

Any idea where to look or what debugging tools might be useful?

-Jon
_________________________
(Continue reading)


Gmane