George Bevan | 12 Feb 07:40 2016
Picon

Licensing Details (Is there a Runtime Library Exception?)

Do programs written in Racket that use the libraries of racket-lang.org's implementation need to be
licensed under GPL terms? Much like it is the case with e.g. the libraries in AdaCore's Ada implementation?

Or is there a "Runtime Library Exception" or a "Classpath Exception" or similar, like it is the case for GCC
or Java/JDK?

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.
Leif Andersen | 11 Feb 21:50 2016
Picon
Gravatar

Call for Google Summer of Code Project Suggestions

Hello All,

We are in the process of submitting a Google Summer of Code
application for Racket. If you have an idea for a self contained
project that would benefit the community, please let us know. These
should be projects that a student would be able to complete in about 3
months.

We will curate a subset of these ideas, and put together a detailed
list of potential projects for students.

Here are some example suggestions from Asumu:
  * Type-based auto-completion
  * Memory profiler
  * Video editing DSL (#lang nlve)
  * Automatically generate typed wrappers from tests or contracts
  * Improve DrRacket vim plugin
  * TOTP two-factor auth library for Racket-based websites
  * Command-line REPL debugger
  * Pure Racket line editing for XREPL with paren-matching and
    other goodies
  * RRB-Trees built into the Racket VM as an alternative to immutable
    vectors

As well as some suggestions we have from previous years:
https://github.com/racket/racket/wiki/SoC-Ideas-2012

Thank you.

~Leif Andersen
(Continue reading)

Matthias Felleisen | 11 Feb 17:27 2016

macro stepper


... has anyone seen this error message from stepping thru macros: 

[:~/svn/2HtDP] matthias% sequence-contract-violation: negative: method set-max-width cannot be
called, except in states (unlocked write-lock), args 834
  context...:
   /Users/matthias/plt/racket/collects/racket/private/more-scheme.rkt:148:2: call-with-break-parameterization
   /Users/matthias/plt/racket/share/pkgs/gui-lib/mred/private/lock.rkt:43:38
   /Users/matthias/plt/racket/collects/racket/private/more-scheme.rkt:265:2: call-with-exception-handler
   /Users/matthias/plt/racket/share/pkgs/gui-lib/mred/private/wxme/text.rkt:766:2:
end-edit-sequence method in text%

/Users/matthias/plt/racket/share/pkgs/macro-debugger/macro-debugger/view/stepper.rkt:438:4:
update* method in macro-stepper-widget%
   /Users/matthias/plt/racket/share/pkgs/macro-debugger/macro-debugger/view/stepper.rkt:400:31
   .../more-scheme.rkt:261:28
   /Users/matthias/plt/racket/share/pkgs/macro-debugger/macro-debugger/view/stepper.rkt:369:24

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.

Nota Poin | 11 Feb 10:48 2016
Picon

splicing conditional results in the surrounding block?

I run into this problem a lot whenever I'm generating some text. I'll be making what amounts to a sequence of
strings being appended, and do something like this:

(apply string-append 
  (list "<p><a href=\"" somewhere "\">" something "</a></p>"))

Compared to un-parsing a representation of a document tree every single time, simplifying document
production down to a bunch of string concatenations is pretty efficient. The problem happens when I
introduce conditionals, like this:

(list
  "<p id=\"navigation\">"
  (if prev
    (list "<a href=\"" prev "\">Prev</a>")
    '())
  (if next
    (list "<a href=\"" next "\">Next</a>")
    '())
  "</p>")

Now I no longer have a sequence of strings, but instead a nested list of strings. Then I usually call (apply
string-append (flatten list-of-strings)) and don't worry about it, but it'd be even cooler if I could
proactively flatten it.

(if prev
  (if next
    (list 
      "<p id=\"navigation\">"
      "<a href=\"" prev "\">Prev</a>"
      "<a href=\"" next "\">next</a>"
(Continue reading)

Suzanne Menzel | 11 Feb 04:22 2016
Picon
Picon

Re: Using scribble to print BSL output

Thank you so much. This works like a charm!

Suzanne

> On Feb 9, 2016, at 7:53 PM, Matthew Flatt <mflatt@...> wrote:
> 
> I think the main issue is that `htdp/bsl/runtime` changed the way it
> configures the printer. Instead of setting `current-print`, it sets
> `global-port-print-handler`. Meanwhile, `interaction` prints within the
> sandbox only if `current-print` is changed from its default value,
> which is `pretty-print-handler`. Since the default value is in place
> with the revised `htdp/bsl/runtime`, `global-port-print-handler` isn't
> used for rendering results.
> 
> You can work around that problem by replacing
> 
>   (me '(current-print pretty-print-handler))
> 
> with
> 
>   (me '(current-print (lambda (v) (unless (void? v) (print v)))))
> 
> 
> Meanwhile it seems that `htdp/bsl/runtime` was never configured to add
> a `make-` prefix for printing structure instances. To fix that, after
> 
>    (call-in-sandbox-context me (lambda () (namespace-require module-lang)))
> 
> add
> 
(Continue reading)

stef | 10 Feb 22:58 2016
Picon
Gravatar

How to profile compilation and macro expansion?

I've been trying out nanopass (https://github.com/nanopass/nanopass-framework-racket) and its
tutorial scheme-to-c compiler (https://github.com/LeifAndersen/racket-to-c). However, Racket
takes easily 20s to bytecompile the c compiler, which is totally unacceptable, especially with Racket's
normal flow of resetting the environment on every compile.

How can I profile this so I can figure out what's taking so long? "raco make --vv" is totally uninformative
and I don't see any profiling library for macros.

To be clear, I'm not specifically worried about nanopass or this compiler as such, but about trying similar
macro-heavy strategies to implement languages later. Typed Racket has similar huge performance
problems, so I'm actually worried about fundamental limitations of Racket as a host.

However, TR is far too big for me to poke around in (I tried). I mostly get what nanopass is doing though, and
the slowness is more surprising, so I thought it would make a better starting point for learning how to
improve macro performance.

So first step: measure what the compiler is actually doing. :)

I thought I might just be able to essentially call:

    (require compiler/compile-file)
    (compile-file "c.rkt") 

and then normally profile that, but compile-file seems to choke on the #lang.

After more reading, tried this:

    (require compiler/cm)
    (require profile)
    (profile (managed-compile-zo "./c.rkt"))
(Continue reading)

Matthew Butterick | 10 Feb 21:26 2016
Gravatar

rebinding a macro-introduced identifier from afar?

I suspect there's a simple way to do this, I just haven't done it before, so it does not appear simple. I tried a
syntax parameter, and then I had two problems.

Please consider this schematic example (no, I am not using macros to add):

#lang racket
(define-syntax-rule (foo) (+ x x))
(define-syntax bar (make-rename-transformer #'foo))

`(foo)` will fail with an undefined-identifier error because there is no binding for x. As will `(bar)`,
because it just refers to `(foo)`.

Q: At the definition site of `bar`, is there a way to bind x so that it affects `foo`, and `(bar)` thereby
produces a meaningful answer?

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.

Brian Adkins | 10 Feb 16:55 2016
Picon

assoc api

Is there an advantage to having assoc return the associated list vs. the tail of the associated list?
Wouldn't it be better for it to behave more like hash-ref ? Do folks typically just define their own
function such as the following ?

(define daynums (map list
                     '(sunday monday tuesday wednesday thursday friday saturday)
                     (range 7)))

(define (aref list key)
  (cadr (assoc key list)))

(aref daynums 'wednesday)  -> 3

Ruby's Array#assoc also returns the entire list, so I suppose this is just a historical artifact, but off
the top of my head, I can't recall ever wanting the entire list since I already have the key I'm searching for.

Brian

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.
Matthew Flatt | 10 Feb 16:04 2016
Picon
Gravatar

catalog of built packages

In case it's useful to anyone, the package-build service now provides
built versions of packages though this catalog:

  https://pkg-build.racket-lang.org/server/built/catalog/

Built packages can install faster than the source packages that are
provided by https://pkgs.racket-lang.org/ --- as long as you're using
the same version of Racket, which in this case is the current release.

For example, on my machine with version 6.4,

  raco pkg install --auto pict3d

takes about 8 minutes, but

  raco pkg install --auto \
       --catalog https://pkg-build.racket-lang.org/server/built/catalog/ \
       pict3d

takes about 20 seconds. Most packages build from source faster than
"pict3d", so the differences will not always be that large.

A built-package catalog is compatible with "binary library" install
mode. In that mode, sources and documentation are stripped away, and
dependencies that are needed only for compilation or building
documentation are not downloaded at all.

If you're running a version other than v6.4, the package-build catalog
is no better than the main source catalog, since installing a
v6.4-built package will rebuild, anyway. Also, if you're starting with
(Continue reading)

Anton Podkopaev | 10 Feb 14:35 2016
Picon
Gravatar

Re: [Redex] test-->>E and trace

Robby,

Thank you very much! 

BR,
Anton Podkopaev


BR,
Anton Podkopaev

On Wed, Feb 10, 2016 at 4:34 PM, Anton Podkopaev <anton-r+6xSep1H1/E6SqAqhcbZQ@public.gmane.org> wrote:
Robby,

Thank you very much! 

BR,
Anton Podkopaev

On Wed, Feb 10, 2016 at 3:50 PM, Robby Findler <robby-5YcgHWA4rVnfxgxxWyf0drK6bRJNSFrb@public.gmane.org> wrote:
Sure. The trick is to use the #:reduce argument and then just ignore
the actual reduction relation. A revision of the earlier code
demonstrates, as below.

Robby

#lang racket

(require redex)

(define-language L (n ::= natural))
(define red
  (reduction-relation
   L
   (--> n ,(max 0 (min 20 (+ (term n) 3))))
   (--> n ,(max 0 (min 20 (- (term n) 1))))))

(define (find-path red from to)
  (define parents (make-hash))
  (let/ec done
    (let loop ([t from])
      (define nexts (apply-reduction-relation red t))
      (for ([next (in-list (remove-duplicates nexts))])
        (cond
          [(equal? next to)
           (hash-set! parents to t)
           (done)]
          [(hash-ref parents next #f)
           (void)]
          [else
           (hash-set! parents next t)
           (loop next)]))))
  parents)

(define parents (find-path red 0 10))
(define children
  (for/hash ([(k v) (in-hash parents)]
             #:unless (equal? k 0))
    (values v k)))

(traces red 0
        #:reduce
        (λ (_ t)
          (let/ec k
            (list (list #f (hash-ref children t (λ () (k '()))))))))

On Wed, Feb 10, 2016 at 4:08 AM, Anton Podkopaev <podkoav239-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Robby,
>
> Thank you, it mostly works for my semantics, and I know how to change the
> algorithm for some corner cases.
>
> Then I have one more question --- then I get terms (a result of
> `find-path'), is there a way to show them (and only them) using GUI tools
> like `traces' and `stepper'?
>
>
>
> BR,
> Anton Podkopaev
>
> On Wed, Feb 10, 2016 at 2:42 AM, Robby Findler <robby-5YcgHWA4rVnfxgxxWyf0drK6bRJNSFrb@public.gmane.org>
> wrote:
>>
>> I'm sorry it took me so long to get back to this. I'm not sure there
>> is a good thing to be added to Redex for this problem. Overall, it
>> seems like a graph search problem and there are multiple different
>> strategies depending on properties of the graph that you're searching.
>> It's not too hard to code these up in Racket and then find the best
>> one for your task, I would say. And redex's current support is pretty
>> simplistic, tailored to models with much less interesting reduction
>> graphs than yours has, I think.
>>
>> If you find what seems to be a particularly useful and general purpose
>> search strategy and want it to be included in Redex, I'd be delighted
>> if you would make a pull request. In the meantime, I've offered one
>> that may or may not work well for your model, below.
>>
>> hth,
>> Robby
>>
>> #lang racket
>> (require redex/reduction-semantics)
>> (define-language L (n ::= natural))
>> (define red
>>   (reduction-relation
>>    L
>>    (--> n ,(max 0 (min 20 (+ (term n) 3))))
>>    (--> n ,(max 0 (min 20 (- (term n) 1))))))
>>
>> (define (find-path red from to)
>>   (define parents (make-hash))
>>   (let/ec done
>>     (let loop ([t from])
>>       (define nexts (apply-reduction-relation red t))
>>       (for ([next (in-list (remove-duplicates nexts))])
>>         (cond
>>           [(equal? next to)
>>            (hash-set! parents to t)
>>            (done)]
>>           [(hash-ref parents next #f)
>>            (void)]
>>           [else
>>            (hash-set! parents next t)
>>            (loop next)]))))
>>   (let loop ([term to])
>>     (cond
>>       [(equal? term from) (list from)]
>>       [else (cons term (loop (hash-ref parents term)))])))
>>
>> (find-path red 0 10)
>>
>>
>> On Sun, Dec 20, 2015 at 6:26 AM, Anton Podkopaev <podkoav239-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> wrote:
>> > Unfortunately, I need something else, because my semantics is highly
>> > non-deterministic, and I want to be able to see only paths, which lead
>> > to a
>> > certain term.
>> >
>> > BR,
>> > Anton Podkopaev
>> >
>> > 2015-12-18 20:49 GMT+03:00 Robby Findler <robby-5YcgHWA4rVnfxgxxWyf0dj/g9hsXcGrM@public.gmane.orgu>:
>> >>
>> >> I think you may want to call apply-reduction-relation* with a
>> >> #:stop-when argument instead?
>> >>
>> >> Robby
>> >>
>> >>
>> >> On Fri, Dec 18, 2015 at 5:33 AM, Anton Podkopaev <podkoav239-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
>> >> wrote:
>> >> > Hello, colleagues!
>> >> >
>> >> > Is there any way to get a term trace from successful test-->>E in
>> >> > Redex?
>> >> >
>> >> > BR,
>> >> > Anton Podkopaev, PhD student, SPbSU
>> >> >
>> >> > --
>> >> > 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+unsubscribe <at> googlegroups.com.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>
>


--
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+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
For more options, visit https://groups.google.com/d/optout.

using TR in PL class?

I’m running a fairly vanilla pre-pyret PLAI class, using the plai-typed language. Has anyone looked
into doing this using Typed Racket? I feel like my interactions with TR have gotten sufficiently smooth
that I might try using it for my PL class.

Potential problems:

- mismatch with PLAI (though I’m already using an out-of-date PLAI because I’m not using Pyret)
- loss of the wonderful define-type form.
- potentially baffling error messages.

Potential benefits:

- *much* richer libraries available without the use of typed-in.
- exposure to occurrence typing, a pretty nifty type system.
- don’t have to explain the (quite painful) s-exp wrappers
- getting to use ‘match’ — better than plai-typed-s-exp-match because you get binding as well as matching
- somewhat better documentation (students always get hung up on the plai-typed docs. yes, they just need to
click on the *second* link…)

Opinions? Yes, I admit that I’m not giving Pyret a fair shake, and I’ll admit that most of that is related
to my commitment to Racket.

John

--

-- 
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+unsubscribe@...
For more options, visit https://groups.google.com/d/optout.

Gmane