[racket-users] Re: Detecting broken inbound TCP connections

2022-07-02 Thread Tony Garnock-Jones
Ah, sorry, try `eof-evt` instead of `port-closed-evt`. When I swap the one 
for the other, your program gives the output you expected. Perhaps port 
closing is something for the Racket program to do, and is separate from the 
signalling from the remote peer. You'll get an `eof-object?` value from 
read routines when the connection closes.

On Saturday, July 2, 2022 at 12:52:01 AM UTC+2 Jeff Henrikson wrote:

> Hi Tony,
>
> Thanks for offering your interpretation of the racket reference manual.  
> Below is my attempt to test whether or not the input port does indeed 
> become closed when the TCP connection is broken.
>
> The broken TCP connection is provided by combining curl with GNU 
> coreutils timeout.
>
> I try testing the input port for closedness two different ways. The 
> default code tests with port-closed-evt. The commented out code tests by 
> calling port-closed? in a loop.  Neither method succeeds in detecting 
> the broken TCP connection.
>
> Thanks for any help.
>
> Regards,
>
>
> Jeff Henrikson
>
>
> #lang racket
>
> ;; Tony Garnock-Jones, 
> https://groups.google.com/g/racket-users/c/H43jr8QuM-4
> ;;   "... if the connection breaks, the ports will be closed as usual. . 
> . ."
>
> (define (handle-by-event in out k)
>   ; Discard the HTTP request header (up to blank line):
>   (regexp-match #rx"(\r\n|^)\r\n" in)
>   (displayln "about to sleep")
>   (flush-output (current-output-port))
>   (let ((evt (sync/timeout 10 (port-closed-evt in
> (if evt
>   (begin
> (displayln "got close evt\n")
> (k))
>   (begin
> (displayln "done sleeping")
> (flush-output (current-output-port))
> (display "HTTP/1.0 200 Okay\r\n" out)
> (display "Server: k\r\nContent-Type: text/html\r\n\r\n" out)
> (display "Hello, world!" out)
> (k)
>
> ;; same as handle-by-event but using port-closed? instead of 
> port-closed-evt
> (define (handle-by-polling in out k)
>   (define (iter i)
> (when (> i 0)
> (printf "closed=~a\n" (port-closed? in))
> (sleep 1)
> (iter (- i 1
>   ; Discard the request header (up to blank line):
>   (regexp-match #rx"(\r\n|^)\r\n" in)
>   (displayln "about to sleep")
>   (flush-output (current-output-port))
>   (iter 10)
>   (displayln "done sleeping")
>   (flush-output (current-output-port))
>   (display "HTTP/1.0 200 Okay\r\n" out)
>   (display "Server: k\r\nContent-Type: text/html\r\n\r\n" out)
>   (display "Hello, world!" out)
>   (k))
>
>
> (define (accept-and-handle listener)
>   (define-values (in out) (tcp-accept listener))
>   ;; alternatively: (handle-by-polling in out (lambda ()
>   (handle-by-event in out (lambda ()
> (displayln "handle finished")
>   ))
>   (close-input-port in)
>   (close-output-port out))
>
> (define (serve port-no)
>   (define listener (tcp-listen port-no 5 #t))
>   (define (loop)
> (accept-and-handle listener)
> (loop))
>   (loop))
>
> (serve 8000)
>
> #|
> Test with curl and GNU coreutils timeout:
> timeout --foreground 3s curl http://127.0.0.1:8000
> actual output (handle-by-event version):
> about to sleep
> done sleeping
> handle finished
> expected output  (handle-by-event version):
> about to sleep
> got close evt
> handle finished
>
> Tested on:
> Racket v8.0 cs
> on Ubuntu 20.04.4 LTS
> |#
>
>
> > Hi Jeff,
> >
> > You can use `tcp-listen` and `tcp-accept` [0] to accept connections. 
> > Once accepted, the connection appears as a matched pair of ports, one 
> > for input and one for output, and if the connection breaks, the ports 
> > will be closed as usual. In some circumstances, you will get an 
> > exception such as "connection reset" (see `exn:fail:network`). If you 
> > need to reliably distinguish closed-by-peer, all-ok from 
> > closed-by-weird-network-weather, your application protocol has to 
> > handle that, there's nothing TCP can do for you there. HTTP does this 
> > via content-length and/or chunking, for example.
> >
> > Cheers,
> >   Tony
> >
> > [0]: https://docs.racket-lang.org/reference/tcp.html
> >
> > On 6/30/22 11:34 AM, Jeff Henrikson wrote:
> >> Racket users,
> >>
> >> How do I accept an inbound TCP connection so that once I am 
> >> processing it, if the connection is broken by the client or network, 
> >> my program promptly finds out?
> >>
> >> Regards,
> >>
> >>
> >> Jeff Henrikson
> >>
>
>

-- 
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/9dae05ac-1a29-4384-976c-7c4e57dff197n%40googlegroups.com.


[racket-users] Re: Detecting broken inbound TCP connections

2022-07-01 Thread Tony Garnock-Jones
Hi Jeff,

On Thursday, June 30, 2022 at 8:34:44 PM UTC+2 Jeff Henrikson wrote:

> How do I accept an inbound TCP connection so that once I am processing 
> it, if the connection is broken by the client or network, my program 
> promptly finds out? 
>

You can use `tcp-listen` and `tcp-accept` [0] to accept connections. Once 
accepted, the connection appears as a matched pair of ports, one for input 
and one for output, and if the connection breaks, the ports will be closed 
as usual. In some circumstances, you will get an exception such as 
"connection reset" (see `exn:fail:network`). If you need to reliably 
distinguish closed-by-peer, all-ok from closed-by-weird-network-weather, 
your application protocol has to handle that, there's nothing TCP can do 
for you there. HTTP does this via content-length and/or chunking, for 
example.

Cheers,
  Tony

[0]: https://docs.racket-lang.org/reference/tcp.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/d0a1ace1-e14f-4062-8d83-f160165ef9a5n%40googlegroups.com.


[racket-users] Re: Strange readline/racket-mode behavior

2021-09-28 Thread Tony Garnock-Jones
Hi Winston,

I've submitted a suggested improvement to interactive REPLish behaviour 
around read-char and read-line here: 
https://github.com/racket/racket/pull/4007

Please let me know if it improves the situation for you. And of course, if 
anyone else has comments about this kind of thing, please let me know!

Here's the commit comment explaining a little more of the situation:

`winny` on IRC (and subsequently on the mailing list [1]) remarked
that, at the REPL,

```racket
Welcome to Racket v8.2.0.8 [cs].
> (read-line)
""
>
```

which is surprising, since it didn't appear to wait for a line of
input.

Guile does this differently, with its `read-eval-print-loop`
apparently consuming any whitespace after the `read` expression and
before starting the `eval`.

This patch performs a similar trick. In *interactive* contexts
(namely, by action of the default `current-read-interaction`), if
`read-syntax` answers non-`eof`, a procedure
`discard-line-terminators` peeks for and consumes a *single* CR, LF or
CRLF line terminator.

Non-interactive contexts are not affected.

This is very much a special-case in order to improve user experience:
I feel like, because it's an amendment to the REPL and the top-level
is hopeless [2], it's fair game to introduce exceptional handling like
this.

[1]: https://groups.google.com/g/racket-users/c/qUIFqWkkvFs/m/AERXYmfGBgAJ
[2]: https://gist.github.com/samth/3083053

Cheers,
  Tony

On Friday, September 24, 2021 at 9:01:37 PM UTC+2 cr5...@gmail.com wrote:

> Hey everyone,
>
> I was working on a procedure to prompt the user for confirmation and found
> something a bit strange - it did not appear to read for input when usingt
> "racket -i" or in the Emacs Racket REPL buffer. Here is the code:
>
> (define (yn #:read-one-char? [read-one-char? #f])
> (display "y/n: ")
> (flush-output (current-output-port))
> (if read-one-char?
> (match (read-char)
> [(or #\y #\Y) #t]
> [m #f])
> (match (read-line)
> [(or "y" "Y") #t]
> [m #f])))
>
> Regardless if I use read-char or read-line and type y or Y, the behavior 
> seeims
> similar, each of the match's second clause is followed because (read-char)
> returns #\newline whereas read-line returns "" (empty string).
>
> I mentioned this strange behavior on the Libera chat and got an 
> enlightening
> response from tonyg outlining what is happening:
>
> > at the repl, if you type "(read-char)" and press enter, the reader sees 
> ( r e
> > a d - c h a r ) NEWLINE. When it gets to the close-parenthesis, it 
> executes
> > the expression, which reads the NEWLINE character and returns. Similar 
> for
> > read-line, where it sees NEWLINE and returns an empty line
> >
> > try typing (list (read-line) (read-line))
>
> I can confirm tonyg's solution works. The (list (read-char) (read-char)) 
> also
> appears to work, though one always has to type a final newline to send the
> line-buffered input.
>
> The behavior feels very surprising and took me a bit of time to figure out,
> even then I didn't really understand it so I had to ask for help. Can this
> behavior be changed in a future release? Is a reasonable request or could 
> this
> break a lot of code? If this could break stuff, is it worth doing changing 
> it
> anyway, so the behavior is less surprising? I hope to understand if it's
> agreeable to make a PR for this change before investing the time.
>
> Keep on Racketing!
>
> Winston Weinert
> winny.tech
>

-- 
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/c48a0f87-92f8-46b1-baae-6c6813f21337n%40googlegroups.com.


[racket-users] Registered on irc.libera.chat

2021-05-22 Thread Tony Garnock-Jones
Hi all,

I just registered the Racket project on irc.libera.chat with ownership of 
#racket and #racket-*.

Would those who have served as chanops on freenode who are willing to also 
do the same for libera.chat please email me privately to let me know your 
nick etc.?

Thanks!

Tony

-- 
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/a3b34f89-10c9-4f14-915f-9622ca690e41n%40googlegroups.com.


Re: [racket-users] Freenode -> libera.chat

2021-05-20 Thread Tony Garnock-Jones
https://web.archive.org/web/20210520002957/http://kline.sh/ is a good starting 
point.

On 20 May 2021, 15:12, at 15:12, David Storrs  wrote:
>What happened with Freenode?
>
>On Thu, May 20, 2021 at 8:12 AM Tony Garnock-Jones <
>to...@leastfixedpoint.com> wrote:
>
>> On 5/20/21 1:28 PM, Paulo Matos wrote:
>> > Tony Garnock-Jones writes:
>> >> With the recent damage to the Freenode IRC network, a new
>`#racket` has
>> >> been founded on irc.libera.chat.
>> >
>> > Is this to become the canonical IRC chat room for Racket?
>>
>> ¯\_(ツ)_/¯
>>
>> I'd be in favour of moving off Freenode, myself.
>>
>> What would need updating? Presumably little more than the following:
>>
>>- https://racket-lang.org/irc-chat.html
>>
>> ? Is freenode mentioned anywhere else?
>>
>> Cheers,
>>Tony
>>
>> --
>> 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/4956afef-9ef6-cf9d-d2ce-61d83d3780ec%40leastfixedpoint.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/1fe52f10-762a-483c-b4fc-ea35e3cb0aa8%40leastfixedpoint.com.


Re: [racket-users] Freenode -> libera.chat

2021-05-20 Thread Tony Garnock-Jones

On 5/20/21 1:28 PM, Paulo Matos wrote:

Tony Garnock-Jones writes:

With the recent damage to the Freenode IRC network, a new `#racket` has
been founded on irc.libera.chat.


Is this to become the canonical IRC chat room for Racket?


¯\_(ツ)_/¯

I'd be in favour of moving off Freenode, myself.

What would need updating? Presumably little more than the following:

  - https://racket-lang.org/irc-chat.html

? Is freenode mentioned anywhere else?

Cheers,
  Tony

--
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/4956afef-9ef6-cf9d-d2ce-61d83d3780ec%40leastfixedpoint.com.


[racket-users] Freenode -> libera.chat

2021-05-20 Thread Tony Garnock-Jones

Just a heads up,

With the recent damage to the Freenode IRC network, a new `#racket` has 
been founded on irc.libera.chat.

I've moved over there (nick `tonyg` still) and deleted my Freenode account 
(such as it was).

Cheers,
  Tony

-- 
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/b60d3ddc-601b-4166-89ce-98bb1a1d49d9n%40googlegroups.com.


Re: [racket-users] Re: public email addresses on packages server

2021-02-24 Thread Tony Garnock-Jones
Hi Roger,

On Wed, 24 Feb 2021 at 15:55, Roger Keays  wrote:

> I was just thinking along the lines of adding a "name" field to the table
> with the user/login data. If it is set, then it is displayed instead of the
> email. You should be able to search by this field too of course.
>

That sounds sensible. Thanks!

The email fields are also currently included in the JSON metadata for each
package. For example, here's the (abbreviated) stanza for one of my
packages in the catalog's https://pkgs.racket-lang.org/pkgs-all.json.gz
file:

   "ansi" : {
  "author" : "tonygarnockjo...@gmail.com",
  "authors" : [
 "tonygarnockjo...@gmail.com"
  ],
  "build" : { ... },
  "checksum" : "c14081de59bc7273f1f9088a51d6d9c202b2b9d0",
  "description" : "ANSI and VT10x escape sequences for Racket.",
  "modules" : [ ... ],
  "name" : "ansi",
  "search-terms" : {
 ":build-success:" : true,
 "author:tonygarnockjo...@gmail.com" : true,
 "ring:1" : true,
 "terminal" : true
  },
  "source" : "github://github.com/tonyg/racket-ansi/master",
  "tags" : ["terminal"],
  "versions" : {
 "default" : {
"checksum" : "c14081de59bc7273f1f9088a51d6d9c202b2b9d0",
"source" : "github://github.com/tonyg/racket-ansi/master",
"source_url" : "http://github.com/tonyg/racket-ansi/tree/master;
 }
  }
   },

There's also an s-expression equivalent.

Do you have any thoughts on what, if anything, should be done about these
files?

Regards,
  Tony

-- 
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/CAM8fPiT%3DOuLg0%2BWjLrrQ1v1_w6i566vayuSXbx-nQrCsV9nUgw%40mail.gmail.com.


[racket-users] Re: public email addresses on packages server

2021-02-24 Thread Tony Garnock-Jones
No, but it's an interesting thought. It might be quite a lot of design work 
to come up with something that made sense, but would you like to sketch out 
a proposal here to make the idea a little more concrete? I can't promise 
anything, but it'd be good to know the kinds of requirements that might be 
involved.


On Tuesday, February 23, 2021 at 12:49:18 PM UTC+1 Roger Keays wrote:

> Has any consideration been given to concealing email addresses on 
> pkgs.racket-lang.org for privacy purposes?
>
>

-- 
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/080327d5-4d33-48bf-8d2f-870f1532b109n%40googlegroups.com.


[racket-users] Re: Does password reset work on pkgs.racket-lang.org?

2021-02-18 Thread Tony Garnock-Jones
Hi Danny,

It should work now! Please give it a try. If it doesn't work, please email 
me directly (to...@leastfixedpoint.com).

Tony



On Sunday, January 31, 2021 at 3:55:57 AM UTC+1 dann...@gmail.com wrote:

> Hi everyone,
>
> Unfortunately, it looks like the password on my account (
> dy...@hashcollision.org) on pkgd.racket-lang.org got compromised 
> recently, so I'm trying to figure out how to reset it now.
>
> I don't see an option to do so except in the Login page.  When I try to do 
> so, I ask it to "Email me a code", but it doesn't seem to be working.  I've 
> checked my spam folder just to check, but don't see it in there as well.  
> Any suggestions?
>
> Thanks in advance!
>

-- 
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/296f0fc4-9edf-43f0-b2c6-ca743c67279cn%40googlegroups.com.


[racket-users] Re: changing my email address on the package server?

2021-02-18 Thread Tony Garnock-Jones
We should* eventually decouple email from account-identity, so that after 
an *initial* introduction to the system, changing one's email address is 
straightforward to do. But we haven't done that yet and I don't have time 
to do it anytime soon, I'm afraid. So I think Jay's offer of a manual 
database rewrite is the way to go :-)

Tony



On Thursday, December 10, 2020 at 6:44:41 AM UTC+1 je...@lisp.sh wrote:

> Is it possible to change my email address on the package server? It 
> doesn't appear so, but perhaps I'm missing something. If not, what would be 
> the recommended way of accomplishing an email change? I can create a new 
> account, of course. But how to claim ownership of an existing package? Can 
> one "abandon" a package with account X and "claim" the package with account 
> Y?
>
> Jesse
>

-- 
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/4f48e41e-e6f1-4fe9-ac6c-cb20f626ce34n%40googlegroups.com.


[racket-users] Package server registration/reset email code flow changed

2021-02-18 Thread Tony Garnock-Jones

Hi all,

Just to let you know I updated the package server to have a slightly 
different flow for password resets and account registrations, for spam 
prevention reasons. Please reply here or email me directly at 
to...@leastfixedpoint.com if you have any trouble.


Regards,
  Tony

--
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/9b8b3c0c-0d37-d051-fc68-9438ed670d68%40leastfixedpoint.com.


Re: [racket-users] Re: hashcons

2020-09-14 Thread Tony Garnock-Jones
On Mon, 14 Sep 2020 at 14:18, Hendrik Boom  wrote:

> I would, ideally, only use hashcons on those cons-cells which had
> themselves
> been hashconsed, so eq? would suffice.
>

The challenge is checking to see whether a new allocation is required.
Checking `eq?` of the cdr suffices, but seldom is `eq?` appropriate for the
car, assuming you want `(eq? (hashcons (set) '()) (hashcons (set) '()))`
and similar to hold. Canonicalize looks, roughly, like

(define (canonicalize c)
  (match c
[(cons a d) (if (cell-exists-in-weak-table-with-car-and-cdr? a d) ;; (X)
(extract-and-return-existing-cell a d)
(intern-and-return-cons-of a (canonicalize d)))]
[_ c]))

The line marked (X) will usually want to compare `a` with `equal?` and `d`
with `eq?`.

-- 
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/CAM8fPiS0moqzAfDUdtH5aBx337Mt-TrWQkZ8EQro5HHWJtkEKg%40mail.gmail.com.


Re: [racket-users] Re: hashcons

2020-09-14 Thread Tony Garnock-Jones
On Sunday, September 13, 2020 at 12:41:15 AM UTC+2 hen...@topoi.pooq.com 
wrote:

> True, but that would require rewriting list, and quasiquote, ans 
> others like that to use the hashcons. 
>
> Not impossible. 
>

One potentially useful trick is to write a function `canonicalize` which 
deeply traverses the structure of its argument, rebuilding it if necessary 
to produce the canonical representative for each piece of substructure. 
Then you can `(canonicalize (map f xs))` without having to rewrite `map`, 
and it takes (asymptotically) the same time as it would if you did alter 
`map`.

Another thing to watch out for is that hashconsing via `equal?` can be 
quite expensive for things like hash tables. I used hashconsing extensively 
in the first implementation of Syndicate and ended up having to implement 
my own treaps to get good asymptotic performance with a hashconsed 
dictionary structure.

Cheers,
  Tony
 

-- 
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/8de04262-e1c3-44b4-83a0-1a0c637e3f47n%40googlegroups.com.


Re: [racket-users] How to change package name on the package index?

2020-06-05 Thread Tony Garnock-Jones
I think the package name system is case-insensitive (??) but 
case-preserving (definitely), and certainly objects to trying to create two 
packages that differ only in case.

So renaming from FOO to foo won't work, because it considers this an 
attempt to overwrite an existing package. I think. We could probably change 
that?

But here's a trick: try renaming FOO to FOO-x, and then to foo. That might 
work.


On Friday, June 5, 2020 at 5:59:03 AM UTC+2, Siddhartha Kasivajhula wrote:
>
> ...@Alexis King  , let's say I add the new package with the 
> lowercase name but other metadata identical to the old one, including the 
> github repo and the collection name. I would then update everything I care 
> about to use the new package and then wait for a day or two for the docs to 
> show up. At that point, how would the documentation server handle the fact 
> that two packages provide identical top-level collections? Would that be 
> OK? Not sure if it matters that this is a top-level collection name.
>
>
>
>
> On Thu, Jun 4, 2020 at 8:32 PM Siddhartha Kasivajhula  > wrote:
>
>> OK, that's a good idea. I guess that still means it would lose the 
>> metadata, correct? That seems less than ideal, but I suppose it's more of 
>> an aesthetic concern.
>>
>> Re: the broader case-sensitivity consideration, for anyone interested in 
>> additional context, it looks like the python package index is case 
>> insensitive 
>> , 
>> while Ruby gems are case sensitive 
>> , although it looks like 
>> capital letters are now disallowed 
>>  following 
>> discussions including this one 
>> .
>>
>>
>> On Thu, Jun 4, 2020 at 7:41 PM Alexis King > > wrote:
>>
>>> On Jun 4, 2020, at 21:23, Siddhartha Kasivajhula >> > wrote:
>>>
>>> I'd prefer to avoid that since (1) it would lose the package metadata 
>>> and (2) it could be off the package index for up to a day (the package 
>>> index refresh cycle) during which time other packages depending on it would 
>>> be broken
>>>
>>>
>>> This isn’t quite right: it’s true that the pkg-build service only runs 
>>> once every 24 hours, but the only thing that depends on that is built 
>>> documentation. The actual package index is refreshed much more rapidly—on 
>>> the order of minutes. You wouldn’t have to wait very long at all to update 
>>> other packages.
>>>
>>> But even if you did, it wouldn’t matter, because there’s an easier 
>>> solution: add your package under the new name *before* you delete the 
>>> old name. Then you can delete the old name once you’ve ensured that 
>>> everything you care about is updated. It’s perhaps a bit strange to have 
>>> the same package simultaneously indexed under two different names, but it 
>>> shouldn’t cause any trouble.
>>>
>>> Alexis
>>>
>>

-- 
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/7a1060e0-40ff-44d2-b432-8aa883e676a5o%40googlegroups.com.


[racket-users] Are there interfaces for IP ports at least raw sockets?

2020-04-09 Thread Tony Garnock-Jones
If you've not already seen and considered it, 
https://github.com/tonyg/racket-packet-socket might be worth a look.

Regards,
Tony

-- 
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/c3279ae2-f960-406f-a74a-57ea1d12ac9c%40googlegroups.com.


Re: [racket-users] Re: Package server broken, at least five hundred intro cs students affected!

2019-10-06 Thread Tony Garnock-Jones
On Sunday, October 6, 2019 at 3:26:13 PM UTC+1, Bogdan Popa wrote:
>
> I feel like that was me.  Sorry! 
>

It was :-) No apologies please! There was nothing wrong with your packages; 
it was the package indexer at fault here.

One thing I'd like to do is formalise and then check the contracts that 
describe the information exchanged among the various infrastructure 
services. At the moment it's all very dynamic-typey, not even contracted. 
Introducing machine-checkable descriptions of some of the protocols could 
give us enough leverage to gradually refactor things into better shape.

Regards,
  Tony

-- 
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/19a72344-4700-42eb-ada9-0e6d4aa6df7e%40googlegroups.com.


[racket-users] Re: Package server broken, at least five hundred intro cs students affected!

2019-10-06 Thread Tony Garnock-Jones
Hi Gary,

On Saturday, October 5, 2019 at 11:22:30 PM UTC+1, gfb wrote:
>
> 1. What's wrong with the package server's indexing of updated packages, so 
> my students can proceed.
>

Thanks for the report, and sorry for the delay in responding.

I've made a change that ought to resolve the issue that was preventing the 
indexer from running, and restarted the indexer. It should be back up to 
date in the next few minutes.

(The issue was that some of the packages had started to take advantage of a 
feature of the dependencies list in info.rkt that allowed regular 
expressions in the platform restriction clause. When it came time for the 
indexer to convert the dependencies list to JSON, it failed because it 
didn't know how to handle regular expressions.)
 

> 2. An official channel to report problems with the package server.
>

You found it: emailing me and Jay is as good as it gets at the minute, I'm 
afraid. We should collectively maybe figure out something better for 
infrastructural issues!

Regards,
  Tony

-- 
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/6aa5eb73-e62a-4605-a310-ba3112fa198a%40googlegroups.com.


Re: [racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-08 Thread Tony Garnock-Jones
On Tue, 6 Aug 2019 at 21:15, George Neuner  wrote:

> Sockets belonging to the crashed program are in a "half-closed" state -
> unable to send, but still able to receive.  If you look in netstat you'll
> find their status is stuck in TIME_WAIT or in SYN or SYN/ACK.  There is a
> delay in cleaning up such "half-closed" sockets.  The delay is (derived
> from) a system wide parameter, and typically the wait time is on the order
> of 180 seconds.
>

Those states only apply to TCP sockets; UDP is stateless (in that way). It
still seems quite peculiar to me that UDP sockets should outlive their
process, under any circumstances. Perhaps it's a Mac-specific thing? I
wonder if it's a bug or if it's for some reason.

Tony

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


[racket-users] Re: Do custodians shutdown when Racket exits?

2019-08-06 Thread Tony Garnock-Jones
On Tuesday, August 6, 2019 at 6:27:51 PM UTC+1, David Storrs wrote:
>
> I should mention that the reason I'm looking into this is because I have 
> UDP sockets that are not getting closed.  They are managed by custodians, 
> but the custodians are not releasing them; I take this to mean that the 
> custodians are not being run.
>

How can a UDP socket survive process exit?

Tony

-- 
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/82ffed10-0cb5-42e3-ba99-66a25f1429a2%40googlegroups.com.


[racket-users] Re: #lang something // infix, optionally indentation-sensitive experimental Racket syntax

2019-07-21 Thread Tony Garnock-Jones
On Sunday, July 21, 2019 at 3:57:56 PM UTC+1, Tony Garnock-Jones wrote:
>
> Recent threads have reminded me I never properly announced "#lang 
> something", an experiment from back in 2016. 
>

I forgot to mention I also made a recording of #lang something/shell in 
action back in 2016: https://asciinema.org/a/83450

Cheers,
  Tony

-- 
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/a86f3f0f-03fe-471b-a05c-004900089aba%40googlegroups.com.


[racket-users] #lang something // infix, optionally indentation-sensitive experimental Racket syntax

2019-07-21 Thread Tony Garnock-Jones
Hi everyone,

Recent threads have reminded me I never properly announced "#lang
something", an experiment from back in 2016.

The main idea is S-expressions, but with usually-implicit parentheses
and support for prefix/infix/postfix operators. Indentation for grouping
is explicitly represented in the S-expression returned from the reader.

  + keeps a semi-structured input format: reader yields ordinary syntax
  + macros Just Work
  + you can do "if ... then ... else ...": [1]
  + you can do "... where ...": [2]
  - uses indentation (though it doesn't have to; see for example [3])
  - the function syntax isn't `function(arg, ...)`

[1]
https://github.com/tonyg/racket-something/blob/4a00a9a6d3f5aab4f28b03c53555b87e21d7/examples/if-then-else.rkt
[2]
https://github.com/tonyg/racket-something/blob/4a00a9a6d3f5aab4f28b03c53555b87e21d7/examples/where.rkt
[3]
https://github.com/tonyg/racket-something/blob/4a00a9a6d3f5aab4f28b03c53555b87e21d7/src/something/shell2.rkt

(More links at the bottom of this message)

In addition to the reader, `#lang something` provides a small selection
of special forms that take advantage of the new syntax, and `#lang
something/shell` adds Unix-shell-like behaviour and a few associated
utilities.

This program:

#lang something
for { x: 1 .. 10 }
  def y: x + 1
  printf "x ~a y ~a\n" x y

... reads as this S-expression:

(module something-module something/base
  (#%rewrite-body
   (for (block (x (block (1 .. 10
(block (def y (block (x + 1)))
   (printf "x ~a y ~a\n" x y)

The `#%rewrite-body` macro, together with its companion
`#%rewrite-infix`, consults an operator table, extendable via the
`def-operator` macro, to rewrite infix syntax into standard prefix
S-expressions.

The `block` syntax has many different interpretations. It has a macro
binding that turns it into a Racket `match-lambda*`, and it is used as
literal syntax as input to other macro definitions.

For example, here's one possible implementation of that `for` syntax:

#lang something

provide
  for

require
  for-syntax something/base
  prefix-in base_ racket/base

def-syntax for stx
  syntax-case stx (block)
_ (block (v (block exp)) ...) (block body ...)
  (syntax (base_for ((v exp) ...) body ...))

def-operator .. 10 nonassoc in-range

Notice how the `block` S-expressions are rewritten into a normal
S-expression compatible with the underlying `for` from `racket/base`.

Generally, all of these forms are equivalent

x y z  x y z:  x y z { a; b }
  a  a
  b  b

and they are read as

(x y z (block a b))

and are then made available to the normal macro-expansion process (which
involves a new infix-rewriting semi-phase).

Colons are optional to indicate a following suite at the end of an
indentation-sensitive line. Indentation-sensitivity is disabled inside
parentheses. If inside a parenthesised expression,
indentation-sensitivity can be reenabled with a colon at the end of a line:

a b (c d:
  e
  f)

= (a b (c d (block e f)))

a b (c d
  e
  f)

= (a b (c d e f))

Conversely, long lines may be split up and logically continued over
subsequent physical lines with a trailing `\`:

a b c \
  d \
  e

= (a b c d e)

Semicolons may also appear in vertically-laid-out suites; these two are
equivalent:

x y z
  a
  b; c
  d

x y z { a; b; c; d }

Suites may begin on the same line as their colon. Any indented
subsequent lines become children of the portion after the colon, rather
than the portion before.

This example:

x y z: a b
  c d
  e

reads as

(x y z (block (a b (block (c d) e

Square brackets are syntactic sugar for a `#%seq` macro:

[a; b; c; d e f]→(#%seq a b c (d e f))

[   →(#%seq a (b (block c)) (d e f))
  a
  b
c
  d e f
]

Forms starting with `block` in expression context expand into
`match-lambda*` like this:

{
  pat1a pat1b
exp1a
exp1b
  pat2a
exp2
}

→ (match-lambda*
[(list pat1a pat1b) exp1a exp1b]
[(list pat2a) exp2])

The `map*` function exported from `something/lang/implicit` differs from
`map` in `racket/base` in that it takes its arguments in the opposite
order, permitting maps to be written

map* [1; 2; 3; 4]
  item:
item + 1

map* [1; 2; 3; 4]
  item: item + 1

map* [1; 2; 3; 4]: item: item + 1

map* [1; 2; 3; 4] { item: item + 1 }

A nice consequence of all of the above is that curried functions have an
interesting appearance:

def curried x:: y:: z:
  [x; y; z]

require rackunit
check-equal? (((curried 1) 2) 3) [1; 2; 3]

Anyway, thought it worth mentioning.

A few more links:

 - The repository: https://github.com/tonyg/racket-something

 - 

[racket-users] Alpine-based docker racket images

2019-02-16 Thread Tony Garnock-Jones
Hi all,

Just a quick note to let anyone interested know I've built some Racket 7.2 
docker images: one "full" and one "minimal", from the respective source 
tarballs, and for both "x86_64" and "aarch64". I'm still working on armhf.

There's also a manifest set up against tags "latest" (for full) and 
"minimal" that will automatically pick the right architecture.

To try them:

docker run -it --rm leastfixedpoint/racket

or

docker run -it --rm leastfixedpoint/racket:minimal

The docker hub page is here:

https://hub.docker.com/r/leastfixedpoint/racket

Cheers,
  Tony

-- 
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] Re: The performance of ‘set’ vs. lists+‘remove-duplicates’

2018-12-05 Thread Tony Garnock-Jones
I suspect it will be slow because sets are generics, and generics are slow. 
For my application, it has worked well to replace set/seteq with 
hash/hasheq mapping to #t; this only works when you have total control over 
set representation as an implementation detail, of course! But for me it 
sped up my set-heavy program quite a lot.

On Tuesday, December 4, 2018 at 8:50:33 PM UTC, Leandro Facchinetti wrote:
>
> I rewrote a codebase that was using ‘set’s to use lists that I 
> ‘remove-duplicates’ whenever I ‘cons’. The result is orders of magnitude 
> faster. Do you have any idea why?
>
> -- 
> Leandro Facchinetti >
> https://www.leafac.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: What is the best way to daemonize a Racket program on linux?

2018-12-02 Thread Tony Garnock-Jones
Mostly that it's a function of the context, not the program, whether it is
to be treated as a daemon or not. But there's also a bunch of stuff to do
with whether the process is/should be a session leader or not, which is
again something the program itself shouldn't be making decisions about. djb
writes a bit about this topic here:
https://cr.yp.to/daemontools/faq/create.html#fghack . The systemd people
even seem to agree (calling a non-backgrounding daemon a "new-style
daemon"), at least as far as non-backgrounding goes:
http://0pointer.de/public/systemd-man/daemon.html#New-Style%20Daemons


On Thu, 29 Nov 2018 at 15:19, Brian Adkins  wrote:

> Just out of curiosity, why do you feel using daemon(3) is not a great
> idea? I'm not disagreeing, just curious about your reasons.
>
> On Thursday, November 29, 2018 at 5:54:42 AM UTC-5, Tony Garnock-Jones
> wrote:
>>
>> IMO using daemon(3) is not a great idea. Instead, I like to use djb's
>> daemontools https://cr.yp.to/daemontools.html to supervise my processes.
>> For example, see the `README` and the `run` script in
>> https://github.com/tonyg/racket-reloadable-example.
>>
>> Tony
>>
>>>
>>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Racket Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/racket-users/_4QYrxcWrQw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Tony Garnock-Jones
to...@leastfixedpoint.com
http://leastfixedpoint.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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Re: What is the best way to daemonize a Racket program on linux?

2018-12-02 Thread Tony Garnock-Jones
I tried to reply to Brian's question earlier but google-groups seems to
have eaten it *eyeroll*. Here's what I wrote:

[In reply to being asked why I think using daemon(3) isn't great]
Mostly that it's a function of the context, not the program, whether it is
to be treated as a daemon or not. But there's also a bunch of stuff to do
with whether the process is/should be a session leader or not, which is
again something the program itself shouldn't be making decisions about. djb
writes a bit about this topic here:
https://cr.yp.to/daemontools/faq/create.html#fghack . The systemd people
even seem to agree (calling a non-backgrounding daemon a "new-style
daemon"), at least as far as non-backgrounding goes:
http://0pointer.de/public/systemd-man/daemon.html#New-Style%20Daemons

Cheers,
  Tony


On Sat, 1 Dec 2018 at 23:12, George Neuner  wrote:

> On Thu, 29 Nov 2018 07:19:17 -0800 (PST), Brian Adkins
>  wrote:
>
> >Just out of curiosity, why do you feel using daemon(3) is not a great
> idea?
> >I'm not disagreeing, just curious about your reasons.
> >
> >On Thursday, November 29, 2018 at 5:54:42 AM UTC-5, Tony Garnock-Jones
> >wrote:
> >>
> >> IMO using daemon(3) is not a great idea. Instead, I like to use djb's
> >> daemontools https://cr.yp.to/daemontools.html to supervise my
> processes.
> >> For example, see the `README` and the `run` script in
> >> https://github.com/tonyg/racket-reloadable-example.
> >>
> >> Tony
>
> daemon(3) is not guaranteed to keep background processes running after
> the the user logs off.
>
> If you need the process to keep running - or to start automatically at
> boot - you really need to use a systemd [preferably] or init script.
> Unfortunately either of these options require root access - which can
> be a problem with some cloud VMs.
>
> George
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Racket Users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/racket-users/_4QYrxcWrQw/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Tony Garnock-Jones
to...@leastfixedpoint.com
http://leastfixedpoint.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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: What is the best way to daemonize a Racket program on linux?

2018-11-29 Thread Tony Garnock-Jones
IMO using daemon(3) is not a great idea. Instead, I like to use djb's 
daemontools https://cr.yp.to/daemontools.html to supervise my processes. 
For example, see the `README` and the `run` script in 
https://github.com/tonyg/racket-reloadable-example.

Tony


On Thursday, November 29, 2018 at 2:56:25 AM UTC, Brian Adkins wrote:
>
> I briefly looked at the daemonize package on Ubuntu linux, but couldn't 
> get it to work properly. I found the following Rosetta Code page:
>
> https://rosettacode.org/wiki/Run_as_a_daemon_or_service#Racket
>
> So, I just tried the code in that example, and it seems to work fine:
>
> (module+ main
> * ((get-ffi-obj 'daemon #f (_fun _int _int -> _int)) 0 0)*
>  (serve/servlet
>   dispatcher
>   #:log-file "hello.log"
>   #:stateless? #t
>   #:port 6995
>   #:command-line? #t
>   #:file-not-found-responder not-found
>   #:launch-browser? #f
>   #:servlet-regexp #rx""))
>
> I'm just wondering if there is a better way to accomplish this since it 
> feels a bit kludgy to me.
>
> Thanks,
> 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] cons-specific optimizations?

2018-11-28 Thread Tony Garnock-Jones
On Wednesday, November 28, 2018 at 2:43:26 AM UTC, Matthew Flatt wrote:
>
> The compilers in both cases know some facts about how `cons` relates to 
> other primitives, but they also know how structure constructors and 
> accessors relate, so it's not as big a difference at that level. 
>

There are also some runtime differences, right? For example, the 
optimisation that reduces m invocations of `length` on the same length-n 
list from O(mn) to O(m).

Is there anything else interesting like that in there?

Tony

-- 
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] Re: maintainer for alpine linux racket package (cloud containers and handhelds)

2018-11-14 Thread Tony Garnock-Jones
Here are the packages as built by the scripts I linked previously:

~/src/racket-alpine/packages/racket-alpine/x86_64$ ls -la
total 77392
drwxr-xr-x 2 tonyg tonyg 4096 Aug 29 13:27 .
drwxr-xr-x 3 tonyg tonyg 4096 Aug 29 13:08 ..
-rw-r--r-- 1 tonyg tonyg 1319 Aug 29 13:27 APKINDEX.tar.gz
-rw-r--r-- 1 tonyg tonyg 66637726 Aug 29 13:27 racket-7.0-r0.apk
-rw-r--r-- 1 tonyg tonyg  1632592 Aug 29 13:27 racket-dev-7.0-r0.apk
-rw-r--r-- 1 tonyg tonyg 6706 Aug 29 13:27 racket-doc-7.0-r0.apk
-rw-r--r-- 1 tonyg tonyg  9324919 Aug 29 13:08 racket-minimal-7.0-r0.apk
-rw-r--r-- 1 tonyg tonyg  1625139 Aug 29 13:08 racket-minimal-dev-7.0-r0.apk
-rw-r--r-- 1 tonyg tonyg 2714 Aug 29 13:08 racket-minimal-doc-7.0-r0.apk

The "full" package is about 70MB. That includes DrRacket. That "doc"
package looks pretty broken. I suspect it's a bunch of misc readmes etc; I
don't know if the main documentation is included in the "full" package.

I just tried the following, and it worked kind of ok:

   - docker run -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix racket-alpine
   /bin/sh
   - inside the container,
  - apk add gtk+ ttf-freefont
  - export DISPLAY=:0.0
  - drracket

which makes me think adding another Dockerfile for quickly spinning up a
fresh DrRacket instance might be a worthwhile thing to do as well. Hmm.

Tony


On Wed, 14 Nov 2018 at 12:20, Neil Van Dyke  wrote:

> For the handhelds, especially in this phase when everyone using it will
> be a developer... probably most of which devices will have at least 16GB
> of flash and 2GB of RAM... I think upstream's ~600MB installed default
> Racket contents (including DrRacket and manuals and everything) is a
> good match.  (Later, we might need a minimal runtime, such as to target
> lower-spec devices like smartwatches, or to deploy
> less-programmer-friendly apps, but that seems easy, if we get to that
> point.)
>
> For people who are using Alpine right now, on non-handhelds, because
> they need penny-pinching like BusyBox... maybe they need even more
> minimal contents option than upstream Racket-Minimal.  I don't know that
> that's specific to Alpine (there's also OpenWrt, future containers of
> (ahem) Blue Tie Enterprise Linux, and others).  So maybe this can be
> solved in the same way for all of those, someday, working with
> upstream.  Until then, Racket-Minimal contents is a great start.
>
> A volunteer who wants to join the Alpine Linux guild, learn their
> rituals and secret handshakes, and represent Racket well, would do a
> great service.
>
>
> Tony Garnock-Jones wrote on 11/14/18 6:19 AM:
> > I recently experimented with Alpine packages for Racket 7.x, minimal
> > and full, but ran out of steam when I realised I didn't know whether
> > "minimal" and "full" even make sense in context. Is there a need for
> > an "ultra minimal"?
> >
> > Anyway, APKBUILD etc (partially cribbed from Jakub Jirutka's Racket
> > 6.12 APKBUILD) available here: https://github.com/tonyg/racket-alpine
> >
> > There's also a couple of Dockerfiles for dockerized alpine-based Racket
> 7.
> >
> > I haven't concentrated on the DrRacket/graphical portions at all.
> >
> > Tony
> >
> > On Wednesday, November 14, 2018 at 3:30:27 AM UTC, Neil Van Dyke wrote:
> >
> > Alpine Linux is now popular for "cloud containers", and is also the
> > basis for mainline Linux for smartphones and tablets.
> >
> > An official Alpine package with the latest DrRacket would be a big
> > win
> > to help people start playing with DrRacket on some handhelds, without
> > the agony of building it themselves on their handheld (or trying to
> > cross-compile it on their own desktops).
> >
> > Once we have DrRacket packages, I'd like to have people use Racket to
> > build out apps and user interface for these open source handhelds,
> > eventually replacing most of the C and C++ code.
> >
> > So... Does anyone want to join Alpine package maintainer guild, to
> > maintain Alpine package(s) for the latest Racket releases?
> >
> > For 6.12, the necessary patches are small, the same as for the
> > stripped-down Racket-Minimal package (you don't need or want
> > "paxmark.patch"):
> >
> >
> https://git.alpinelinux.org/cgit/aports/tree/testing/racket?id=de35722a3295116d8e64305c01a1168932b56f26
> > <
> https://git.alpinelinux.org/cgit/aports/tree/testing/racket?id=de35722a3295116d8e64305c01a1168932b56f26
> >
> >
> >
> > I've successfully built and run DrRacket on Alpine in the normal
> > Racket
> > way on the devic

[racket-users] Re: maintainer for alpine linux racket package (cloud containers and handhelds)

2018-11-14 Thread Tony Garnock-Jones
I recently experimented with Alpine packages for Racket 7.x, minimal and 
full, but ran out of steam when I realised I didn't know whether "minimal" 
and "full" even make sense in context. Is there a need for an "ultra 
minimal"?

Anyway, APKBUILD etc (partially cribbed from Jakub Jirutka's Racket 6.12 
APKBUILD) available here: https://github.com/tonyg/racket-alpine

There's also a couple of Dockerfiles for dockerized alpine-based Racket 7.

I haven't concentrated on the DrRacket/graphical portions at all.

Tony

On Wednesday, November 14, 2018 at 3:30:27 AM UTC, Neil Van Dyke wrote:
>
> Alpine Linux is now popular for "cloud containers", and is also the 
> basis for mainline Linux for smartphones and tablets. 
>
> An official Alpine package with the latest DrRacket would be a big win 
> to help people start playing with DrRacket on some handhelds, without 
> the agony of building it themselves on their handheld (or trying to 
> cross-compile it on their own desktops). 
>
> Once we have DrRacket packages, I'd like to have people use Racket to 
> build out apps and user interface for these open source handhelds, 
> eventually replacing most of the C and C++ code. 
>
> So... Does anyone want to join Alpine package maintainer guild, to 
> maintain Alpine package(s) for the latest Racket releases? 
>
> For 6.12, the necessary patches are small, the same as for the 
> stripped-down Racket-Minimal package (you don't need or want 
> "paxmark.patch"): 
>
>
> https://git.alpinelinux.org/cgit/aports/tree/testing/racket?id=de35722a3295116d8e64305c01a1168932b56f26
>  
>
> I've successfully built and run DrRacket on Alpine in the normal Racket 
> way on the devices, using only the above MUSL, LibreSSL, and Makefile 
> bash-ism patches.  It was enough of a headache that people will need 
> pre-compiled Alpine packages (they'll have enough headache getting a 
> minimal Linux install on a handheld, at this early point).  I want to 
> shift that compute to Alpine's presumably more powerful build servers, 
> and shift any remaining headache to a heroic Racketeer 
>
> https://en.wikipedia.org/wiki/Alpine_linux 
> https://en.wikipedia.org/wiki/PostmarketOS 
> https://www.neilvandyke.org/postmarketos/ 
>
>

-- 
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] Configuration as main file (was Re: #lang languages and cyclic dependencies)

2017-11-29 Thread Tony Garnock-Jones
On 11/28/2017 11:58 PM, Jack Firth wrote:
> What if the configuration file was the main module of your app, instead
> of something imported by your app?

I've tried this, and it works well. I haven't used a custom config #lang
yet, but even with regular old Racket, it works very well.

For example:
https://github.com/tonyg/racket-pkg-website/blob/master/configs/tonyg.rkt

Cheers,
  Tony

-- 
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] let-immutable

2017-11-05 Thread Tony Garnock-Jones
Would it make sense to have a `let-immutable` form that was just like
`let` but that forbade use of `set!` with introduced variables?

I'm thinking it could be handy for authors of libraries that introduce a
lot of bindings in DSLs where mutability has to be strictly controlled.

I think it is probably possible to get the effect of `let-immutable`
with careful use of identifier macros, but would there be advantages
internal to the compiler/runtime of being able to up-front, primitively
declare a set of bindings as immutable?

Tony

-- 
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] tabular text display

2017-09-22 Thread Tony Garnock-Jones
Not yet parameterised or extracted for separate use, but:

  raco pkg install tabular


https://github.com/tonyg/racket-tabular/blob/29e91c9475407da4c5bee03abc2e6043693b3ff6/tabular/main.rkt#L681-L765

Example output:

Welcome to Racket v6.10.1.1.
> (require (submod tabular test))
> (require tabular)




> emp
 last-name  |department-id
--
"Rafferty"  |31
"Jones" |33
"Heisenberg"|33
"Robinson"  |34
"Smith" |34
"Williams"  |#f

> dept
department-id|department-name
-
31   |"Sales"
33   |"Engineering"
34   |"Clerical"
35   |"Marketing"

> (table-natural-join emp dept)
 last-name  |department-id|department-name
--
"Rafferty"  |31   |"Sales"
"Jones" |33   |"Engineering"
"Heisenberg"|33   |"Engineering"
"Robinson"  |34   |"Clerical"
"Smith" |34   |"Clerical"

> (->table #:columns '(X Y Z) '(("a" "bcd" "ef") ("gh" "hhu.thnt" "t")))
 X  |Y | Z

"a" |"bcd" |"ef"
"gh"|"hhu.thnt"|"t"




On 09/21/2017 10:03 PM, 'John Clements' via users-redirect wrote:
> Before I go re-inventing the wheel, I want to ask you folks: has anyone 
> written a library that prints out tabular data in a textual format?
> 
> E.G: given 
> 
> ‘((“a” “bcd” “ef”) (“gh” “hhu.thnt” “t”)
> 
> returns
> 
> "
> --
> | a  | bcd  | ef |
> | gh | hhu.thnt | t  |
> ———
> “
> 
> (sorry about the horrible damage that Apple Mail inflicts upon this message.)
> 
> … in the style of postgresql and similar display engines?
> 
> It’s easy to write one of these, but if someone else has done it, it will 
> probably have nice bells and whistles that mine won’t.
> 
> 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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] SWIG

2017-09-14 Thread Tony Garnock-Jones
I have a library for uPNP and NAT-PMP:
https://github.com/tonyg/racket-nat-traversal. It's not on the package
server for lack of round tuits, but it might be of interest. Certainly a
lot nicer not to have to go for an FFI when a Racket library might be
able to do the job.

Cheers,
  Tony


On 09/14/2017 05:58 PM, James wrote:
> Does anyone here have experience with using SWIG, http://www.swig.org/ , in 
> Racket?  The reason I ask is that I am working on an application which needs 
> NAT traversal.  One option is Libnice, which supports GObject Introspection.  
> Another possibility is PJNATH, http://www.pjsip.org/pjnath/docs/html/ , which 
> can be used by way of SWIG.  This has been done with Python and JAVA.  The 
> link above also mentions that Racket is a supported language for SWIG.  So I 
> would like to get some idea whether we are much more likely to run into 
> problems with immature code and documentation this way than with GObject 
> introspection.
> 
> James
> 

-- 
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] pkgs.racket-lang.org log in is down

2017-08-29 Thread Tony Garnock-Jones
Thanks, Philip -- I've restarted the server. We need better monitoring 
for it, but I don't have the time to fix it at the moment.


It'd also be great for Racket in general to have better visibility into 
running programs to see what's going wrong with them in situations like 
this.


All I could see was an unresponsive service that hadn't logged anything 
for about a day that was using 100% CPU. What was it doing? No way to tell!


Erlang gets this right: you can connect to a running system and see what 
it is doing.


Does Chez have anything to contribute here? Could Racket-on-Chez help me 
diagnose a mysterious silent inert 100% CPU program?


Tony



On 8/28/17 5:58 PM, Philip McGrath wrote:
Attempting to log in to pkgs.racket-lang.org 
 fails with a 503 Proxy Error:



  Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request /GET /pkgn/login 
/.


Reason: *Error reading from remote server*


Apache/2.4.7 (Ubuntu) Server at pkgd.racket-lang.org 
 Port 443


--
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.


--
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] Simple define-require-syntax question

2017-06-18 Thread Tony Garnock-Jones
On 06/17/2017 08:02 PM, Matthew Flatt wrote:
> As a `require` form, a `submod`'s binding context is taken from the
> parenthesis around the `submod`. With options (A) and (B), the context
> of those parentheses is macro-introduced.

Thanks!

So this `submod` binding context is being used to mark the
ultimately-introduced identifiers, right? So, in the example, v1 would
be marked with the (macro-introduced) context of the `submod` form. And
it is this marking that prevents the use of v1 in `main` from lining up
with the definition of v1.

This seems weird to me for two reasons.

First, it seems like since the whole point of require is to pollute the
surrounding namespace, an "unhygienic" require would be better. (I don't
know how this would work!)

And second, I'm used to macros hinging on the binding of the identifier
in their car, namely `submod` here. (Using #'submod instead of 'submod
in option (C) works fine too, incidentally.) This point is definitely
minor compared to the first one.

Either way, I was confused that the obvious thing didn't work, and maybe
other authors of define-require-syntax transformers start out confused
too. It took me quite a while, and past scars from mysterious binding
problems, to think of option (C).

My past experiences of this kind of problem have all been related to
#lang and module and require-level binding, come to think of it. It
seems a murky area. Perhaps other kinds of hygiene-preserving techniques
than those that work well for expressions are needed for these areas?

Cheers,
  Tony

PS. Why do *parentheses* have a binding context, anyway??

-- 
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] Simple define-require-syntax question

2017-06-17 Thread Tony Garnock-Jones
#lang racket
;;
;; Hi all (Matthew in particular I imagine :-) ),
;;
;; Why does option (C) work, but options (A) and (B) do not?
;;
;; They fail with:
;;
;; t.rkt:31:2: v1: unbound identifier in module
;;   in: v1
;;   context...:
;;standard-module-name-resolver
;;
;; -- Tony

(require racket/require-syntax)

;;--(A)--
;; (define-require-syntax m+
;;   (syntax-rules ()
;; [(_ xs ...)
;;  (submod ".." xs ...)]))

;;--(B)--
;; (define-require-syntax (m+ stx)
;;   (syntax-case stx ()
;; [(_ xs ...)
;;  #'(submod ".." xs ...)]))

;;--(C)--
(define-require-syntax (m+ stx)
  (syntax-case stx ()
[(_ xs ...)
 (datum->syntax stx (list* 'submod ".." #'(xs ...)))]))


(module+ m1
  (provide v1)
  (define v1 123))

(module+ main
  (require (m+ m1))
  v1)

-- 
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] Creating struct types that default parent type fields

2017-06-02 Thread Tony Garnock-Jones
On 06/02/2017 02:05 PM, David Storrs wrote:
> Suppose I have the following:
> [...]

One possible option is http://pkgs.racket-lang.org/package/struct-defaults:

~$ racket
Welcome to Racket v6.6.0.4.
> (require struct-defaults)
> (struct my-exn exn:fail ())
> (define-struct-defaults mk-my-exn my-exn ([exn-message "Oh dear!"]))
> (mk-my-exn (current-continuation-marks))
(my-exn "Oh dear!" # ...)
> (mk-my-exn (current-continuation-marks) "Huh, that's odd")
(my-exn "Huh, that's odd" # ...)

My apologies for the lack of documentation. The test module+ in the
collect's main.rkt shows most of the features of the library.

Regards,
  Tony

-- 
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] OpenSSL vs. NaCl/libsodium

2017-05-01 Thread Tony Garnock-Jones
On 4/30/17 11:51 PM, James wrote:
> I think we want standard TLS.  I know enough about cryptography to
> know that I really don't want to roll my own.  So I guess OpenSSL is
> what we'll use but then, maybe, something else for local file
> cryptography and signing.  We might even use OpenPGP as a helper
> application.

TLS for data in motion plus PGP for data at rest sounds like a fine
choice. One very big win over NaCl/libsodium based solutions is that you
have a mature story for key and certificate management.

You might consider libressl instead of openssl: "LibreSSL is a version
of the TLS/crypto stack forked from OpenSSL in 2014, with goals of
modernizing the codebase, improving security, and applying best practice
development processes. Primary development occurs inside the OpenBSD
source tree with the usual care the project is known for."

Cheers,
  Tony

-- 
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] OpenSSL vs. NaCl/libsodium

2017-04-28 Thread Tony Garnock-Jones
Hi James,

On 4/28/17 1:13 PM, James wrote:
> https://github.com/mgorlick/CRESTaceans/tree/master/bindings/libsodium
> https://github.com/tonyg/racl/tree/master

I'm the author of racl. I've not used mgorlick's code, but one thing to
bear in mind is that it uses libsodium, where racl uses plain NaCl.
Libsodium is definitely the way to go - plain NaCl is largely vestigial
at this point.

If I were to use racl in production, I would change the implementation
of racl to use libsodium instead of NaCl.

Racl includes a few useful utilities (like SPKI SEXP I/O and some hacky
sketches of encrypted TCP ports based on NaCl primitives), where
mgorlick's code looks to be just the NaCl primitives.

mgorlick's code has contracts; mine does not, which is a shame. I should
add some.

Finally, neither NaCl nor libsodium nor racl provides anything TLS-like.
If you wanted some kind of streaming network code on top of NaCl, you're
firmly in "roll-your-own crypto" territory.

Cheers,
  Tony

-- 
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] Package documentation link issue

2017-04-11 Thread Tony Garnock-Jones
Thanks, Philip -- that could well be a bug in the catalog UI. I can't
check it out until after the OOPSLA deadline, so I've filed
https://github.com/tonyg/racket-pkg-website/issues/42 to keep track of
it until then.

Regards,
  Tony


On 04/11/2017 01:21 PM, Philip McGrath wrote:
> I recently posted a package "recaptcha", and I noticed a problem with
> the documentation link that I'm not sure how to fix. Google stylizes the
> name as reCAPTCHA, and I've capitalized it that way in the title of the
> documentation, but I called the actual package "recaptcha" so that you
> can "raco pkg install recaptcha" and "(require recaptcha)" as Racketeers
> would expect.
> 
> The link from docs.racket-lang.org 
> correctly points to http://docs.racket-lang.org/reCAPTCHA/index.html;
> however, from http://pkgs.racket-lang.org, the link points
> to http://docs.racket-lang.org/recaptcha/index.html, which shows a 404
> error page. Is there something I need to specify in the package metadata
> to make this work correctly? Or is this a problem with the catalog?
> 
> Thanks,
> Philip
> 
> -- 
> 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.

-- 
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.


Capturing Unix signals (was Re: [racket-users] Best way to ensure threads finish in GUI application?)

2017-01-31 Thread Tony Garnock-Jones
Hi Erich,

On 01/31/2017 08:23 AM, Erich Rast wrote:
> Related to that, does application-quit-handler capture signals on
> Linux, and if so, which ones, and/or is there a way to install signal
> handlers in Racket?

There's a package, https://pkgn.racket-lang.org/package/unix-signals,
that includes a small C extension that allows capturing signals.

Here is the documentation for the package:
http://docs.racket-lang.org/unix-signals/index.html

Cheers,
  Tony

-- 
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] Re: inflate/deflate

2017-01-13 Thread Tony Garnock-Jones
On 01/12/2017 11:32 PM, Lehi Toskin wrote:
> `number->bytes`, is a function I made; its definition is
> (define (number->bytes num)
>   (define hex (number->string num 16))
>   ; from file/sha1
>   (hex-string->bytes (if (even? (string-length hex)) hex (string-append "0" 
> hex

You might be able to use Racket's built-in `integer->integer-bytes`
here:
http://docs.racket-lang.org/reference/generic-numbers.html?q=integer%20bytes#%28def._%28%28quote._~23~25kernel%29._integer-~3einteger-bytes%29%29

-- 
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] Re: inflate/deflate

2017-01-13 Thread Tony Garnock-Jones
On 01/12/2017 11:32 PM, Lehi Toskin wrote:
> P.S. I didn't see an implementation of ADLER32 anywhere, so I had to write my 
> own, which took a little longer than expected, but oh well.

Oh, cool. That'd probably be a useful thing for Racket's
net/git-checkout module, which has a piece of code in `zlib-inflate`
that reads:

  ...
  (inflate i o)
  ;; Verify checksum?
  (read-bytes-exactly 'adler-checksum 4 i)
  ...

Perhaps you could contribute your adler32 implementation, and it could
be used there. (And perhaps that `zlib-inflate` function deserves being
pulled out into a separate module. Hmm.)

Cheers,
  Tony

-- 
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] Re: inflate/deflate

2017-01-12 Thread Tony Garnock-Jones
Hi Lehi,

On 01/12/2017 06:17 PM, Lehi Toskin wrote:
> Now that I think about it, it's probably naive of
> me to simple add those two bytes and expect everything to actually be
> working as expected [...] I'm assuming the Z_BUF_ERROR is being
> reported because it's not as flexible and the structure of the data
> is missing some information like length (or something).

See FAQs 18 and 19 here: http://www.gzip.org/zlib/zlib_faq.html#faq18

and see also RFC 1950, that explains why the bytes you need are 0x789c,
and explains the kind of trailer you should probably also have:
https://www.ietf.org/rfc/rfc1950.txt

I wonder if the Z_BUF_ERROR is related to a missing checksum trailer.

(I remember running into this a couple of years ago. I've forgotten the
details, but the gist of it is that the DEFLATE format is the underlying
compression method, and that it can be placed in either a zlib envelope
(RFC 1950) or a gzip envelope (separately specified, probably not what
you want here).)

Tony

-- 
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] handling terminal input per character

2016-10-30 Thread Tony Garnock-Jones
On 10/30/2016 10:54 AM, Ken MacKenzie wrote:
> So what is the best way to read keypress or character by character
> input in racket.  For now dealing with a CLI/terminal interface to
> keep it simple as I work to test and refine my methods.

Try the "ansi" package, https://pkgn.racket-lang.org/package/ansi.

This example shows reading of keys:
https://github.com/tonyg/racket-ansi/blob/master/ansi/test-raw.rkt

Cheers,
  Tony

-- 
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] Putting Racket into the database or, more sanely, storing continuations

2016-10-29 Thread Tony Garnock-Jones
On 10/28/2016 08:21 PM, David Storrs wrote:
> Is it possible to take (e.g.) a procedure object and decompose it back
> into its original source code?

I don't believe this is possible without murky unsafe programming, but...

> One (bad) idea that came to mind was to simply shove some Racket code
> into a TEXT field in the database, then eval it when the time comes.

... this isn't actually so bad. From what you write, I think you're
already seeing the potential pitfalls: what should be in scope of the
code to be eval'd?

> Now, this is horrible for a lot of reasons (security and error
> handling being two of them)

Security will be a problem no matter what, but I don't see that error
handling gives undue difficulty! What am I missing?

> suppose I already had a function that did what I needed and I
> wanted to use that

Instead of storing a list-representing-code-to-eval, you could store

 - the name of a module
 - the name of a function
 - a list of argument values

and use `dynamic-require` in your task runner to find the given function:

  > (dynamic-require 'racket/list 'filter-map)
  #

and then `apply` with the arguments...

Erlang uses essentially this approach in many places where actually
passing a closure around would be problematic (e.g.: code upgrades;
serialization to databases; etc). Erlang terminology is to call the
triple of module name, function name, and arguments an "MFA".

Cheers,
  Tony

-- 
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] opinions on YAML as communication tool

2016-10-21 Thread Tony Garnock-Jones
On 10/21/2016 01:21 AM, 'John Clements' via Racket Users wrote:
> I thought hard about scribble and JSON (and xml, yecch), but I think 
> that YAML and sexps are the two viable candidates, and I’m guessing 
> that if non-programmers have to edit it, they’ll be less likely to 
> botch the YAML one.

If it's a choice between the two then RUN, do not walk, away from YAML
and go for sexps. (XML or JSON would also be OK choices.)

YAML is never the right choice. (In writing this email, I have gone over
it several times toning down my language.)

YAML makes XML look simple, elegant and well-designed. The spec is ~80
pages long. I find it impossible to predict how a YAML processor will
interpret any given input.

You know how Excel guesses whether things are dates or not and messes
things up as a consequence? YAML does that too.

The "spec" vaguely suggests that applications should use regular
expressions to take a guess at what type of information is presented in
a non-explicitly-tagged field. What if there are multiple possible
interpretations? The spec doesn't help you. No, it explicitly disavows
responsibility for such weighty decisions, pointing out that ultimately,
"tag resolution is specific to the application". It's a mess.

There's room for something that does what YAML aims to do, but YAML
isn't it.

Tony

-- 
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] Writing binary data

2016-10-18 Thread Tony Garnock-Jones
On 10/18/2016 12:27 AM, David Storrs wrote:
> On Mon, Oct 17, 2016 at 8:39 PM, Sam Tobin-Hochstadt
> > wrote:
> I think the `integer->integer-bytes` function is probably what you want.
> 
> Thanks Sam, that does the trick. 

You might also find the `bitsyntax` package useful:
https://pkgn.racket-lang.org/package/bitsyntax

Here's a snippet from an ELF image writer:

  (bit-string ((hash-ref strtab-index name) :: little-endian bits 32)
  ((symbol-scope->number scope) :: little-endian bits 4)
  ((symbol-type->number type) :: little-endian bits 4)
  (0 :: little-endian bits 8) ;; st_other, reserved
  ((section->number section) :: little-endian bits 16)
  (value :: little-endian bits 64)
  (size :: little-endian bits 64))

(There's `bit-string-case` for taking binary blobs apart, too.)

Tony

-- 
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] Racket apps on Android

2016-09-30 Thread Tony Garnock-Jones
On 09/30/2016 04:07 PM, Tony Garnock-Jones wrote:
> On 09/30/2016 03:38 PM, Jay McCarthy wrote:
>> This could mean a few things...
>> - "basic" still uses "simulator.rkt" and not "tablet.rkt"
> 
> I haven't checked, but all I did was take the checked-in basic*rkt and
> rename them to app*rkt. I will check now.
> 
> ... Oh ok! Yep, it's "simulator.rkt". That could be it! I'll change it
> to "tablet.rkt" and give it another try!

OK, different error in "adb logcat" now, which is promising. Now I get:

...
E/racket-android( 4183): GL context changed
E/racket-android( 4183): You are using OpenGL
E/racket-android( 4183): (3 0)
E/racket-android( 4183):
E/Adreno-SC( 4183): : GLSL line 1: Error:
#version number unsupported
E/Adreno-SC( 4183): : GLSL line 1: Error:
#version is followed by spurious tokens
E/Adreno-SC( 4183): : GLSL line 1: Error:
#version number unsupported
E/Adreno-SC( 4183): : GLSL line 1: Error:
#version is followed by spurious tokens
E/racket-android( 4183): GL: Skipping glBindFragDataLocation on OpenGL ES
W/Adreno-ES20( 4183): : GL_INVALID_OPERATION
E/racket-android( 4183): OpenGL error in procedure glUseProgram: The
specified operation is not allowed in the current state.
E/racket-android( 4183):

-- 
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] Racket apps on Android

2016-09-30 Thread Tony Garnock-Jones
On 09/29/2016 08:05 PM, Jay McCarthy wrote:
> The build system that Byron Davies and I implemented for deploying
> full-screen OpenGL Android apps is available here:
> 
> https://github.com/jeapostrophe/racket-android

This is great!

I'm trying a build now on debian stretch. I've sent a pull request with
the (small) Makefile changes I've made.

If I use the "basic" example source code, the app builds and installs,
but when I start it, it blanks the screen, does nothing for a few
seconds, and then crashes with the usual unhelpful Android
"Unfortunately, RacketAndroidProject has stopped."

This is on a Sony Xperia Z2 cellphone running CyanogenMod 12.1 (Android
5.1.1). I don't know if it supports the required OpenGL features. I also
have no idea where to begin getting e.g. debug output or starting a
debugger for Android.

When I try "make simulate" from my debian build machine, a window opens,
but I get the following output/exception repeatedly:

You are using OpenGL (4 3)
OpenGL error in procedure glUseProgram: The specified operation is not
allowed in the current state.
  context...:
   /home/tonyg/src/racket/racket/share/pkgs/opengl/opengl/main.rkt:74:7

/home/tonyg/src/racket/racket/share/pkgs/mode-lambda/mode-lambda/backend/gl.rkt:57:0:
make-draw

/home/tonyg/src/racket/racket/share/pkgs/mode-lambda/mode-lambda/backend/gl/util.rkt:308:14:
send-arg83

/home/tonyg/src/racket/racket/share/pkgs/gui-lib/mred/private/mrcanvas.rkt:232:4:
unpack488
   /home/tonyg/src/racket/racket/share/pkgs/lux/chaos/gui.rkt:108:5

/home/tonyg/src/racket/racket/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:454:6

/home/tonyg/src/racket/racket/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:505:32

/home/tonyg/src/racket/racket/collects/racket/private/more-scheme.rkt:148:2:
call-with-break-parameterization

/home/tonyg/src/racket/racket/share/pkgs/gui-lib/mred/private/lock.rkt:43:38
   /home/tonyg/src/racket/racket/collects/ffi/unsafe/atomic.rkt:72:13

/home/tonyg/src/racket/racket/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:454:6

/home/tonyg/src/racket/racket/share/pkgs/gui-lib/mred/private/wx/common/queue.rkt:505:32
   /home/tonyg/src/racket/racket/share/pkgs/lux/word.rkt:132:17
   /home/tonyg/src/racket/racket/share/pkgs/lux/word.rkt:45:0:
call-with-chaos
   (submod /home/tonyg/src/racket-android/rkt/app.rkt main): [running body]


Tony

-- 
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] aws package fails against google cloud storage

2016-09-07 Thread Tony Garnock-Jones
On 09/06/2016 02:40 PM, 'John Clements' via Racket Users wrote:
> Obvious fixes that I don’t like:
> 
> 1) stop using google cloud storage, starting using Amazon S3.
> 2) use the old PLaneT version instead of the shiny new pkg version.
> 
> Any other suggestions? 

3) maybe there's a "google API" for GCS?

If there is, maybe you can extend or use
https://pkgn.racket-lang.org/package/google.

(Perhaps https://cloud.google.com/storage/docs/json_api/ is the relevant
API?)

Tony

-- 
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.


Rendering 2htdp/image to bitmap% (was Re: [racket-users] Re: Error message from GUI)

2016-08-02 Thread Tony Garnock-Jones
On 08/02/2016 04:27 PM, Robby Findler wrote:
> 2htdp/images can be 0xN or Nx0 just fine. If you wish to render them
> to a bitmap, does the file/convertible library not work for you?

For me? No, I needed a bitmap% object rather than a file.

Tony

-- 
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] Re: Error message from GUI

2016-08-02 Thread Tony Garnock-Jones
On 07/29/2016 12:26 PM, George Neuner wrote:
> I don't see any obvious utility in being allowed to create a zero
> sized bitmap.  Likewise a widget or a canvas.

It is useful when writing code that handles images generically. For
example, and this is a real example where the zero-size-bitmap error bit
me the other day, when rendering `2htdp/image`s to `bitmap%`s.

Here's the code I have now:

 (define w (max 1 (image:image-width i)))
 (define h (max 1 (image:image-height i)))

where previously it was

 (define w (image:image-width i))
 (define h (image:image-height i))

I consider the `(max 1 ...)` to have made my code less elegant and more
brittle.

*Negative* dimensions don't make sense. But zero dimensions do. (I feel
like I want to waffle about closure properties...)

> IMO a zero dimension should be an error.  If you don't know how big
> the bitmap should be, don't create it until you do.

In the case I was facing, rendering `2htdp/image`'s `empty-image` to a
`bitmap%`, I knew exactly how big it should be: 0x0. I think supporting
0x0 bitmaps makes good sense and helps avoid brittleness and inelegance.

Tony

-- 
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] Are fixnums guaranteed to be `eq?` whenever they are `=`/`equal?` ?

2016-03-14 Thread Tony Garnock-Jones
Hi all,

Can I rely on the truth of the following:

  (implies (and (fixnum? x) (fixnum? y) (= x y))
   (eq? x y))

?

I know I can rely on something similar for symbols.

What other sorts of values can I rely on eq? being an appropriate
equivalence predicate for?

Tony

-- 
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] do loops

2016-02-15 Thread Tony Garnock-Jones
If your "insert" is idempotent, and you have some means of measuring
tree size, you can eliminate i, c and x:

(define tree4
  (do ([tree null (insert tree (random 10))])
[(>= (tree-size tree) 5) tree]))

I arrived at this by considering doing something similar for sets:

(define tree4
  (do ([tree (set) (set-add tree (random 10))])
[(>= (set-count tree) 5) tree]))



On 2016-02-15 1:58 AM, JJ wrote:
> I try to fill a binary tree with 5 random numbers, avoiding duplicates. Is 
> there a more elegant way than this (using "Iterations and Comprehensions")?
> 
> (define tree4
>   (do ([x (random 10) (random 10)]
>[c #f (contains? tree x)]
>[tree null (if c tree (insert tree x))]
>[i 0 (if c i (add1 i))])
> [(>= i 5) tree]))
> 
> Thanks!
> 

-- 
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] (atanh -2) -> +nan.0

2015-10-07 Thread Tony Garnock-Jones
On 10/07/2015 10:19 AM, Brian Adkins wrote:
> If I instead call: (atanh (number->float-complex -2))  I do get a
> complex result.

I was surprised to see that (atanh (make-rectangular -2 0)) => +nan.0.

-- 
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] fail on http server response not actually a failure?

2015-10-06 Thread Tony Garnock-Jones
On 10/06/2015 03:12 PM, George Neuner wrote:
> My (maybe wrong) understanding is that the response/*  functions only
> package the response data for the  send/*  functions to transmit. 

They construct a `response` struct which includes an `output` procedure
which, given a port, is to write the response body to it.

So one might catch the exceptions in that procedure.

The /xexpr and /full variations have a precomputed blob to send, ready
in advance of the procedure being called, so the closure they build
could swallow TCP exceptions; the more general routines take an `output`
procedure directly.

> However the  send/*  functions terminate the handler thread (possibly
> with a saved continuation), so we're back to "where does the error
> handler need to be?"

I think those functions end up passing the results of the response/*
functions out past the servlet-prompt; the `response-output` procedure
is called as usual to generate the response body.

Tony

-- 
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] fail on http server response not actually a failure?

2015-10-06 Thread Tony Garnock-Jones
On 10/06/2015 12:43 AM, George Neuner wrote:
> I don't know where to put an error handler to deal with reset conditions
> at the end of a request.  Maybe Jay has an idea?

It feels like exceptions are something that response/full,
response/xexpr and similar procedures could deal with, since they have a
"fire and forget" flavour to them.

Raw response objects wouldn't trap the exceptions, and so neither would
response/output.

The rule of thumb I have in mind is: if you're dealing with the response
port at all, catching network exceptions is your responsibility. If the
port is entirely hidden away from you, exception handlers would Do The
Right Thing For You.

Perhaps something like that might help the situation?

Tony

-- 
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] RabbitMQ

2015-09-10 Thread Tony Garnock-Jones
On 09/10/2015 01:21 PM, Jack Firth wrote:
> Has anyone implemented a RabbitMQ client in racket? Is anyone working
> on it and partway there? I'm trying to set up a distributed task
> system like Celery in Python which needs the workers to be in
> Racket.

I recommend implementing STOMP rather than AMQP. I have a Racket STOMP
client: https://github.com/tonyg/racket-stomp

Hmm, apparently I haven't turned it into a package yet. I'll get onto that.

Tony

-- 
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] Comparing (delimited) continuations in Racket

2015-08-14 Thread Tony Garnock-Jones
On 08/14/2015 11:16 AM, Robby Findler wrote:
 The color of a television, tuned to a dead channel.

Bright, pure, sky blue? What an unusual grey.

https://twitter.com/DJSundog/status/629659761902948352

-- 
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] RCP over racket-stomp

2015-08-07 Thread Tony Garnock-Jones
On 08/07/2015 03:19 PM, Jukka Tuominen wrote:
 =ERROR REPORT 7-Aug-2015::22:00:25 ===
 Channel error on connection 0.5764.4 ([client-ip]:59326 -
 [server-ip]:61613, vhost: '/', user: 'device7'), channel 1:
 {amqp_error,access_refused,
 access to queue 'amq.gen--sUYfl-1_IbdAXhs8LwoUA' in vhost '/'
 refused for user 'device7',
 'basic.consume'}

Based on this, I think a productive line of investigation would be to
see if using the permissions-configuration stuff from rabbitmqctl might
help. The server is claiming that user device7 is not permitted to
read from queues with server-generated names.

Since I haven't managed to get even basic STOMP messaging working
myself, I'm not the best person to ask about exactly how to do this, of
course :-) but https://www.rabbitmq.com/access-control.html might get
you started...

Tony

-- 
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] RCP over racket-stomp

2015-08-06 Thread Tony Garnock-Jones
On 08/06/2015 02:03 PM, Jukka Tuominen wrote:
 From a generic STOMP documentation I’ve understood that I should send a
 ”reply-to” header item with a temporary queue value, but I’m not sure
 about the format I should use in racket-stomp. I tried...
 #:headers `((receipt ,receipt)(persistent true)(reply-to
 /temp-queue/foo))
 ... which returned  ”Received ERROR” without further information.

You need to catch the `exn:stomp` exception, which includes the error
frame; untested example code:

  (with-handlers [(exn:stomp? (lambda (e)
 (log-error STOMP error ~v
(exn:stomp-frame e]
...)

Also, it is a good idea to check the logs of whichever broker you are using.

 Also, even though the target computer is able to receive the message, I’m
 not sure how to make it to respond with a value.

Which broker are you using?

Cheers,
  Tony

-- 
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] Tool to assist in reverse-engineering one's own code?

2015-07-13 Thread Tony Garnock-Jones
Hi all,

I'm going through a library I wrote, trying to find all (transitive)
callers of a certain group of functions.

Is there any tool that will help me in this?

I'm thinking of something akin to a hybrid between racket/trace and the
profiler, where you mark the functions (like you do with trace) and then
the system records stack frames of the callers each time the functions
are called, and at the end it gives you a report (e.g. a dot script).

Problematic wrt tail calls, of course, so something a bit clever would
have to be done there.

Does this kind of thing already exist?

Tony

-- 
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] Emacs Lisp as a Racket Language?

2015-07-03 Thread Tony Garnock-Jones
On 07/03/2015 01:11 PM, William G Hatch wrote:
 I would also love to see a new emacs based on Racket.  Is rmacs by Tony
 Garnock-Jones intended to be a small project or is he meaning for it to
 grow to be a serious contender with emacs, vim, etc?

At the moment, it's just for my own edification. My aim is to get it
into suitable shape for me to use it for day to day editing, and then
see how I go.

Currently missing before that becomes the case (using
https://en.wikipedia.org/wiki/MoSCoW_method):
 M - move by words
 M - move by s-expression structure
 S - syntax highlighting for Racket code (half-implemented)
 C - something dired-ish
 C - isearch (ordinary search and regexp-search is already there)

I want to explore it as a way of getting a Racket REPL on steroids. I
imagine firing up Racket, getting a deceptively normal-looking
terminal-style REPL, working for a bit (with rich, full-emacs-style
functionality available at the REPL), and then deciding no, I want a
fullscreen editor, pressing a hotkey, and promoting the REPL into a
full rmacs session with multiple windows, buffers etc.

I want to explore some of the CLIMish presentation ideas for the REPL.

I'm also interested in reloading/hot-swapping of code and state. I've
been experimenting with this for web apps [1] and it'd be interesting to
support it as part of the IDE-like functionality in rmacs.

HOWEVER, I'm a PhD student and all this depends on what little spare
time I find for it.

Shorter me: it's a small hobby project ;-)

Tony

[1] https://github.com/tonyg/racket-reloadable#readme

-- 
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] Gear VR

2015-07-01 Thread Tony Garnock-Jones
On 07/01/2015 01:13 PM, Neil Toronto wrote:
 There's every chance that Typed Racket's union types, singleton symbol
 types, and occurrence typing will make it fairly easy to type an
 s-expression-based wire protocol; e.g.
 
   (define-type Command (List 'command-name arg-types ...)
   (define-type Commands (Pair 'begin (Listof Command)))
   (define-predicate valid-commands? Commands)

This is a really neat feature of TR: it can automatically generate a
validator for a type you give it.

Most other languages require you to write parsers and validators by
hand, or using some tool not connected directly to the type system. In
TR, you get to use read for the parsing part, and the
automatically-generated validators to be sure the results inhabit the
type you need.

I only know of one other typed system that does something similar: Alice
ML [1], where pickled values coming off the wire are checked and dropped
into the required type. (If my recollection is correct.)

Tony

[1] https://www.ps.uni-saarland.de/alice/

-- 
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] System Scheme (RnRS): Shared Secret Generator

2015-06-12 Thread Tony Garnock-Jones
On 06/12/2015 03:15 AM, Michael Titke wrote:
 In my understanding the pseudo random number generator is deterministic.
 That means for the same input seed /random/ will always return the same
 value. This is why one usually has to set a new state for each call of
 random.

If you're generating randomness for cryptographic purposes, e.g.
generation of passwords, you should ABSOLUTELY NOT use Racket's (random).

The built-in random number generator is not a cryptographically strong PRNG.

Instead, simply read the desired number of bits from /dev/urandom. Do
not use (random) at all.

  In the current implementation I get a one byte value from the entropy
 pool via the device /dev/urandom. One byte has 256 possibilities. Now
 that already is true randomness but I have to map it onto a character
 set of 65 possible output characters.

The correct way to choose at random from 65 distinct possibilities using
/dev/urandom is:

 1 read one byte
 2 mask it with #b111, the smallest one-less-than-power-of-two
   larger than the range. (This optimization step is optional.)
 3 if the result is greater than or equal to 65, then loop back to
   step 1.
 4 otherwise, the result will have been drawn uniformly at random from
   the range 0-64 inclusive.

 But to be able to use true randomness with Racket's random

Racket's (random) will *never* produce randomness usable in a
cryptographic application.

Cheers,
  Tony

-- 
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] exn-string

2015-05-26 Thread Tony Garnock-Jones
On 05/25/2015 11:16 AM, Greg Hendershott wrote:
 Should there maybe be a parameter to control whether exn-string
 returns anything interesting? And, should it be #f by default?

That's an interesting idea. I know of examples where Racket error
reports have disclosed sensitive information. Such mistakes can be
extremely subtle and difficult to anticipate, and even skilled,
experienced engineers make them.

Perhaps, if a parameter is a good idea (I'm not sure it is), when it is
#f, exn-string could yield an instructive message such as

  #error redacted to avoid accidental information leak; see
documentation for current-exn-string-enabled?

plus suitable RED FONT DANGER TEXT in the documentation making it clear
to users that they should think about the contexts in which the
resulting strings will be published.

Tony

-- 
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] racket-explorer now deals with cyclic/mutable data

2015-05-22 Thread Tony Garnock-Jones
Hi all,

I've updated racket-explorer (https://github.com/tonyg/racket-explorer)
to handle cyclic (and mutable) data by lazily (and repeatedly) unfolding
children only when the triangle next to an item is opened (and every
time it is opened).

If you've tried it before and been discouraged at its handling of large,
mutable, or infinite structures, please have another go and file bug
reports using GH issues!
(https://github.com/tonyg/racket-explorer/issues/new)

Thanks,
  Tony

-- 
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] racket on openwrt devices

2015-05-03 Thread Tony Garnock-Jones
On 2015-05-02 2:29 PM, Neil Van Dyke wrote:
 What's the current viability of running Racket on a small OpenWRT
 device?  (Anything new, such as due to the recent modularization of the
 core?)

Nothing that I know of since 2011ish. The smaller core might make it a
little easier to assemble a minimal set of collections.

 For example of specs of a popular beefy retail home WiFi router that
 runs OpenWRT well:
 Processor: Atheros AR7161 rev 2 680MHz (MIPS arch)
 RAM: 64MiB
 Flash: 16MiB

Nice. Hmm, that amount of nonvolatile storage will be a challenge.
Racket will run in 64MB RAM on a machine of that class, though not well,
if my intuitions from 2011 still hold.

(Last time I ran Racket on OpenWRT, I was using a Netgear WNDR3700v2.)

Tony

-- 
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] racket on openwrt devices

2015-05-03 Thread Tony Garnock-Jones
On 2015-05-03 2:50 PM, Neil Van Dyke wrote:
 128 RAM and 128 NAND flash, albeit with a different SoC with lower 
 CPU clock rate.  I don't want to rely on USB Storage for this 
 project.

I should mention also that I couldn't do anything useful with Racket 5.x
(as it was at the time) on the WNDR3700v2 without using a swap file on a
USB stick (!). Simply not enough RAM or storage for Racket.

Tony

-- 
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.