[racket-users] Summer picture competition peoples choice

2019-09-05 Thread Stephen De Gabrielle
Hi

It’s time to vote for the

*Summer picture competition community choice*


You don’t have to choose - you can vote for as many favourites as you want!


Vote early, vote often, because voting ends Sunday afternoon uk time.


https://forms.gle/G9r8saiQXqjirkAi8

-- 


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


Re: [racket-users] Pict combiners in list form?

2019-09-05 Thread Robby Findler
Although this is a bit tedious and I write that too much too ... maybe they
should call "flatten" on their arguments or just accept a list of picts?

Robby

On Wed, Sep 4, 2019 at 10:16 PM David Thrane Christiansen <
da...@davidchristiansen.dk> wrote:

> Hi Hendrik,
>
> I use apply for that.  Eg (apply hbl-append (pict-width (t " "))
> my-list-of-picts).
>
> David
>
> On Wed, Sep 4, 2019, 20:06 Hendrik Boom  wrote:
>
>> Is there a way to call the pict combiners (such as ht-append) giving it a
>> list of argument picts instead of a varying number of argument picts?
>>
>> Perhaps another set of append functions, or another way of calling
>> functions
>> in Racket?  I find myself writing list-folowing recursions every time I
>> want
>> this.
>>
>> -- hendrik
>>
>> --
>> 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/20190905030628.rg4uoaac3zro7ztr%40topoi.pooq.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/CAF_itEs8niKiFSvwfoxYs%3D_o-DEa0Etmph_zL_jren0CqzLSFA%40mail.gmail.com
> 
> .
>

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


Re: [racket-users] Summer picture competition peoples choice

2019-09-05 Thread Hendrik Boom
On Thu, Sep 05, 2019 at 11:27:30AM +0100, Stephen De Gabrielle wrote:
> Hi
> 
> It’s time to vote for the
> 
> *Summer picture competition community choice*
> 
> 
> You don’t have to choose - you can vote for as many favourites as you want!

Which has the result that voting for *all* of them has the same effect 
as voting for *none* of them.

It's voting for some but not all that makes a difference.

-- hendrik

> 
> 
> Vote early, vote often, because voting ends Sunday afternoon uk time.
> 
> 
> https://forms.gle/G9r8saiQXqjirkAi8
> 
> -- 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/CAGHj7-J%3Df5GB7PpVqYD5voxrPAkTrOmQz7eWNshTWiUa3R_6Dw%40mail.gmail.com.

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


[off-topic] Re: [racket-users] Summer picture competition peoples choice

2019-09-05 Thread Stephen De Gabrielle
I disagree - they are still votes and I say there have been 27 votes and
the US racketeers are still asleep ;p

S.


On Thu, 5 Sep 2019 at 12:58, Hendrik Boom  wrote:

> On Thu, Sep 05, 2019 at 11:27:30AM +0100, Stephen De Gabrielle wrote:
> > Hi
> >
> > It’s time to vote for the
> >
> > *Summer picture competition community choice*
> >
> >
> > You don’t have to choose - you can vote for as many favourites as you
> want!
>
> Which has the result that voting for *all* of them has the same effect
> as voting for *none* of them.
>
> It's voting for some but not all that makes a difference.
>
> -- hendrik
>
> >
> >
> > Vote early, vote often, because voting ends Sunday afternoon uk time.
> >
> >
> > https://forms.gle/G9r8saiQXqjirkAi8
> >
> > --
> > 
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to racket-users+unsubscr...@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAGHj7-J%3Df5GB7PpVqYD5voxrPAkTrOmQz7eWNshTWiUa3R_6Dw%40mail.gmail.com
> .
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/20190905115812.jp6zpld3ae4utm7n%40topoi.pooq.com
> .
>
-- 


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAGHj7-JT1Lx6NNqDhoM8ckCT9%3D_XwC_KthHEkhse6swm-2pwDQ%40mail.gmail.com.


[racket-users] Re: Summer picture competition peoples choice

2019-09-05 Thread Stephen De Gabrielle
I forgot to mention the prize is a limited edition racketeer cap. As far as
I know racketeer caps are the most popular and desirable swag. ‘Rare as
hens teeth’. Priceless maybe.

S.

On Thu, 5 Sep 2019 at 11:27, Stephen De Gabrielle 
wrote:

> Hi
>
> It’s time to vote for the
>
> *Summer picture competition community choice*
>
>
> You don’t have to choose - you can vote for as many favourites as you want!
>
>
> Vote early, vote often, because voting ends Sunday afternoon uk time.
>
>
> https://forms.gle/G9r8saiQXqjirkAi8
>
> --
> 
>
-- 


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


[racket-users] Listing All Programs

2019-09-05 Thread Adam Golding
What is the shortest/smallest racket program (ithat enumerates all and only 
valid racket programs?

-- 
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/0b83b7d7-ea3e-434a-b6c4-f394a97fe4fd%40googlegroups.com.


[racket-users] Re: Listing All Programs

2019-09-05 Thread Adam Golding
*that

On Thursday, 5 September 2019 09:05:48 UTC-4, Adam Golding wrote:
>
> What is the shortest/smallest racket program (ithat enumerates all and 
> only valid racket programs?
>

-- 
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/74bc5cf0-6948-4341-b687-8d7f1e7b070a%40googlegroups.com.


Re: [racket-users] Listing All Programs

2019-09-05 Thread David Van Horn
What do you mean by valid?

On Thu, Sep 5, 2019, 9:05 AM Adam Golding  wrote:

> What is the shortest/smallest racket program (ithat enumerates all and
> only valid racket programs?
>
> --
> 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/0b83b7d7-ea3e-434a-b6c4-f394a97fe4fd%40googlegroups.com
> 
> .
>

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


Re: [racket-users] Listing All Programs

2019-09-05 Thread Laurent
Probably only those that output Chaitin's constant ;)

But otherwise I would guess "syntactically valid", in which case it would
be easier to consider only lambdas with only one argument.

Though if you want to also use all of Racket's primitives (that is,
including I/O), then good luck. My closest guess would be:
(for/list ([i (in-naturals)])
  (mflatt i))

On Thu, Sep 5, 2019 at 2:31 PM David Van Horn  wrote:

> What do you mean by valid?
>
> On Thu, Sep 5, 2019, 9:05 AM Adam Golding  wrote:
>
>> What is the shortest/smallest racket program (ithat enumerates all and
>> only valid racket programs?
>>
>> --
>> 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/0b83b7d7-ea3e-434a-b6c4-f394a97fe4fd%40googlegroups.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAFJHQkGS_%3DM9G%3DGaLXZgctO6UC_cR9VpqjXt5q211UOeOq2dFw%40mail.gmail.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CABNTSaFts7ZaLTW3%3DzM-OSW%3D-OMiZwTyxvgAWVk0pDaq0yKazg%40mail.gmail.com.


Re: [racket-users] Listing All Programs

2019-09-05 Thread David Van Horn
But whether a program is syntactically valid is not an easy thing to decide
in a language like racket...

On Thu, Sep 5, 2019, 9:45 AM Laurent  wrote:

> Probably only those that output Chaitin's constant ;)
>
> But otherwise I would guess "syntactically valid", in which case it would
> be easier to consider only lambdas with only one argument.
>
> Though if you want to also use all of Racket's primitives (that is,
> including I/O), then good luck. My closest guess would be:
> (for/list ([i (in-naturals)])
>   (mflatt i))
>
> On Thu, Sep 5, 2019 at 2:31 PM David Van Horn  wrote:
>
>> What do you mean by valid?
>>
>> On Thu, Sep 5, 2019, 9:05 AM Adam Golding  wrote:
>>
>>> What is the shortest/smallest racket program (ithat enumerates all and
>>> only valid racket programs?
>>>
>>> --
>>> 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/0b83b7d7-ea3e-434a-b6c4-f394a97fe4fd%40googlegroups.com
>>> 
>>> .
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/CAFJHQkGS_%3DM9G%3DGaLXZgctO6UC_cR9VpqjXt5q211UOeOq2dFw%40mail.gmail.com
>> 
>> .
>>
>

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


Re: [racket-users] Pict combiners in list form?

2019-09-05 Thread Laurent
Or as a simple hack you can redefine `apply' as a one letter binding like
`~'.

On Thu, Sep 5, 2019 at 12:52 PM Robby Findler 
wrote:

> Although this is a bit tedious and I write that too much too ... maybe
> they should call "flatten" on their arguments or just accept a list of
> picts?
>
> Robby
>
> On Wed, Sep 4, 2019 at 10:16 PM David Thrane Christiansen <
> da...@davidchristiansen.dk> wrote:
>
>> Hi Hendrik,
>>
>> I use apply for that.  Eg (apply hbl-append (pict-width (t " "))
>> my-list-of-picts).
>>
>> David
>>
>> On Wed, Sep 4, 2019, 20:06 Hendrik Boom  wrote:
>>
>>> Is there a way to call the pict combiners (such as ht-append) giving it
>>> a
>>> list of argument picts instead of a varying number of argument picts?
>>>
>>> Perhaps another set of append functions, or another way of calling
>>> functions
>>> in Racket?  I find myself writing list-folowing recursions every time I
>>> want
>>> this.
>>>
>>> -- hendrik
>>>
>>> --
>>> 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/20190905030628.rg4uoaac3zro7ztr%40topoi.pooq.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/CAF_itEs8niKiFSvwfoxYs%3D_o-DEa0Etmph_zL_jren0CqzLSFA%40mail.gmail.com
>> 
>> .
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CAL3TdONXAk9r95T-4Byv9pc9%3DRtBy35df-anqQvJOn8B6YO8aA%40mail.gmail.com
> 
> .
>

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


Re: [racket-users] Listing All Programs

2019-09-05 Thread Laurent
Although it's not about checking, but generating, which *may* be easier.
(Though if one can generate all syntactically valid programs in program
size order, then checking is just a matter of checking for membership in
the list of all programs of size less than the program. This list can be
huge however.)

At least it's very simple to generate all 'syntactically' valid Turing
machines ;)

On Thu, Sep 5, 2019 at 2:56 PM David Van Horn  wrote:

> But whether a program is syntactically valid is not an easy thing to
> decide in a language like racket...
>
> On Thu, Sep 5, 2019, 9:45 AM Laurent  wrote:
>
>> Probably only those that output Chaitin's constant ;)
>>
>> But otherwise I would guess "syntactically valid", in which case it would
>> be easier to consider only lambdas with only one argument.
>>
>> Though if you want to also use all of Racket's primitives (that is,
>> including I/O), then good luck. My closest guess would be:
>> (for/list ([i (in-naturals)])
>>   (mflatt i))
>>
>> On Thu, Sep 5, 2019 at 2:31 PM David Van Horn 
>> wrote:
>>
>>> What do you mean by valid?
>>>
>>> On Thu, Sep 5, 2019, 9:05 AM Adam Golding  wrote:
>>>
 What is the shortest/smallest racket program (ithat enumerates all and
 only valid racket programs?

 --
 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/0b83b7d7-ea3e-434a-b6c4-f394a97fe4fd%40googlegroups.com
 
 .

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

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


[racket-users] Re: Listing All Programs

2019-09-05 Thread Jérôme Martin
On Thursday, September 5, 2019 at 3:05:48 PM UTC+2, Adam Golding wrote:
> What is the shortest/smallest racket program (ithat enumerates all and 
only valid racket programs?

Given that "valid" means "a Racket program that compiles correctly".
As the Racket compiler is Turing Complete and can be changed by the 
compiled program itself.
Then there would be no way to know if the compiler will finish executing or 
get stuck into an infinite loop.
Which means it would resume to the 
https://en.wikipedia.org/wiki/Halting_problem

Right?

-- 
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/7da5dd29-d335-4e26-ae91-c12eea5da06c%40googlegroups.com.


Re: [racket-users] Listing All Programs

2019-09-05 Thread Sorawee Porncharoenwase
Oh, this is easy. The grammar of Racket is

#lang  *

which, as I showed above, is expressible as regular expression. Regular
languages are easily decidable :)



On Thu, Sep 5, 2019 at 9:07 PM Laurent  wrote:

> Although it's not about checking, but generating, which *may* be easier.
> (Though if one can generate all syntactically valid programs in program
> size order, then checking is just a matter of checking for membership in
> the list of all programs of size less than the program. This list can be
> huge however.)
>
> At least it's very simple to generate all 'syntactically' valid Turing
> machines ;)
>
> On Thu, Sep 5, 2019 at 2:56 PM David Van Horn  wrote:
>
>> But whether a program is syntactically valid is not an easy thing to
>> decide in a language like racket...
>>
>> On Thu, Sep 5, 2019, 9:45 AM Laurent  wrote:
>>
>>> Probably only those that output Chaitin's constant ;)
>>>
>>> But otherwise I would guess "syntactically valid", in which case it
>>> would be easier to consider only lambdas with only one argument.
>>>
>>> Though if you want to also use all of Racket's primitives (that is,
>>> including I/O), then good luck. My closest guess would be:
>>> (for/list ([i (in-naturals)])
>>>   (mflatt i))
>>>
>>> On Thu, Sep 5, 2019 at 2:31 PM David Van Horn 
>>> wrote:
>>>
 What do you mean by valid?

 On Thu, Sep 5, 2019, 9:05 AM Adam Golding 
 wrote:

> What is the shortest/smallest racket program (ithat enumerates all and
> only valid racket programs?
>
> --
> 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/0b83b7d7-ea3e-434a-b6c4-f394a97fe4fd%40googlegroups.com
> 
> .
>
 --
 You received this message because you are subscribed to the Google
 Groups "Racket Users" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to racket-users+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/racket-users/CAFJHQkGS_%3DM9G%3DGaLXZgctO6UC_cR9VpqjXt5q211UOeOq2dFw%40mail.gmail.com
 
 .

>>> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/CABNTSaGqXagO98Ttx1-rjmqSrdNyHn4m_UUd5_xazF-xiW2O_Q%40mail.gmail.com
> 
> .
>

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


Re: [racket-users] Listing All Programs

2019-09-05 Thread Adam Golding
if it executes?

On Thursday, 5 September 2019 09:56:48 UTC-4, dvanhorn wrote:
>
> But whether a program is syntactically valid is not an easy thing to 
> decide in a language like racket... 
>
> On Thu, Sep 5, 2019, 9:45 AM Laurent > 
> wrote:
>
>> Probably only those that output Chaitin's constant ;)
>>
>> But otherwise I would guess "syntactically valid", in which case it would 
>> be easier to consider only lambdas with only one argument.
>>
>> Though if you want to also use all of Racket's primitives (that is, 
>> including I/O), then good luck. My closest guess would be:
>> (for/list ([i (in-naturals)])
>>   (mflatt i))
>>
>> On Thu, Sep 5, 2019 at 2:31 PM David Van Horn > > wrote:
>>
>>> What do you mean by valid?
>>>
>>> On Thu, Sep 5, 2019, 9:05 AM Adam Golding >> > wrote:
>>>
 What is the shortest/smallest racket program (ithat enumerates all and 
 only valid racket programs?

 -- 
 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...@googlegroups.com .
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/racket-users/0b83b7d7-ea3e-434a-b6c4-f394a97fe4fd%40googlegroups.com
  
 
 .

>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to racket...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/CAFJHQkGS_%3DM9G%3DGaLXZgctO6UC_cR9VpqjXt5q211UOeOq2dFw%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/f8d75da4-5355-4744-a582-77ba4adc8e70%40googlegroups.com.


[racket-users] Re: Listing All Programs

2019-09-05 Thread Adam Golding
It's okay if the program never halts.

-- 
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/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.


Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread David Van Horn
How about this: a stream of strings which can be be parsed and
compiled.  (Note that this will loop when it gets to the first program
that makes the compiler loop; luckily it's inefficient enough that
you'll never actually get there.)

#lang racket
(define valid-progs
  (for/stream ([p strings]
   #:when (valid p))
p))

(define strings
  (stream-cons ""
   (for*/stream ([s strings]
 [i (in-range 0 #x10)]
 #:when (not (<= #xD800 i #xDFFF)))
 (string-append (string (integer->char i)) s

(define (valid x)
  (with-handlers ([exn:fail? (λ _ #f)])
(compile (with-input-from-string x
   (λ () (begin0 (read)
 (unless (eof-object? (read))
   (error "fail"))
x))

On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  wrote:
>
> It's okay if the program never halts.
>
> --
> 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/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAFJHQkH1pM0mE3qSacCD8Cn9T%2B%2BLw%3DJs0XF-oeb-TPD%2BQuhuAA%40mail.gmail.com.


Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread David Van Horn
This program works in 7.3, but not 7.4, which complains about the use
of strings before it's definition.  Swapping the order of valid-progs
and strings fixes that, but the program then loops, although I don't
understand why.

On Thu, Sep 5, 2019 at 11:10 AM David Van Horn  wrote:
>
> How about this: a stream of strings which can be be parsed and
> compiled.  (Note that this will loop when it gets to the first program
> that makes the compiler loop; luckily it's inefficient enough that
> you'll never actually get there.)
>
> #lang racket
> (define valid-progs
>   (for/stream ([p strings]
>#:when (valid p))
> p))
>
> (define strings
>   (stream-cons ""
>(for*/stream ([s strings]
>  [i (in-range 0 #x10)]
>  #:when (not (<= #xD800 i #xDFFF)))
>  (string-append (string (integer->char i)) s
>
> (define (valid x)
>   (with-handlers ([exn:fail? (λ _ #f)])
> (compile (with-input-from-string x
>(λ () (begin0 (read)
>  (unless (eof-object? (read))
>(error "fail"))
> x))
>
> On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  wrote:
> >
> > It's okay if the program never halts.
> >
> > --
> > 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/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.

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


Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Adam Golding
What is the shortest program listing the largest list of programs that can 
be listed without looping?

On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:
>
> How about this: a stream of strings which can be be parsed and 
> compiled.  (Note that this will loop when it gets to the first program 
> that makes the compiler loop; luckily it's inefficient enough that 
> you'll never actually get there.) 
>
> #lang racket 
> (define valid-progs 
>   (for/stream ([p strings] 
>#:when (valid p)) 
> p)) 
>
> (define strings 
>   (stream-cons "" 
>(for*/stream ([s strings] 
>  [i (in-range 0 #x10)] 
>  #:when (not (<= #xD800 i #xDFFF))) 
>  (string-append (string (integer->char i)) s 
>
> (define (valid x) 
>   (with-handlers ([exn:fail? (λ _ #f)]) 
> (compile (with-input-from-string x 
>(λ () (begin0 (read) 
>  (unless (eof-object? (read)) 
>(error "fail")) 
> x)) 
>
> On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  > wrote: 
> > 
> > It's okay if the program never halts. 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.
>  
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com.


Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Sage Gerard
This question can be read a couple of different ways too. What are you trying 
to do once you have the answer you are looking for?

 Original Message 
On Sep 5, 2019, 1:13 PM, Adam Golding wrote:

> What is the shortest program listing the largest list of programs that can be 
> listed without looping?
>
> On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:
>
>> How about this: a stream of strings which can be be parsed and
>> compiled.  (Note that this will loop when it gets to the first program
>> that makes the compiler loop; luckily it's inefficient enough that
>> you'll never actually get there.)
>>
>> #lang racket
>> (define valid-progs
>>   (for/stream ([p strings]
>>#:when (valid p))
>> p))
>>
>> (define strings
>>   (stream-cons ""
>>(for*/stream ([s strings]
>>  [i (in-range 0 #x10)]
>>  #:when (not (<= #xD800 i #xDFFF)))
>>  (string-append (string (integer->char i)) s
>>
>> (define (valid x)
>>   (with-handlers ([exn:fail? (λ _ #f)])
>> (compile (with-input-from-string x
>>(λ () (begin0 (read)
>>  (unless (eof-object? (read))
>>(error "fail"))
>> x))
>>
>> On Thu, Sep 5, 2019 at 10:58 AM Adam Golding 
>> <[adamg...@gmail.com](javascript:)> wrote:
>>>
>>> It's okay if the program never halts.
>>>
>>> --
>>> 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...@googlegroups.com](javascript:).
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> [https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com?utm_medium=email&utm_source=footer).

-- 
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/ii7sMy_fxElYY2CIt16vQ6Zy1JLL5EJLRtKveAkTNHfR4rhN9VjpcSC0A8gzfiFRd5BDr_GQRehZAR7JBcAP3W7GXu2MS_Bd8mRWeMNbE-M%3D%40sagegerard.com.


Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Adam Golding
I want to try automating programming as search where I have various methods 
to enumerate the set of all programs in different orders (fastest to halt 
first?  shortest source code first? etc.) and filter out certain programs 
almost like evolutionary programming.  I don't have a specific application 
in mind really, I wanted to have various enumerators to experiment with, 
not unlike the opening of "New Kind of Science", where Wolfram generates 
all possible CA programs and then categorizes them according to their 
behavior.

The idea also came up recently in this context: 
https://www.facebook.com/adamgolding/posts/10106973704058242

On Thursday, 5 September 2019 13:17:32 UTC-4, Sage Gerard wrote:
>
> This question can be read a couple of different ways too. What are you 
> trying to do once you have the answer you are looking for? 
>
>
>
>  Original Message 
> On Sep 5, 2019, 1:13 PM, Adam Golding < adamg...@gmail.com > 
> wrote:
>
>
> What is the shortest program listing the largest list of programs that can 
> be listed without looping?
>
> On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:
>>
>> How about this: a stream of strings which can be be parsed and 
>> compiled.  (Note that this will loop when it gets to the first program 
>> that makes the compiler loop; luckily it's inefficient enough that 
>> you'll never actually get there.) 
>>
>> #lang racket 
>> (define valid-progs 
>>   (for/stream ([p strings] 
>>#:when (valid p)) 
>> p)) 
>>
>> (define strings 
>>   (stream-cons "" 
>>(for*/stream ([s strings] 
>>  [i (in-range 0 #x10)] 
>>  #:when (not (<= #xD800 i #xDFFF))) 
>>  (string-append (string (integer->char i)) s 
>>
>> (define (valid x) 
>>   (with-handlers ([exn:fail? (λ _ #f)]) 
>> (compile (with-input-from-string x 
>>(λ () (begin0 (read) 
>>  (unless (eof-object? (read)) 
>>(error "fail")) 
>> x)) 
>>
>> On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  wrote: 
>> > 
>> > It's okay if the program never halts. 
>> > 
>> > -- 
>> > 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...@googlegroups.com. 
>> > To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.
>>  
>>
>>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com
>  
> 
> .
>
>

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


Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Adam Golding
Basically I want to enumerate programs with as few assumptions as possible 
aka enumerate the largest set of programs I can--I want to be able to 
enumerate them in a variety of different orders to compare search 
strategies.

On Thursday, 5 September 2019 13:46:54 UTC-4, Adam Golding wrote:
>
> I want to try automating programming as search where I have various 
> methods to enumerate the set of all programs in different orders (fastest 
> to halt first?  shortest source code first? etc.) and filter out certain 
> programs almost like evolutionary programming.  I don't have a specific 
> application in mind really, I wanted to have various enumerators to 
> experiment with, not unlike the opening of "New Kind of Science", where 
> Wolfram generates all possible CA programs and then categorizes them 
> according to their behavior.
>
> The idea also came up recently in this context: 
> https://www.facebook.com/adamgolding/posts/10106973704058242
>
> On Thursday, 5 September 2019 13:17:32 UTC-4, Sage Gerard wrote:
>>
>> This question can be read a couple of different ways too. What are you 
>> trying to do once you have the answer you are looking for? 
>>
>>
>>
>>  Original Message 
>> On Sep 5, 2019, 1:13 PM, Adam Golding < adamg...@gmail.com> wrote:
>>
>>
>> What is the shortest program listing the largest list of programs that 
>> can be listed without looping?
>>
>> On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:
>>>
>>> How about this: a stream of strings which can be be parsed and 
>>> compiled.  (Note that this will loop when it gets to the first program 
>>> that makes the compiler loop; luckily it's inefficient enough that 
>>> you'll never actually get there.) 
>>>
>>> #lang racket 
>>> (define valid-progs 
>>>   (for/stream ([p strings] 
>>>#:when (valid p)) 
>>> p)) 
>>>
>>> (define strings 
>>>   (stream-cons "" 
>>>(for*/stream ([s strings] 
>>>  [i (in-range 0 #x10)] 
>>>  #:when (not (<= #xD800 i #xDFFF))) 
>>>  (string-append (string (integer->char i)) s 
>>>
>>> (define (valid x) 
>>>   (with-handlers ([exn:fail? (λ _ #f)]) 
>>> (compile (with-input-from-string x 
>>>(λ () (begin0 (read) 
>>>  (unless (eof-object? (read)) 
>>>(error "fail")) 
>>> x)) 
>>>
>>> On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  
>>> wrote: 
>>> > 
>>> > It's okay if the program never halts. 
>>> > 
>>> > -- 
>>> > 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...@googlegroups.com. 
>>> > To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.
>>>  
>>>
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com
>>  
>> 
>> .
>>
>>

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


Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Adam Golding
The relevant part of the fb thread is where I remark "Suppose every voter 
is a program--then we can randomly sample programs and voting methods on 
objective questions and see which methods the epistemic argument for 
democracy is likely to be correct for" -- the word 'randomly' can probably 
be removed--there are different orders you can sample programs in, I would 
like a variety of them.

On Thursday, 5 September 2019 13:46:54 UTC-4, Adam Golding wrote:
>
> I want to try automating programming as search where I have various 
> methods to enumerate the set of all programs in different orders (fastest 
> to halt first?  shortest source code first? etc.) and filter out certain 
> programs almost like evolutionary programming.  I don't have a specific 
> application in mind really, I wanted to have various enumerators to 
> experiment with, not unlike the opening of "New Kind of Science", where 
> Wolfram generates all possible CA programs and then categorizes them 
> according to their behavior.
>
> The idea also came up recently in this context: 
> https://www.facebook.com/adamgolding/posts/10106973704058242
>
> On Thursday, 5 September 2019 13:17:32 UTC-4, Sage Gerard wrote:
>>
>> This question can be read a couple of different ways too. What are you 
>> trying to do once you have the answer you are looking for? 
>>
>>
>>
>>  Original Message 
>> On Sep 5, 2019, 1:13 PM, Adam Golding < adamg...@gmail.com> wrote:
>>
>>
>> What is the shortest program listing the largest list of programs that 
>> can be listed without looping?
>>
>> On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:
>>>
>>> How about this: a stream of strings which can be be parsed and 
>>> compiled.  (Note that this will loop when it gets to the first program 
>>> that makes the compiler loop; luckily it's inefficient enough that 
>>> you'll never actually get there.) 
>>>
>>> #lang racket 
>>> (define valid-progs 
>>>   (for/stream ([p strings] 
>>>#:when (valid p)) 
>>> p)) 
>>>
>>> (define strings 
>>>   (stream-cons "" 
>>>(for*/stream ([s strings] 
>>>  [i (in-range 0 #x10)] 
>>>  #:when (not (<= #xD800 i #xDFFF))) 
>>>  (string-append (string (integer->char i)) s 
>>>
>>> (define (valid x) 
>>>   (with-handlers ([exn:fail? (λ _ #f)]) 
>>> (compile (with-input-from-string x 
>>>(λ () (begin0 (read) 
>>>  (unless (eof-object? (read)) 
>>>(error "fail")) 
>>> x)) 
>>>
>>> On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  
>>> wrote: 
>>> > 
>>> > It's okay if the program never halts. 
>>> > 
>>> > -- 
>>> > 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...@googlegroups.com. 
>>> > To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.
>>>  
>>>
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com
>>  
>> 
>> .
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/20ae2b58-0e33-4d9c-b6b8-8ab6d87b944c%40googlegroups.com.


Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Sage Gerard
Thanks, that helps.

In the way I read this, it sounds like you want a program that computes the 
most efficient search algorithm regardless of the context in which said 
algorithm is used.

Is that accurate?

~slg

‐‐‐ Original Message ‐‐‐
On Thursday, September 5, 2019 1:48 PM, Adam Golding  
wrote:

> Basically I want to enumerate programs with as few assumptions as possible 
> aka enumerate the largest set of programs I can--I want to be able to 
> enumerate them in a variety of different orders to compare search strategies.
>
> On Thursday, 5 September 2019 13:46:54 UTC-4, Adam Golding wrote:
>
>> I want to try automating programming as search where I have various methods 
>> to enumerate the set of all programs in different orders (fastest to halt 
>> first?  shortest source code first? etc.) and filter out certain programs 
>> almost like evolutionary programming.  I don't have a specific application 
>> in mind really, I wanted to have various enumerators to experiment with, not 
>> unlike the opening of "New Kind of Science", where Wolfram generates all 
>> possible CA programs and then categorizes them according to their behavior.
>>
>> The idea also came up recently in this context: 
>> https://www.facebook.com/adamgolding/posts/10106973704058242
>>
>> On Thursday, 5 September 2019 13:17:32 UTC-4, Sage Gerard wrote:
>>
>>> This question can be read a couple of different ways too. What are you 
>>> trying to do once you have the answer you are looking for?
>>>
>>>  Original Message 
>>> On Sep 5, 2019, 1:13 PM, Adam Golding < adamg...@gmail.com> wrote:
>>>
 What is the shortest program listing the largest list of programs that can 
 be listed without looping?

 On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:

> How about this: a stream of strings which can be be parsed and
> compiled.  (Note that this will loop when it gets to the first program
> that makes the compiler loop; luckily it's inefficient enough that
> you'll never actually get there.)
>
> #lang racket
> (define valid-progs
>   (for/stream ([p strings]
>#:when (valid p))
> p))
>
> (define strings
>   (stream-cons ""
>(for*/stream ([s strings]
>  [i (in-range 0 #x10)]
>  #:when (not (<= #xD800 i #xDFFF)))
>  (string-append (string (integer->char i)) s
>
> (define (valid x)
>   (with-handlers ([exn:fail? (λ _ #f)])
> (compile (with-input-from-string x
>(λ () (begin0 (read)
>  (unless (eof-object? (read))
>(error "fail"))
> x))
>
> On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  wrote:
>>
>> It's okay if the program never halts.
>>
>> --
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.

 --
 You received this message because you are subscribed to the Google Groups 
 "Racket Users" group.
 To unsubscribe from this group and stop receiving emails from it, send an 
 email to racket...@googlegroups.com.
 To view this discussion on the web visit 
 [https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com?utm_medium=email&utm_source=footer).
>
> --
> 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/a0ee9cdb-c46d-4f3a-a9c3-4a9c700cec71%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/a0ee9cdb-c46d-4f3a-a9c3-4a9c700cec71%40googlegroups.com?utm_medium=email&utm_source=footer).

-- 
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/GQkLv3Jr-HmHQc3o0Psl1mS7eDEuxSgaFJsV06mTk-Drum9H9ddmDIgSqUEqzUGC-brt20RCfNGOdw0uwW0wIqWF_wcQYUv21vnjMtxxChA%3D%40sagegerard.com.


Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Adam Golding
At this point I don't need the search (through the space of all programs) 
to be efficient I just need it to be 'total' in that every program would be 
reached given a countable infinity of time.  Then I could alter this search 
to search the same space in a different order (still total) and compare 
empirically which is 'more efficient' (depends what programs you're 
searching for).  For example, enumerating possible racket programs from 
shortest to longest source would be one order, and enumerating them from 
shortest to longest runtime would be another...

On Thursday, 5 September 2019 13:53:29 UTC-4, Sage Gerard wrote:
>
> Thanks, that helps.
>
> In the way I read this, it sounds like you want a program that computes 
> the most efficient search algorithm regardless of the context in which said 
> algorithm is used.
>
> Is that accurate?
>
> *~slg*
>
>
> ‐‐‐ Original Message ‐‐‐
> On Thursday, September 5, 2019 1:48 PM, Adam Golding  > wrote:
>
> Basically I want to enumerate programs with as few assumptions as possible 
> aka enumerate the largest set of programs I can--I want to be able to 
> enumerate them in a variety of different orders to compare search 
> strategies.
>
> On Thursday, 5 September 2019 13:46:54 UTC-4, Adam Golding wrote:
>
>> I want to try automating programming as search where I have various 
>> methods to enumerate the set of all programs in different orders (fastest 
>> to halt first?  shortest source code first? etc.) and filter out certain 
>> programs almost like evolutionary programming.  I don't have a specific 
>> application in mind really, I wanted to have various enumerators to 
>> experiment with, not unlike the opening of "New Kind of Science", where 
>> Wolfram generates all possible CA programs and then categorizes them 
>> according to their behavior.
>>
>> The idea also came up recently in this context: 
>> https://www.facebook.com/adamgolding/posts/10106973704058242
>>
>> On Thursday, 5 September 2019 13:17:32 UTC-4, Sage Gerard wrote:
>>
>>> This question can be read a couple of different ways too. What are you 
>>> trying to do once you have the answer you are looking for? 
>>>
>>>
>>>
>>>  Original Message 
>>> On Sep 5, 2019, 1:13 PM, Adam Golding < adamg...@gmail.com> wrote:
>>>
>>>
>>> What is the shortest program listing the largest list of programs that 
>>> can be listed without looping?
>>>
>>> On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:
>>>
 How about this: a stream of strings which can be be parsed and 
 compiled.  (Note that this will loop when it gets to the first program 
 that makes the compiler loop; luckily it's inefficient enough that 
 you'll never actually get there.) 

 #lang racket 
 (define valid-progs 
   (for/stream ([p strings] 
#:when (valid p)) 
 p)) 

 (define strings 
   (stream-cons "" 
(for*/stream ([s strings] 
  [i (in-range 0 #x10)] 
  #:when (not (<= #xD800 i #xDFFF))) 
  (string-append (string (integer->char i)) s 

 (define (valid x) 
   (with-handlers ([exn:fail? (λ _ #f)]) 
 (compile (with-input-from-string x 
(λ () (begin0 (read) 
  (unless (eof-object? (read)) 
(error "fail")) 
 x)) 

 On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  
 wrote: 
 > 
 > It's okay if the program never halts. 
 > 
 > -- 
 > 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...@googlegroups.com. 
 > To view this discussion on the web visit 
 https://groups.google.com/d/msgid/racket-users/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.
  


>>>
>>> --
>>> You received this message because you are subscribed to the Google 
>>> Groups "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to racket...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket...@googlegroups.com .
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/a0ee9cdb-c46d-4f3a-a9c3-4a9c700cec71%40googlegroups.com
>  
> 

Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Sage Gerard
It almost sounds like you want a cleaner interface for defining a neural net.

~slg

‐‐‐ Original Message ‐‐‐
On Thursday, September 5, 2019 2:07 PM, Adam Golding  
wrote:

> At this point I don't need the search (through the space of all programs) to 
> be efficient I just need it to be 'total' in that every program would be 
> reached given a countable infinity of time.  Then I could alter this search 
> to search the same space in a different order (still total) and compare 
> empirically which is 'more efficient' (depends what programs you're searching 
> for).  For example, enumerating possible racket programs from shortest to 
> longest source would be one order, and enumerating them from shortest to 
> longest runtime would be another...
>
> On Thursday, 5 September 2019 13:53:29 UTC-4, Sage Gerard wrote:
>
>> Thanks, that helps.
>>
>> In the way I read this, it sounds like you want a program that computes the 
>> most efficient search algorithm regardless of the context in which said 
>> algorithm is used.
>>
>> Is that accurate?
>>
>> ~slg
>>
>> ‐‐‐ Original Message ‐‐‐
>> On Thursday, September 5, 2019 1:48 PM, Adam Golding  
>> wrote:
>>
>>> Basically I want to enumerate programs with as few assumptions as possible 
>>> aka enumerate the largest set of programs I can--I want to be able to 
>>> enumerate them in a variety of different orders to compare search 
>>> strategies.
>>>
>>> On Thursday, 5 September 2019 13:46:54 UTC-4, Adam Golding wrote:
>>>
 I want to try automating programming as search where I have various 
 methods to enumerate the set of all programs in different orders (fastest 
 to halt first?  shortest source code first? etc.) and filter out certain 
 programs almost like evolutionary programming.  I don't have a specific 
 application in mind really, I wanted to have various enumerators to 
 experiment with, not unlike the opening of "New Kind of Science", where 
 Wolfram generates all possible CA programs and then categorizes them 
 according to their behavior.

 The idea also came up recently in this context: 
 https://www.facebook.com/adamgolding/posts/10106973704058242

 On Thursday, 5 September 2019 13:17:32 UTC-4, Sage Gerard wrote:

> This question can be read a couple of different ways too. What are you 
> trying to do once you have the answer you are looking for?
>
>  Original Message 
> On Sep 5, 2019, 1:13 PM, Adam Golding < adamg...@gmail.com> wrote:
>
>> What is the shortest program listing the largest list of programs that 
>> can be listed without looping?
>>
>> On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:
>>
>>> How about this: a stream of strings which can be be parsed and
>>> compiled.  (Note that this will loop when it gets to the first program
>>> that makes the compiler loop; luckily it's inefficient enough that
>>> you'll never actually get there.)
>>>
>>> #lang racket
>>> (define valid-progs
>>>   (for/stream ([p strings]
>>>#:when (valid p))
>>> p))
>>>
>>> (define strings
>>>   (stream-cons ""
>>>(for*/stream ([s strings]
>>>  [i (in-range 0 #x10)]
>>>  #:when (not (<= #xD800 i #xDFFF)))
>>>  (string-append (string (integer->char i)) s
>>>
>>> (define (valid x)
>>>   (with-handlers ([exn:fail? (λ _ #f)])
>>> (compile (with-input-from-string x
>>>(λ () (begin0 (read)
>>>  (unless (eof-object? (read))
>>>(error "fail"))
>>> x))
>>>
>>> On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  wrote:

 It's okay if the program never halts.

 --
 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...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/racket-users/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.
>>
>> --
>> You received this message because you are subscribed to the Google 
>> Groups "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send 
>> an email to racket...@googlegroups.com.
>> To view this discussion on the web visit 
>> [https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com](https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com?utm_medium=email&utm_source=footer).
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "

Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Sage Gerard
In all honesty, I think you are asking for something so broad that it would be 
more practical if you ran experiments and simulations against the specific 
space you are curious about. Once you do that enough times you'll be able to 
pick out the patterns. I'm not convinced there is an off-shelf design for what 
you want without a patent attached to it.

~slg

‐‐‐ Original Message ‐‐‐
On Thursday, September 5, 2019 2:09 PM, Sage Gerard  wrote:

> It almost sounds like you want a cleaner interface for defining a neural net.
>
> ~slg
>
> ‐‐‐ Original Message ‐‐‐
> On Thursday, September 5, 2019 2:07 PM, Adam Golding  
> wrote:
>
>> At this point I don't need the search (through the space of all programs) to 
>> be efficient I just need it to be 'total' in that every program would be 
>> reached given a countable infinity of time.  Then I could alter this search 
>> to search the same space in a different order (still total) and compare 
>> empirically which is 'more efficient' (depends what programs you're 
>> searching for).  For example, enumerating possible racket programs from 
>> shortest to longest source would be one order, and enumerating them from 
>> shortest to longest runtime would be another...
>>
>> On Thursday, 5 September 2019 13:53:29 UTC-4, Sage Gerard wrote:
>>
>>> Thanks, that helps.
>>>
>>> In the way I read this, it sounds like you want a program that computes the 
>>> most efficient search algorithm regardless of the context in which said 
>>> algorithm is used.
>>>
>>> Is that accurate?
>>>
>>> ~slg
>>>
>>> ‐‐‐ Original Message ‐‐‐
>>> On Thursday, September 5, 2019 1:48 PM, Adam Golding  
>>> wrote:
>>>
 Basically I want to enumerate programs with as few assumptions as possible 
 aka enumerate the largest set of programs I can--I want to be able to 
 enumerate them in a variety of different orders to compare search 
 strategies.

 On Thursday, 5 September 2019 13:46:54 UTC-4, Adam Golding wrote:

> I want to try automating programming as search where I have various 
> methods to enumerate the set of all programs in different orders (fastest 
> to halt first?  shortest source code first? etc.) and filter out certain 
> programs almost like evolutionary programming.  I don't have a specific 
> application in mind really, I wanted to have various enumerators to 
> experiment with, not unlike the opening of "New Kind of Science", where 
> Wolfram generates all possible CA programs and then categorizes them 
> according to their behavior.
>
> The idea also came up recently in this context: 
> https://www.facebook.com/adamgolding/posts/10106973704058242
>
> On Thursday, 5 September 2019 13:17:32 UTC-4, Sage Gerard wrote:
>
>> This question can be read a couple of different ways too. What are you 
>> trying to do once you have the answer you are looking for?
>>
>>  Original Message 
>> On Sep 5, 2019, 1:13 PM, Adam Golding < adamg...@gmail.com> wrote:
>>
>>> What is the shortest program listing the largest list of programs that 
>>> can be listed without looping?
>>>
>>> On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:
>>>
 How about this: a stream of strings which can be be parsed and
 compiled.  (Note that this will loop when it gets to the first program
 that makes the compiler loop; luckily it's inefficient enough that
 you'll never actually get there.)

 #lang racket
 (define valid-progs
   (for/stream ([p strings]
#:when (valid p))
 p))

 (define strings
   (stream-cons ""
(for*/stream ([s strings]
  [i (in-range 0 #x10)]
  #:when (not (<= #xD800 i #xDFFF)))
  (string-append (string (integer->char i)) s

 (define (valid x)
   (with-handlers ([exn:fail? (λ _ #f)])
 (compile (with-input-from-string x
(λ () (begin0 (read)
  (unless (eof-object? (read))
(error "fail"))
 x))

 On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  
 wrote:
>
> It's okay if the program never halts.
>
> --
> 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...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.
>>>
>>> --
>>> You received this message because you are subscri

Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Laurent
Adam,

I strongly recommend you take a look at Levin Search (aka Universal
Search), which enumerates and runs programs by dovetailing in a smart way:
http://people.idsia.ch/~juergen/mljssalevin/node4.html
http://www.scholarpedia.org/article/Universal_search#Universal_search

This avoids the halting problem including the running time in the
complexity: If a program q solves the problem in time Tq, then Levin Search
solves the problem in time Tq / wq, where wq = 2^-l(q) with l(q) being the
size in bits of program q. In other words, Levin Search solves all search
problems at least as fast as the fastest program within a constant factor
that depends on the inverse of the prior of the program.

IMO, Levin Search is one of the most important algorithms ever.


On Thu, Sep 5, 2019 at 7:13 PM Sage Gerard  wrote:

> In all honesty, I think you are asking for something so broad that it
> would be more practical if you ran experiments and simulations against the
> specific space you are curious about. Once you do that enough times you'll
> be able to pick out the patterns. I'm not convinced there is an off-shelf
> design for what you want without a patent attached to it.
>
> *~slg*
>
>
> ‐‐‐ Original Message ‐‐‐
> On Thursday, September 5, 2019 2:09 PM, Sage Gerard 
> wrote:
>
> It almost sounds like you want a cleaner interface for defining a neural
> net.
>
> *~slg*
>
>
> ‐‐‐ Original Message ‐‐‐
> On Thursday, September 5, 2019 2:07 PM, Adam Golding <
> adamgold...@gmail.com> wrote:
>
> At this point I don't need the search (through the space of all programs)
> to be efficient I just need it to be 'total' in that every program would be
> reached given a countable infinity of time.  Then I could alter this search
> to search the same space in a different order (still total) and compare
> empirically which is 'more efficient' (depends what programs you're
> searching for).  For example, enumerating possible racket programs from
> shortest to longest source would be one order, and enumerating them from
> shortest to longest runtime would be another...
>
> On Thursday, 5 September 2019 13:53:29 UTC-4, Sage Gerard wrote:
>
>> Thanks, that helps.
>>
>> In the way I read this, it sounds like you want a program that computes
>> the most efficient search algorithm regardless of the context in which said
>> algorithm is used.
>>
>> Is that accurate?
>>
>> *~slg*
>>
>>
>> ‐‐‐ Original Message ‐‐‐
>> On Thursday, September 5, 2019 1:48 PM, Adam Golding 
>> wrote:
>>
>> Basically I want to enumerate programs with as few assumptions as
>> possible aka enumerate the largest set of programs I can--I want to be able
>> to enumerate them in a variety of different orders to compare search
>> strategies.
>>
>> On Thursday, 5 September 2019 13:46:54 UTC-4, Adam Golding wrote:
>>
>>> I want to try automating programming as search where I have various
>>> methods to enumerate the set of all programs in different orders (fastest
>>> to halt first?  shortest source code first? etc.) and filter out certain
>>> programs almost like evolutionary programming.  I don't have a specific
>>> application in mind really, I wanted to have various enumerators to
>>> experiment with, not unlike the opening of "New Kind of Science", where
>>> Wolfram generates all possible CA programs and then categorizes them
>>> according to their behavior.
>>>
>>> The idea also came up recently in this context:
>>> https://www.facebook.com/adamgolding/posts/10106973704058242
>>>
>>> On Thursday, 5 September 2019 13:17:32 UTC-4, Sage Gerard wrote:
>>>
 This question can be read a couple of different ways too. What are you
 trying to do once you have the answer you are looking for?



  Original Message 
 On Sep 5, 2019, 1:13 PM, Adam Golding < adamg...@gmail.com> wrote:


 What is the shortest program listing the largest list of programs that
 can be listed without looping?

 On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:

> How about this: a stream of strings which can be be parsed and
> compiled.  (Note that this will loop when it gets to the first program
> that makes the compiler loop; luckily it's inefficient enough that
> you'll never actually get there.)
>
> #lang racket
> (define valid-progs
>   (for/stream ([p strings]
>#:when (valid p))
> p))
>
> (define strings
>   (stream-cons ""
>(for*/stream ([s strings]
>  [i (in-range 0 #x10)]
>  #:when (not (<= #xD800 i #xDFFF)))
>  (string-append (string (integer->char i)) s
>
> (define (valid x)
>   (with-handlers ([exn:fail? (λ _ #f)])
> (compile (with-input-from-string x
>(λ () (begin0 (read)
>  (unless (eof-object? (read))
>

Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Sage Gerard
It's as they say: if you want an answer on the internet, just say the wrong 
thing and wait for someone to correct you. :)

 Original Message 
On Sep 5, 2019, 3:45 PM, Laurent wrote:

> Adam,
>
> I strongly recommend you take a look at Levin Search (aka Universal Search), 
> which enumerates and runs programs by dovetailing in a smart way:
> http://people.idsia.ch/~juergen/mljssalevin/node4.html
> http://www.scholarpedia.org/article/Universal_search#Universal_search
>
> This avoids the halting problem including the running time in the complexity: 
> If a program q solves the problem in time Tq, then Levin Search solves the 
> problem in time Tq / wq, where wq = 2^-l(q) with l(q) being the size in bits 
> of program q. In other words, Levin Search solves all search problems at 
> least as fast as the fastest program within a constant factor that depends on 
> the inverse of the prior of the program.
>
> IMO, Levin Search is one of the most important algorithms ever.
>
> On Thu, Sep 5, 2019 at 7:13 PM Sage Gerard  wrote:
>
>> In all honesty, I think you are asking for something so broad that it would 
>> be more practical if you ran experiments and simulations against the 
>> specific space you are curious about. Once you do that enough times you'll 
>> be able to pick out the patterns. I'm not convinced there is an off-shelf 
>> design for what you want without a patent attached to it.
>>
>> ~slg
>>
>> ‐‐‐ Original Message ‐‐‐
>> On Thursday, September 5, 2019 2:09 PM, Sage Gerard  
>> wrote:
>>
>>> It almost sounds like you want a cleaner interface for defining a neural 
>>> net.
>>>
>>> ~slg
>>>
>>> ‐‐‐ Original Message ‐‐‐
>>> On Thursday, September 5, 2019 2:07 PM, Adam Golding 
>>>  wrote:
>>>
 At this point I don't need the search (through the space of all programs) 
 to be efficient I just need it to be 'total' in that every program would 
 be reached given a countable infinity of time.  Then I could alter this 
 search to search the same space in a different order (still total) and 
 compare empirically which is 'more efficient' (depends what programs 
 you're searching for).  For example, enumerating possible racket programs 
 from shortest to longest source would be one order, and enumerating them 
 from shortest to longest runtime would be another...

 On Thursday, 5 September 2019 13:53:29 UTC-4, Sage Gerard wrote:

> Thanks, that helps.
>
> In the way I read this, it sounds like you want a program that computes 
> the most efficient search algorithm regardless of the context in which 
> said algorithm is used.
>
> Is that accurate?
>
> ~slg
>
> ‐‐‐ Original Message ‐‐‐
> On Thursday, September 5, 2019 1:48 PM, Adam Golding  
> wrote:
>
>> Basically I want to enumerate programs with as few assumptions as 
>> possible aka enumerate the largest set of programs I can--I want to be 
>> able to enumerate them in a variety of different orders to compare 
>> search strategies.
>>
>> On Thursday, 5 September 2019 13:46:54 UTC-4, Adam Golding wrote:
>>
>>> I want to try automating programming as search where I have various 
>>> methods to enumerate the set of all programs in different orders 
>>> (fastest to halt first?  shortest source code first? etc.) and filter 
>>> out certain programs almost like evolutionary programming.  I don't 
>>> have a specific application in mind really, I wanted to have various 
>>> enumerators to experiment with, not unlike the opening of "New Kind of 
>>> Science", where Wolfram generates all possible CA programs and then 
>>> categorizes them according to their behavior.
>>>
>>> The idea also came up recently in this context: 
>>> https://www.facebook.com/adamgolding/posts/10106973704058242
>>>
>>> On Thursday, 5 September 2019 13:17:32 UTC-4, Sage Gerard wrote:
>>>
 This question can be read a couple of different ways too. What are you 
 trying to do once you have the answer you are looking for?

  Original Message 
 On Sep 5, 2019, 1:13 PM, Adam Golding < adamg...@gmail.com> wrote:

> What is the shortest program listing the largest list of programs 
> that can be listed without looping?
>
> On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:
>
>> How about this: a stream of strings which can be be parsed and
>> compiled.  (Note that this will loop when it gets to the first 
>> program
>> that makes the compiler loop; luckily it's inefficient enough that
>> you'll never actually get there.)
>>
>> #lang racket
>> (define valid-progs
>>   (for/stream ([p strings]
>>#:when (valid p))
>> p))
>>
>> (define strings
>

Re: [racket-users] Listing All Programs

2019-09-05 Thread Josh Rubin



On 9/5/2019 9:05 AM, Adam Golding wrote:
What is the shortest/smallest racket program (ithat enumerates all and 
only valid racket programs?




You might be interested in the logic-programming/constraint-solving 
language named miniKanren.


http://minikanren.org/

miniKanren can solve puzzles like these:
generate ( all ! ) programs that print "I love you"
generate ( all ! ) programs that reproduce themselves
generate ( all ! ) pairs of programs (A,B) where A prints B and B prints A
generate programs from examples of what they are supposed to do.

One trick solves all these puzzles.
Given the source code of an interpreter named eval, miniKanren can solve 
equations like this:


(and
  (equal? (eval '( example1)) 'desired-result1)
  (equal? (eval '( example2)) 'desired-result2)
... )

The search strategy is complete. It will eventually check everything in 
the search tree. It will not get stuck.


--
Josh Rubin
jlru...@gmail.com


--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/b7389311-cc35-a725-dbaa-6ffc7153781b%40gmail.com.


Re: [racket-users] Listing All Programs

2019-09-05 Thread Sage Gerard
With a Racket section to boot. Thanks so much for sharing this! I had no idea 
about this kind of application.

 Original Message 
On Sep 5, 2019, 5:26 PM, Josh Rubin wrote:

> On 9/5/2019 9:05 AM, Adam Golding wrote:
>> What is the shortest/smallest racket program (ithat enumerates all and
>> only valid racket programs?
>>
>
> You might be interested in the logic-programming/constraint-solving
> language named miniKanren.
>
> http://minikanren.org/
>
> miniKanren can solve puzzles like these:
> generate ( all ! ) programs that print "I love you"
> generate ( all ! ) programs that reproduce themselves
> generate ( all ! ) pairs of programs (A,B) where A prints B and B prints A
> generate programs from examples of what they are supposed to do.
>
> One trick solves all these puzzles.
> Given the source code of an interpreter named eval, miniKanren can solve
> equations like this:
>
> (and
>   (equal? (eval '( example1)) 'desired-result1)
>   (equal? (eval '( example2)) 'desired-result2)
> ... )
>
> The search strategy is complete. It will eventually check everything in
> the search tree. It will not get stuck.
>
> --
> Josh Rubin
> jlru...@gmail.com
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/b7389311-cc35-a725-dbaa-6ffc7153781b%40gmail.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/hGOkV_lLRfIvpOcB6BfbiPsHl7cTQCC7P4tGxCROxYjM1Gyr588-aG4Y6EefSwESXaKjo8Myvyg1v-0uD3vG4SW85eGiTGL8aOZ4aASiaBg%3D%40sagegerard.com.


Re: [racket-users] Re: Listing All Programs

2019-09-05 Thread Hendrik Boom
On Thu, Sep 05, 2019 at 10:46:54AM -0700, Adam Golding wrote:
> I want to try automating programming as search where I have various methods 
> to enumerate the set of all programs in different orders (fastest to halt 
> first?  shortest source code first? etc.) and filter out certain programs 
> almost like evolutionary programming.  I don't have a specific application 
> in mind really, I wanted to have various enumerators to experiment with, 
> not unlike the opening of "New Kind of Science", where Wolfram generates 
> all possible CA programs and then categorizes them according to their 
> behavior.
> 
> The idea also came up recently in this context: 
> https://www.facebook.com/adamgolding/posts/10106973704058242
> 

I once wrote a program to enumerate typed lambda calculus expressions 
equivalent to church numerals.  It didn't find any interesting ones in 
feasible time.  But machines were slower and more expensive back in the 
70's.

This was in context of finding the shortest lambda-expression that could 
represent eash integer, and trying to find the size-restricted 
lambda-expression that could represent the largest integer.

-- hendrik

> On Thursday, 5 September 2019 13:17:32 UTC-4, Sage Gerard wrote:
> >
> > This question can be read a couple of different ways too. What are you 
> > trying to do once you have the answer you are looking for? 
> >
> >
> >
> >  Original Message 
> > On Sep 5, 2019, 1:13 PM, Adam Golding < adamg...@gmail.com > 
> > wrote:
> >
> >
> > What is the shortest program listing the largest list of programs that can 
> > be listed without looping?
> >
> > On Thursday, 5 September 2019 11:10:59 UTC-4, dvanhorn wrote:
> >>
> >> How about this: a stream of strings which can be be parsed and 
> >> compiled.  (Note that this will loop when it gets to the first program 
> >> that makes the compiler loop; luckily it's inefficient enough that 
> >> you'll never actually get there.) 
> >>
> >> #lang racket 
> >> (define valid-progs 
> >>   (for/stream ([p strings] 
> >>#:when (valid p)) 
> >> p)) 
> >>
> >> (define strings 
> >>   (stream-cons "" 
> >>(for*/stream ([s strings] 
> >>  [i (in-range 0 #x10)] 
> >>  #:when (not (<= #xD800 i #xDFFF))) 
> >>  (string-append (string (integer->char i)) s 
> >>
> >> (define (valid x) 
> >>   (with-handlers ([exn:fail? (λ _ #f)]) 
> >> (compile (with-input-from-string x 
> >>(λ () (begin0 (read) 
> >>  (unless (eof-object? (read)) 
> >>(error "fail")) 
> >> x)) 
> >>
> >> On Thu, Sep 5, 2019 at 10:58 AM Adam Golding  wrote: 
> >> > 
> >> > It's okay if the program never halts. 
> >> > 
> >> > -- 
> >> > 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...@googlegroups.com. 
> >> > To view this discussion on the web visit 
> >> https://groups.google.com/d/msgid/racket-users/70d0b081-eef8-44a6-b2e3-5a72eba7ff5a%40googlegroups.com.
> >>  
> >>
> >>
> > -- 
> > You received this message because you are subscribed to the Google Groups 
> > "Racket Users" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to racket...@googlegroups.com .
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/racket-users/beea9305-6945-45fd-91b2-59e6162b6b1e%40googlegroups.com
> >  
> > 
> > .
> >
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/66cee60f-b75c-4c9c-a2b8-a90dfabdfc1e%40googlegroups.com.

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


Re: [racket-users] Listing All Programs

2019-09-05 Thread Jens Axel Søgaard
Den tor. 5. sep. 2019 kl. 23.27 skrev Josh Rubin :

>
> On 9/5/2019 9:05 AM, Adam Golding wrote:
> > What is the shortest/smallest racket program (ithat enumerates all and
> > only valid racket programs?
> >
>
> You might be interested in the logic-programming/constraint-solving
> language named miniKanren.
>
>
Apropos,  Friedman and Byrd shows how one can use an
interpreter written in Kanren to generate Scheme programs.

https://www.youtube.com/watch?v=5vtC7WEN76w

/Jens Axel

-- 
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/CABefVgzYc0sMhobXpW9Ucbkpiex-45of6mAHSV_di4wiTc%2B_Gg%40mail.gmail.com.


[racket-users] Ability to unload an ffi-lib?

2019-09-05 Thread Chris P
Is it possible to unload an ffi-lib? I'm doing development on Windows where 
loading a DLL locks it and prevents the DLL from being recompiled.

There was another post on this, but it was about 7 years old, so I thought 
I would see if anything has changed.

Thanks,
Chris

-- 
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/0645cc02-20d2-493c-a04f-b872ca19f3b3%40googlegroups.com.


Re: [racket-users] Embedding a map widget in the DrRacket REPL

2019-09-05 Thread Alex Harsanyi


On Wednesday, September 4, 2019 at 7:50:19 PM UTC+8, Stephen De Gabrielle 
wrote:
>
> Dr Racket is amazing. Need to a demo of this and plot side by side. 
>

I can do better than just put a plot and a map widget side by 
side: https://youtu.be/R2KU0ZvIJws

Alex.
 

>
> DrRacket is so close to being an electronic lab notebook it’s almost 
> painful
>
> Stephen
>
> On Wed, 4 Sep 2019 at 12:20, Sage Gerard  > wrote:
>
>> How cool is that! DrRacket's flexibility is pretty amazing 
>>
>>
>>
>>  Original Message 
>> On Sep 4, 2019, 5:41 AM, Alex Harsanyi < alexha...@gmail.com 
>> > wrote:
>>
>>
>>
>> As part of another project, I had to update my map-widget to act as a 
>> snip% so it can be inserted into a pasteboard%.   An unintended side 
>> benefit of this work is that maps can now be embedded in the DrRacket REPL 
>> -- this in itself is not very useful, but it does make for a cool demo, so 
>> I thought I would record a video of it and share it here:  
>> https://youtu.be/MrS0FG-X8DI
>>
>> Here is a screenshot too:
>>
>> [image: map-snip-demo.PNG]
>>
>>
>> For those who want to try it out, you can install the map-widget package, 
>> than type the following in the REPL:
>>
>> (require map-widget)
>> (new map-snip%)
>>
>> Note that map tile download is not very fast, but the code does cache all 
>> downloaded data locally, this means that once tiles are downloaded, 
>> subsequent runs which show the same area will be fast.  In the linked video 
>> you don't see any tiles being loaded, as I did a practice run before 
>> recording it and all map data was locally available, making it load 
>> instantly -- you can do that too if you run the code a second time.
>>
>> And in case you want to have a look at the code itself, it is here: 
>> https://github.com/alex-hhh/map-widget
>>
>> Enjoy,
>> Alex.
>>
>> -- 
>> 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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/fdc50657-4125-4c2f-b0a9-03bc701fe869%40googlegroups.com
>>  
>> 
>> .
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket...@googlegroups.com .
>>
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/IyQJpx7V3hwBoRhSKLdOfYxktKfIFtpP0_Wl5_be2mPSg6RIUSJQMQHR6tTBL6qr0FbY210RV2u9ksNrj1vbh_KS3Dh9GguXONj-slVw75s%3D%40sagegerard.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/c23a6d78-1a59-4a77-9d0d-bcbcef1c27a9%40googlegroups.com.


Re: [racket-users] Embedding a map widget in the DrRacket REPL

2019-09-05 Thread Alex Harsanyi


On Thursday, September 5, 2019 at 10:14:15 PM UTC+8, Laurent wrote:
>
> This is utterly cool!
>
> If I may, I suggest to rebind up and down to page up and page down (or 
> even the converse, as "down" means to me "go downwards towards Earth"), use 
> the arrows to navigate NESW, and bind mouse scrolls to zooming too.
>

The map-snip% already uses the mouse wheel for zooming, but DrRacket binds 
those events to scroll the REPL window up and down, so the snip never 
receives these events -- this is the reason why I added the "up" and "down" 
keys.   The REPL example is just a side benefit of using snips for the map 
object, but for my own use, I put the map-snip% in a pasteboard% which I 
fully control, so the keyboard navigation is not an issue.  Perhaps I'll 
add some keymap% bindings for more general control of the map snip, so that 
users can bind whatever keys they prefer...
 

>
> A package containing a database of the positions of the major cities and 
> countries would be nice too :)
>


A general facility able to resolve location names to GPS coordinates would 
be a lot of work, and I don't have time for such a thing.  Sorry.

Alex.

 

> On Wed, Sep 4, 2019 at 12:50 PM Stephen De Gabrielle  > wrote:
>
>> Dr Racket is amazing. Need to a demo of this and plot side by side. 
>>
>> DrRacket is so close to being an electronic lab notebook it’s almost 
>> painful
>>
>> Stephen
>>
>> On Wed, 4 Sep 2019 at 12:20, Sage Gerard > > wrote:
>>
>>> How cool is that! DrRacket's flexibility is pretty amazing 
>>>
>>>
>>>
>>>  Original Message 
>>> On Sep 4, 2019, 5:41 AM, Alex Harsanyi < alexha...@gmail.com 
>>> > wrote:
>>>
>>>
>>>
>>> As part of another project, I had to update my map-widget to act as a 
>>> snip% so it can be inserted into a pasteboard%.   An unintended side 
>>> benefit of this work is that maps can now be embedded in the DrRacket REPL 
>>> -- this in itself is not very useful, but it does make for a cool demo, so 
>>> I thought I would record a video of it and share it here:  
>>> https://youtu.be/MrS0FG-X8DI
>>>
>>> Here is a screenshot too:
>>>
>>> [image: map-snip-demo.PNG]
>>>
>>>
>>> For those who want to try it out, you can install the map-widget 
>>> package, than type the following in the REPL:
>>>
>>> (require map-widget)
>>> (new map-snip%)
>>>
>>> Note that map tile download is not very fast, but the code does cache 
>>> all downloaded data locally, this means that once tiles are downloaded, 
>>> subsequent runs which show the same area will be fast.  In the linked video 
>>> you don't see any tiles being loaded, as I did a practice run before 
>>> recording it and all map data was locally available, making it load 
>>> instantly -- you can do that too if you run the code a second time.
>>>
>>> And in case you want to have a look at the code itself, it is here: 
>>> https://github.com/alex-hhh/map-widget
>>>
>>> Enjoy,
>>> Alex.
>>>
>>> -- 
>>> 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...@googlegroups.com .
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/fdc50657-4125-4c2f-b0a9-03bc701fe869%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to racket...@googlegroups.com .
>>>
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/racket-users/IyQJpx7V3hwBoRhSKLdOfYxktKfIFtpP0_Wl5_be2mPSg6RIUSJQMQHR6tTBL6qr0FbY210RV2u9ksNrj1vbh_KS3Dh9GguXONj-slVw75s%3D%40sagegerard.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...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/CAGHj7-JFAK_gkNRCRdb4z%3Dq%2B76ivMxz5Gfct%3DQjgXxDRuTLDiA%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroup