Re: [racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-12-10 Thread Matthew Flatt
I’ve changed the distribution build to use HFS+ going forward.

> On Dec 10, 2019, at 6:28 PM, James Platt  wrote:
> 
> 
>> On Dec 6, 2019, at 9:56 PM, Darth Vadør wrote:
>> 
>> If it isn't too much trouble, I at least would really appreciate this.
>> One reason I think this is important is because Homebrew has a cask for 
>> Racket, which uses the .dmg distribution. It sets up $PATH (and probably 
>> other things I don't know about as well), and can update Racket for you, 
>> which is quite pleasant.
>> 
>> If the maintainers of the cask see there is an easy way to support older 
>> Macs they might (fingers crossed) consider it.
> 
> I would also like to have an HFS+ formatted dmg as an option.  However, 
> Homebrew has dropped support for El Capitan and earlier but it continues to 
> work (most of the time) if you already had a previous version installed.  
> Everything after El Capitan can read APFS.   So, the maintainers of the cask 
> might decide that any new legacy support would be short lived.
> 
> -- 
> 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/EDDD1A40-9C10-4F2B-8A07-6933784C5C41%40biomantica.com.
> 

-- 
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/FFE82A21-AE9E-49F0-9F55-76E47C32D58B%40cs.utah.edu.


Re: [racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-12-10 Thread James Platt


On Dec 6, 2019, at 9:56 PM, Darth Vadør wrote:

> If it isn't too much trouble, I at least would really appreciate this.
> One reason I think this is important is because Homebrew has a cask for 
> Racket, which uses the .dmg distribution. It sets up $PATH (and probably 
> other things I don't know about as well), and can update Racket for you, 
> which is quite pleasant.
> 
> If the maintainers of the cask see there is an easy way to support older Macs 
> they might (fingers crossed) consider it.

I would also like to have an HFS+ formatted dmg as an option.  However, 
Homebrew has dropped support for El Capitan and earlier but it continues to 
work (most of the time) if you already had a previous version installed.  
Everything after El Capitan can read APFS.   So, the maintainers of the cask 
might decide that any new legacy support would be short lived.

-- 
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/EDDD1A40-9C10-4F2B-8A07-6933784C5C41%40biomantica.com.


Re: [racket-users] Racket 7.5 DMG file does not open on OSX 10.11

2019-12-10 Thread James Platt


On Dec 3, 2019, at 7:09 PM, John Clements wrote:

> It sounds to me like an easy solution to your problems would be a 
> .tgz-bundled set, as e.g. we offer for Minimal Racket on the page
> 
> https://download.racket-lang.org/releases/7.5/
> 
> specifically at the link 
> 
> https://download.racket-lang.org/releases/7.5/installers/racket-minimal-7.5-x86_64-macosx.tgz
> 
> It looks to me like it would be fairly easy to generate this bundle for full 
> racket, unless I’m missing something obvious. It would presumably appear on 
> the “More Variants and Checksums” page along with the other tarballs. Is this 
> something you’d like to see happen for the 7.6 release?
> 
> As far as the choice of .dmg for the standard distribution, it has two 
> advantages that I’m aware of:
> 1) It allows us to create a easy installation path by specifying the way the 
> disk window should look when we open it, as opposed to having an installer, 
> and
> 2) It’s natively supported by Apple’s notarization workflow; I know that .tgz 
> files don’t work, and I suspect that .zip files wouldn’t work either, though 
> that’s just a guess.

Yes, I think tgz would be helpful.  The market my company is targeting with our 
software has a much greater share of Mac and Linux than typical and tgz is 
native to both.  On the other hand, would an HFS+ formatted dmg be an option?  
Support for that format goes all the way back to Mac OS 8.1.  I know that HFS+ 
formatted dmg distributions supported both advantages (1 and 2 above) in the 
past.  

-- 
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/45E4E017-A087-4790-AD12-C3ADD6336BD6%40biomantica.com.


Re: [racket-users] What’s everyone working on this week?

2019-12-10 Thread Christopher Lemmer Webber
Stephen De Gabrielle writes:

> New week, new Racket! What are you folks up to? Answer here or
>
> * https://racket.slack.com/ (Sign up at https://racket-slack.herokuapp.com/
> )
> * #racket IRC on freenode.net https://botbot.me/freenode/racket/
> * Tweet @racketlang on Twitter
> * Racket discord
> https://discord.gg/6Zq8sH5
>
> Don’t forget to
> * sign up, or contribute, to Racket News https://racket-news.com/
> * submit your links to Racket Stories https://racket-stories.com/

This week through the holidaze are a bit busy for me.

Nonetheless I am trying to understand CapTP, the capability transport
protocol (for a mutually suspicious networked programming environment):

  http://erights.org/elib/distrib/captp/index.html

I am trying to port its ideas to Spritely Goblins.  I expect the work
will be useful enough by the end of January but we'll see.

-- 
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/87immnwtgx.fsf%40dustycloud.org.


Re: [racket-users] What’s everyone working on this week?

2019-12-10 Thread wanderley.guimar...@gmail.com
Started to read HtDP and I plan to training the design recipe while solving
AoC challenges.  So far, I am enjoying the systematic approach to right
software.  It is funny to realize that you started to solve a problem with
a partial understanding of it.

Playing a bit with rsound.  My goal is to have a Beginner Language like
that manipulates sounds instead of images.  With that in hand, I could play
(literally) in Racket with my musician friend that wants to learn how to
program (that is one more reason why I am reading HtDP).

I might work in a re-write project.  My "first" serious program was a
program to draw gates (those that go in front of houses).  I did it to my
father 16 years ago.  And I decided to re-write it in Racket and see what I
get.  This time the gift will go to my brothers who took over the family
business.

On Tue, Dec 10, 2019 at 3:54 PM Hadi Moshayedi  wrote:

> Started creating some slideshows on postgres internals using #lang
> slideshow: https://github.com/pykello/hadi-slides
>
> Not much content yet, as I've been struggling with getting things
> formatted as I like until now :) and this is my first time using slideshow,
> so I'm pretty slow.
>
> --
> 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/CAK%3D1%3DWqK3r9puu7JdM-aJ5HOE1FZSsrSwxaJvOa6eKELRTyu%3Dg%40mail.gmail.com
> 
> .
>

-- 
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/CAAmHZoeP99nP33ryzyJcGHeEhd1O9i3Wp-rSJjOCX0ac15sOVg%40mail.gmail.com.


Re: [racket-users] What’s everyone working on this week?

2019-12-10 Thread Hadi Moshayedi
Started creating some slideshows on postgres internals using #lang
slideshow: https://github.com/pykello/hadi-slides

Not much content yet, as I've been struggling with getting things formatted
as I like until now :) and this is my first time using slideshow, so I'm
pretty slow.

-- 
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/CAK%3D1%3DWqK3r9puu7JdM-aJ5HOE1FZSsrSwxaJvOa6eKELRTyu%3Dg%40mail.gmail.com.


Re: [racket-users] What’s everyone working on this week?

2019-12-10 Thread Ryan Johnson
C programming >:(

On Tue, Dec 10, 2019 at 2:13 AM Stephen De Gabrielle <
spdegabrie...@gmail.com> wrote:

> New week, new Racket! What are you folks up to? Answer here or
>
> * https://racket.slack.com/ (Sign up at
> https://racket-slack.herokuapp.com/ )
> * #racket IRC on freenode.net https://botbot.me/freenode/racket/
> * Tweet @racketlang on Twitter
> * Racket discord
> https://discord.gg/6Zq8sH5
>
> Don’t forget to
> * sign up, or contribute, to Racket News https://racket-news.com/
> * submit your links to Racket Stories https://racket-stories.com/
> --
> 
>
> --
> 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/CAGHj7-%2ByS-GzsJd7uThFem-ufrPkhSoX6MBifTRaPCG1%3D%3DNCpg%40mail.gmail.com
> 
> .
>
-- 
Ryan Johnson
Free Software Foundation

Electronic Frontier Foundation 

-- 
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/CAH3UMPE2iqtXJPOgYY9kpfkZeecFiJT8%2BehzcsGjufDnG8iPXA%40mail.gmail.com.


Re: [racket-users] Re: srfi-171 transducers for racket

2019-12-10 Thread Linus Björnstam
For racket it does not work out of the box, but for scheme srfi69 allows for 
arbitrary equality predicates and specialized hash functions. I believe r6rs 
hashtables has a string-CI-hash, but I can be wrong.

For the racket port I removed that functionality, since I couldn't do it easily 
using the default hash tables. For that you can use make-custom-hash: 
https://docs.racket-lang.org/reference/dicts.html?q=hash#%28def._%28%28lib._racket%2Fdict..rkt%29._make-custom-hash%29%29
 b

You could just wrap the hash function with something that normalizes strings 
and chars and whatever other data types you think you can use, but that would 
mean an eternal chase for edge cases.

-- 
  Linus Björnstam

On Tue, 10 Dec 2019, at 19:54, Jack Firth wrote:
> > The "tdelete-duplicates" uses a hash-table to store already seen 
> elements: if the element is in the hash table, just filter it out. If 
> it is not, we do: (hash-set! already-seen element #t). That should be 
> constant timeish.
> I understand how that works for the usual eq? / eqv? / equal? equality 
> relations, but how could that work for *arbitrary* equivalence 
> relations? If you passed a case-insensitive string comparison function 
> to tdelete-duplicates, storing already seen elements in a hash table 
> wouldn't help because two "equal" strings could have different hash 
> codes.
> 
>  -- 
>  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/90506548-c7fc-4f0d-9321-00cb03490aec%40googlegroups.com
>  
> .

-- 
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/7f77372c-8512-48ce-a70c-4182b61fc197%40www.fastmail.com.


Re: [racket-users] Re: srfi-171 transducers for racket

2019-12-10 Thread Jack Firth

>
> The "tdelete-duplicates" uses a hash-table to store already seen elements: 
> if the element is in the hash table, just filter it out.  If it is not, we 
> do: (hash-set! already-seen element #t). That should be constant timeish.
>
 
I understand how that works for the usual eq? / eqv? / equal? equality 
relations, but how could that work for *arbitrary* equivalence relations? 
If you passed a case-insensitive string comparison function to 
tdelete-duplicates, storing already seen elements in a hash table wouldn't 
help because two "equal" strings could have different hash codes.

-- 
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/90506548-c7fc-4f0d-9321-00cb03490aec%40googlegroups.com.


[racket-users] How can I tell Typed Racket that xexpressions are xexpressions?

2019-12-10 Thread Marc Kaufmann
Welcome to this week's edition of "Confusing myself with Typed Racket".*

I want to import `response/xexpr-wrap` -- a version of `response/xexpr` 
that does some additional styling -- in a typed/racket file. So thanks to 
Ben and Jon in another thread, I now do

```
(require/typed xml [#:opaque Xexpr xexpr?])
(require/typed "tools.rkt" [#:opaque Response response?] 
[response/xexpr-wrap (-> Xexpr Response)])

(define x '(body (h1 "Not so Hello world")))
(response/xexpr-wrap x)
```

And this does not work. I get the error

```
expected: Xexpr
given: (List 'body (List 'h1 String))
```

even though it passes the `(xexpr? x)` passes, returning #t. I was somewhat 
surprised by this, but I guess the issue is that opaque types can only work 
at runtime on code from non-typed modules. However, since I pass `x` as an 
argument in my file, the type checker wants to type check it now, rather 
than putting contracts around the arguments passed into 
`response/xexpr-wrap`. 

If this is the case, is it possible to use opaque types to type check 
arguments into functions required from non-typed modules? Well, I can 
probably hack my way around this: I write a non-typed function in 
`tools.rkt` called `this-is-an-xexpr` which I require/typed with `(-> Any 
Xexpr)`, which if I understand things correctly should put run-time 
contracts around that function, but type check. (See below, I went and 
checked whether this worked, and it does.) A less hacky way would be to be 
less lazy and define an Xexpr type via `define-type Xexpr (U String Symbol 
(Listof ...)...)` and so on. This is probably what I'll do, but I wanted to 
know what is going on anyway.

If it is not the case, what is going on that makes this not work?

Despite having found a way to make this work, I'd like to know if there is 
a non-hacky way, whether I understand correctly why my naive approach 
failed, and what the (or a) recommended way of doing this is. 

Cheers - until next time.

Marc

EDIT LATER: Hah, my hack works! 

```{tools.rkt}
#lang racket

(provide make-xexpr ...)
(define (make-xexpr xexpr)
  xexpr)
```

and then in my typed file:

```
#lang typed/racket

(require/typed "tools.rkt" 
  [#:opaque Response response?]
  [#:opaque Xexpr xexpr?]
  [make-xexpr (-> Any Xexpr)]
  [response/wrap-xexpr (-> Xexpr Response)])

(define x '(body (h1 "Not so Hello world")))
(response/wrap-xexpr (make-xexpr x))
```

and this works. Nice, in an ugly kind of way.

*: Despite said confusion, ever since I got past the initial hump of using 
Typed Racket, it's been really useful though as it catches a substantial 
fraction of my bugs that would require sprinkling lots of printfairy dust 
to find and fix.

-- 
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/0e428a87-095a-48fc-a31a-b393f4672642%40googlegroups.com.


[racket-users] Working on 2D and 3D graphics.

2019-12-10 Thread Hendrik Boom
On Tue, Dec 10, 2019 at 08:13:32AM +, Stephen De Gabrielle wrote:
> New week, new Racket! What are you folks up to? Answer here or

Still tinkering with Rackettown.  I'd love to convert it to typed 
Racket, but the association list mechanism is inherently typeless.
(Or, I suspect, only typable in some not-easily-decidable 
type-theoretical logic).

Still looking at 3D graphics (you can find some of this in the 
Rackettown file 3d-notes).  There are a fair number of 3D-related 
packages in the Racket package library, but far too many of them 
currently don't compile or fail their test sets.

And there seems to be an opengl binding on its own, separate from the 
one hidden away in pict3d.  I'm no sure how the two are related.

I may find the best alternative for a 3D rackettown is to use openGL 
directly.  The buffer handling in pict3D and the triangle meshes in 
3d-model may be useful.  But it's not clear how to relate these meshes 
to opengl.

-- hendrik

kk

-- 
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/20191210135830.xwvb4cqwih54gajh%40topoi.pooq.com.


[racket-users] Any examples of multi-language applications or packages

2019-12-10 Thread Stephen De Gabrielle
Hi Racketeers,

Please let me know if you are aware of any examples of multi-language
applications or packages. Specifically multi-‘#lang’ package/app examples.

Kind regards

Stephen

PS I was looking at Polyglot and thinking about sorting out some sort of
website when  the question came up, and I thought about how someone used
#lang rosette in advent-of-code.

Polyglot: https://sagegerard.com/polyglot-doc-update.html
-- 


-- 
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/CAGHj7-%2BMq%2Bgi-7XtVxo4p8%3Dtj8LAu-%3D6FqLiScjv6sYj_j-hsw%40mail.gmail.com.


Re: [racket-users] Re: srfi-171 transducers for racket

2019-12-10 Thread Linus Björnstam
Hi Jack!

The "tdelete-duplicates" uses a hash-table to store already seen elements: if 
the element is in the hash table, just filter it out.  If it is not, we do: 
(hash-set! already-seen element #t). That should be constant timeish. This 
means that you cannot (and should not) use the same reducing function as 
returned by ((tdelete-duplicates) rcons) for reducing different collections 
(unless you want to delete the duplicates in the first collection in the second 
collection as well). the transducer->reducer process is o(n), and the amount of 
transducers composed is usually small, so there is no need to re-use a reducer 
function unless you actually want to.

I would love some help into making it a racket pkg if you have the time. I have 
absolutely zero experience. I can probbly port the test suite myself, but I 
have quite a lot of similar work to do (srfi-document->texinfo for guile), so 
that will be quite some time in the future.
-- 
  Linus Björnstam

On Tue, 10 Dec 2019, at 12:02, Jack Firth wrote:
> This is great! Thank you for your work on this srfi. Transducers are 
> relatively new to Racket's ecosystem and I'm happy to see more of the 
> design space being explored.
> 
> > The documentation in the SRFI document still holds with some small caveats: 
> > bytevector-u8-reduce/transduce is now bytes-transduce/reduce and 
> > tdelete-duplicates now takes three symbols 'eq?, 'eqv? or 'equal? instead 
> > of arbitrary equality predicates.
> 
> I have a question about that. While implementing the deduplicating 
> 
>  transducer, I tried to figure out a way to make it support arbitrary 
> equality relations. But as far as I could tell 
> , 
> it's impossible to do that in less than quadratic time because there's no way 
> to check whether something is a duplicate without comparing it to every 
> unique element seen so far. Is there an implementation of this SRFI that 
> figured out an efficient way to do this in the general case?
> 
> > I have really no idea how to package things for racket, nor do I have much 
> > interest in doing so. I have played with it a bit, it seems to work. There 
> > is a small test-suite still written in guile scheme, which should be 
> > trivial to port. If someone wants to package this as a proper racket 
> > package, I would be happy to accept pull requests or even transfer the 
> > repository to someone else. The license used is sub-licenseable, so feel 
> > free. If I find the repo to my liking I will deprecate my port and link to 
> > you.
> > 
> > Ideas for changes I would have done if I was using racket more than I 
> actually do: a (transduce ...)-form that uses rackets sequence 
> interface. Package it so It could be installed using raco. Port the 
> test-suite. Another part is figuring out what to call the library. 
> I'd be happy to write an `info.rkt` that packages the code. For a 
> package name, I suggest `srfi-171`. Would you be interested in writing 
> Scribble documentation for the package?
> 
> > The rebellion transducers seem to be aimed at another use-case (streaming 
> > data, and parallelism) with other kind of guarrantees. It has a 
> > _significantly_ higher overhead. I tried the following in rebellion 
> > 
> > #lang racket 
> > (require rebellion/streaming/transducer) 
> > (require rebellion/collection/list) 
> > 
> > (define lst (build-list 10 values)) 
> > 
> > (time (length (transduce (in-list lst) 
> >  (filtering odd?) 
> >  (mapping (lambda (x) (* x x))) 
> >  #:into into-list))) 
> > 
> > and it takes about 5 seconds. The same thing using srfi-171 styled 
> > transducers takes about 3ms (if my head is with me this morning, that is 
> > about 1650x). I suspect I might be doing something wrong, or that there 
> > might be some quadratic behaviour somewhere.
> 
> You're not doing anything wrong. Rebellion's transducers have awful 
> constant (but not quadratic) factors and make lots of unnecessary 
> allocations. There's no fundamental reason for this; the protocol can 
> support efficient zero-allocation transducer implementations perfectly 
> fine. I just haven't put work into that yet. See this issue 
>  for a summary of 
> the problem and some possible ways to improve performance. For anyone 
> reading this who's interested in benchmarking and optimizing tight 
> loops, I'd love to hear your input.
> 
>  -- 
>  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 
> 

[racket-users] Re: srfi-171 transducers for racket

2019-12-10 Thread Jack Firth
This is great! Thank you for your work on this srfi. Transducers are 
relatively new to Racket's ecosystem and I'm happy to see more of the 
design space being explored.

The documentation in the SRFI document still holds with some small caveats: 
> bytevector-u8-reduce/transduce is now bytes-transduce/reduce and 
> tdelete-duplicates now takes three symbols 'eq?, 'eqv? or 'equal? instead 
> of arbitrary equality predicates.
>

I have a question about that. While implementing the deduplicating 

 
transducer, I tried to figure out a way to make it support arbitrary 
equality relations. But as far as I could tell 
, 
it's impossible to do that in less than quadratic time because there's no 
way to check whether something is a duplicate without comparing it to every 
unique element seen so far. Is there an implementation of this SRFI that 
figured out an efficient way to do this in the general case?

I have really no idea how to package things for racket, nor do I have much 
> interest in doing so. I have played with it a bit, it seems to work. There 
> is a small test-suite still written in guile scheme, which should be 
> trivial to port. If someone wants to package this as a proper racket 
> package, I would be happy to accept pull requests or even transfer the 
> repository to someone else. The license used is sub-licenseable, so feel 
> free. If I find the repo to my liking I will deprecate my port and link to 
> you.
>
> Ideas for changes I would have done if I was using racket more than I 
> actually do: a (transduce ...)-form that uses rackets sequence interface. 
> Package it so It could be installed using raco. Port the test-suite. 
> Another part is figuring out what to call the library. 


I'd be happy to write an `info.rkt` that packages the code. For a package 
name, I suggest `srfi-171`. Would you be interested in writing Scribble 
documentation for the package?

The rebellion transducers seem to be aimed at another use-case (streaming 
> data, and parallelism) with other kind of guarrantees. It has a 
> _significantly_ higher overhead. I tried the following in rebellion 
>
> #lang racket 
> (require rebellion/streaming/transducer) 
> (require rebellion/collection/list) 
>
> (define lst (build-list 10 values)) 
>
> (time (length (transduce (in-list lst) 
>  (filtering odd?) 
>  (mapping (lambda (x) (* x x))) 
>  #:into into-list))) 
>
> and it takes about 5 seconds. The same thing using srfi-171 styled 
> transducers takes about 3ms (if my head is with me this morning, that is 
> about 1650x). I suspect I might be doing something wrong, or that there 
> might be some quadratic behaviour somewhere.
>

You're not doing anything wrong. Rebellion's transducers have awful 
constant (but not quadratic) factors and make lots of unnecessary 
allocations. There's no fundamental reason for this; the protocol can 
support efficient zero-allocation transducer implementations perfectly 
fine. I just haven't put work into that yet. See this issue 
 for a summary of the 
problem and some possible ways to improve performance. For anyone reading 
this who's interested in benchmarking and optimizing tight loops, I'd love 
to hear your input.

-- 
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/8c036a47-6d90-4bcd-bfd3-fdfdd2f8d05b%40googlegroups.com.


[racket-users] srfi-171 transducers for racket

2019-12-10 Thread Linus Björnstam
Hi everyone!

I was asked to port my srfi-171 (transducers) to racket by a staggering number 
of people (3!!), so by extremely popular demand (by my standards) I have done 
so: https://git.sr.ht/~bjoli/racket-srfi-171-transducers

These transducers are more or less the same as the ones in clojure, so they 
have very little overhead (each transduction step is just a procedure call) and 
work eagerly. They currently use mutable hidden state (like the clojure 
transducers) for the stateful transducers, but someone clever could probably 
make the state at least visible without too much performance impact. The 
simplest way would be visible mutable state, which I had working for 
guile-scheme but chose not to use because it became very slow in some schemes.

The documentation in the SRFI document still holds with some small caveats: 
bytevector-u8-reduce/transduce is now bytes-transduce/reduce and 
tdelete-duplicates now takes three symbols 'eq?, 'eqv? or 'equal? instead of 
arbitrary equality predicates.

I have really no idea how to package things for racket, nor do I have much 
interest in doing so. I have played with it a bit, it seems to work. There is a 
small test-suite still written in guile scheme, which should be trivial to 
port. If someone wants to package this as a proper racket package, I would be 
happy to accept pull requests or even transfer the repository to someone else. 
The license used is sub-licenseable, so feel free. If I find the repo to my 
liking I will deprecate my port and link to you. 

Ideas for changes I would have done if I was using racket more than I actually 
do: a (transduce ...)-form that uses rackets sequence interface. Package it so 
It could be installed using raco. Port the test-suite. Another part is figuring 
out what to call the library. 

The SRFI-document can be found here: 
https://srfi.schemers.org/srfi-171/srfi-171.html

The rebellion transducers seem to be aimed at another use-case (streaming data, 
and parallelism) with other kind of guarrantees. It has a _significantly_ 
higher overhead. I tried the following in rebellion

#lang racket
(require rebellion/streaming/transducer)
(require rebellion/collection/list)

(define lst (build-list 10 values))

(time (length (transduce (in-list lst)
 (filtering odd?)
 (mapping (lambda (x) (* x x)))
 #:into into-list)))

and it takes about 5 seconds. The same thing using srfi-171 styled transducers 
takes about 3ms (if my head is with me this morning, that is about 1650x). I 
suspect I might be doing something wrong, or that there might be some quadratic 
behaviour somewhere.

Anyway, go forth and have some fun!

Best regards
Linus Björnstam
 - Just a lowly classical musician programming for fun

-- 
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/1154d9aa-de51-4292-9a08-b2e8f3150ca2%40www.fastmail.com.


[racket-users] What’s everyone working on this week?

2019-12-10 Thread Stephen De Gabrielle
New week, new Racket! What are you folks up to? Answer here or

* https://racket.slack.com/ (Sign up at https://racket-slack.herokuapp.com/
)
* #racket IRC on freenode.net https://botbot.me/freenode/racket/
* Tweet @racketlang on Twitter
* Racket discord
https://discord.gg/6Zq8sH5

Don’t forget to
* sign up, or contribute, to Racket News https://racket-news.com/
* submit your links to Racket Stories https://racket-stories.com/
-- 


-- 
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/CAGHj7-%2ByS-GzsJd7uThFem-ufrPkhSoX6MBifTRaPCG1%3D%3DNCpg%40mail.gmail.com.