Re: [racket-users] Iteration speed

2015-06-02 Thread Matthias Felleisen

On Jun 2, 2015, at 1:20 AM, Matthew Butterick  wrote:

> I've increasingly been using TR this way (= keeping code in a state where it 
> can be easily toggled between typechecked and not). It works, though I'm 
> still thinking about how to achieve better ergonomics with these issues, 
> which don't have automatic solutions:
> 
> Q1. How to toggle between `#lang typed/...` and `#lang typed/.../no-check` in 
> a group of files.


It is becoming clear to me that we need to integrate some of the file system 
into our module-level scope. At that point, we could expand refactoring (like 
alpha-renaming or this kind of type toggling) to these things. 



> Q2. How to `(require ...)` typed or untyped versions of other libraries 
> depending on whether I'm running in `no-check` mode.


The NU group is working on a performance evaluation experiment that needs just 
this kind of syntactic abstraction. We should probably work it into something 
useful. 



> Q3. How to preserve the semantics of type-derived predicates in `no-check`, 
> which otherwise all become false.


Well, that's the $10M question. At what price soundness? 

-- Matthias





> 
> (define-predicate foo? FooType)
> (foo? x) ;; in `no-check` this will always return #f, which breaks the code
> 
> 
> 
> 
> 
> On Jun 1, 2015, at 4:39 PM, Sam Tobin-Hochstadt  wrote:
> 
>> Yes, if you just change `#lang typed/racket/base` to `#lang
>> typed/racket/base/no-check`, that's what you'll get.
>> 
>> Sam
>> 
>> On Mon, Jun 1, 2015 at 10:34 PM, John Carmack  wrote:
>>> Is there an option to parse all the type annotations, but not do any of the 
>>> checking? Highly interactive tuning sessions could work without type 
>>> checking, then turn it back on for structural work.
>>> 
>>> 
>>> 
 On Jun 1, 2015, at 9:05 PM, Sam Tobin-Hochstadt  
 wrote:
 
 Unfortunately, Typed Racket typechecking is pretty slow, and so the
 times you have there are not out of the ordinary. The most significant
 thing that's slow in Typed Racket is type checking numeric operations,
 because both the numbers themselves and the operations have
 complicated types.
 
 If you can say more about the program in particular, I can maybe
 suggest something that would speed it up, but it's currently a
 combination of expensive-in-principle algorithms and not being
 designed for speed many years ago when I started.
 
 Sam
 
> On Mon, Jun 1, 2015 at 9:06 PM, John Carmack  wrote:
> I am working on a little project to remotely drive a VR headset with code
> written in Racket as an attempt to make a significantly faster development
> environment for certain types of VR apps.  I am worried about what appears
> to be the compile speed.
> 
> 
> 
> It takes over three seconds from hitting ctrl-R in DrRacket to executing 
> the
> first statement of a 350 line typed racket program.  It only uses:
> 
> #lang typed/racket/base
> 
> (require racket/tcp)
> 
> 
> 
> That seems to be about twice as slow as a larger untyped racket program
> using a bunch more stuff, but even that isn’t great:
> 
> #lang racket
> 
> (require 2htdp/universe)
> 
> (require 2htdp/image)
> 
> (require 2htdp/planetcute)
> 
> (require (only-in racket/gui/base play-sound))
> 
> 
> 
> Does Run from DrRacket  have a significant time penalty?
> 
> Are there any steps I can take to make typed racket compile faster?
> 
> In many cases I don’t care much about the execution speed.
> 
> 
> 
> I would like to think that compiling and running a few hundred lines of 
> code
> on a modern desktop system should be essentially instant.
> 
> 
> 
> 
> 
> --
> 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.
>> 
>> -- 
>> 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...@g

Re: [racket-users] Iteration speed

2015-06-01 Thread Matthew Butterick
I've increasingly been using TR this way (= keeping code in a state where it 
can be easily toggled between typechecked and not). It works, though I'm still 
thinking about how to achieve better ergonomics with these issues, which don't 
have automatic solutions:

Q1. How to toggle between `#lang typed/...` and `#lang typed/.../no-check` in a 
group of files.

Q2. How to `(require ...)` typed or untyped versions of other libraries 
depending on whether I'm running in `no-check` mode.

Q3. How to preserve the semantics of type-derived predicates in `no-check`, 
which otherwise all become false.

(define-predicate foo? FooType)
(foo? x) ;; in `no-check` this will always return #f, which breaks the code





On Jun 1, 2015, at 4:39 PM, Sam Tobin-Hochstadt  wrote:

> Yes, if you just change `#lang typed/racket/base` to `#lang
> typed/racket/base/no-check`, that's what you'll get.
> 
> Sam
> 
> On Mon, Jun 1, 2015 at 10:34 PM, John Carmack  wrote:
>> Is there an option to parse all the type annotations, but not do any of the 
>> checking? Highly interactive tuning sessions could work without type 
>> checking, then turn it back on for structural work.
>> 
>> 
>> 
>>> On Jun 1, 2015, at 9:05 PM, Sam Tobin-Hochstadt  
>>> wrote:
>>> 
>>> Unfortunately, Typed Racket typechecking is pretty slow, and so the
>>> times you have there are not out of the ordinary. The most significant
>>> thing that's slow in Typed Racket is type checking numeric operations,
>>> because both the numbers themselves and the operations have
>>> complicated types.
>>> 
>>> If you can say more about the program in particular, I can maybe
>>> suggest something that would speed it up, but it's currently a
>>> combination of expensive-in-principle algorithms and not being
>>> designed for speed many years ago when I started.
>>> 
>>> Sam
>>> 
 On Mon, Jun 1, 2015 at 9:06 PM, John Carmack  wrote:
 I am working on a little project to remotely drive a VR headset with code
 written in Racket as an attempt to make a significantly faster development
 environment for certain types of VR apps.  I am worried about what appears
 to be the compile speed.
 
 
 
 It takes over three seconds from hitting ctrl-R in DrRacket to executing 
 the
 first statement of a 350 line typed racket program.  It only uses:
 
 #lang typed/racket/base
 
 (require racket/tcp)
 
 
 
 That seems to be about twice as slow as a larger untyped racket program
 using a bunch more stuff, but even that isn’t great:
 
 #lang racket
 
 (require 2htdp/universe)
 
 (require 2htdp/image)
 
 (require 2htdp/planetcute)
 
 (require (only-in racket/gui/base play-sound))
 
 
 
 Does Run from DrRacket  have a significant time penalty?
 
 Are there any steps I can take to make typed racket compile faster?
 
 In many cases I don’t care much about the execution speed.
 
 
 
 I would like to think that compiling and running a few hundred lines of 
 code
 on a modern desktop system should be essentially instant.
 
 
 
 
 
 --
 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.
> 
> -- 
> 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] Iteration speed

2015-06-01 Thread Sam Tobin-Hochstadt
Yes, if you just change `#lang typed/racket/base` to `#lang
typed/racket/base/no-check`, that's what you'll get.

Sam

On Mon, Jun 1, 2015 at 10:34 PM, John Carmack  wrote:
> Is there an option to parse all the type annotations, but not do any of the 
> checking? Highly interactive tuning sessions could work without type 
> checking, then turn it back on for structural work.
>
>
>
>> On Jun 1, 2015, at 9:05 PM, Sam Tobin-Hochstadt  wrote:
>>
>> Unfortunately, Typed Racket typechecking is pretty slow, and so the
>> times you have there are not out of the ordinary. The most significant
>> thing that's slow in Typed Racket is type checking numeric operations,
>> because both the numbers themselves and the operations have
>> complicated types.
>>
>> If you can say more about the program in particular, I can maybe
>> suggest something that would speed it up, but it's currently a
>> combination of expensive-in-principle algorithms and not being
>> designed for speed many years ago when I started.
>>
>> Sam
>>
>>> On Mon, Jun 1, 2015 at 9:06 PM, John Carmack  wrote:
>>> I am working on a little project to remotely drive a VR headset with code
>>> written in Racket as an attempt to make a significantly faster development
>>> environment for certain types of VR apps.  I am worried about what appears
>>> to be the compile speed.
>>>
>>>
>>>
>>> It takes over three seconds from hitting ctrl-R in DrRacket to executing the
>>> first statement of a 350 line typed racket program.  It only uses:
>>>
>>> #lang typed/racket/base
>>>
>>> (require racket/tcp)
>>>
>>>
>>>
>>> That seems to be about twice as slow as a larger untyped racket program
>>> using a bunch more stuff, but even that isn’t great:
>>>
>>> #lang racket
>>>
>>> (require 2htdp/universe)
>>>
>>> (require 2htdp/image)
>>>
>>> (require 2htdp/planetcute)
>>>
>>> (require (only-in racket/gui/base play-sound))
>>>
>>>
>>>
>>> Does Run from DrRacket  have a significant time penalty?
>>>
>>> Are there any steps I can take to make typed racket compile faster?
>>>
>>> In many cases I don’t care much about the execution speed.
>>>
>>>
>>>
>>> I would like to think that compiling and running a few hundred lines of code
>>> on a modern desktop system should be essentially instant.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> 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.

-- 
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] Iteration speed

2015-06-01 Thread Spencer Florence
There is a `#lang typed/racket/base/no-check`

On Mon, Jun 1, 2015 at 9:34 PM John Carmack  wrote:

> Is there an option to parse all the type annotations, but not do any of
> the checking? Highly interactive tuning sessions could work without type
> checking, then turn it back on for structural work.
>
>
>
> > On Jun 1, 2015, at 9:05 PM, Sam Tobin-Hochstadt 
> wrote:
> >
> > Unfortunately, Typed Racket typechecking is pretty slow, and so the
> > times you have there are not out of the ordinary. The most significant
> > thing that's slow in Typed Racket is type checking numeric operations,
> > because both the numbers themselves and the operations have
> > complicated types.
> >
> > If you can say more about the program in particular, I can maybe
> > suggest something that would speed it up, but it's currently a
> > combination of expensive-in-principle algorithms and not being
> > designed for speed many years ago when I started.
> >
> > Sam
> >
> >> On Mon, Jun 1, 2015 at 9:06 PM, John Carmack  wrote:
> >> I am working on a little project to remotely drive a VR headset with
> code
> >> written in Racket as an attempt to make a significantly faster
> development
> >> environment for certain types of VR apps.  I am worried about what
> appears
> >> to be the compile speed.
> >>
> >>
> >>
> >> It takes over three seconds from hitting ctrl-R in DrRacket to
> executing the
> >> first statement of a 350 line typed racket program.  It only uses:
> >>
> >> #lang typed/racket/base
> >>
> >> (require racket/tcp)
> >>
> >>
> >>
> >> That seems to be about twice as slow as a larger untyped racket program
> >> using a bunch more stuff, but even that isn’t great:
> >>
> >> #lang racket
> >>
> >> (require 2htdp/universe)
> >>
> >> (require 2htdp/image)
> >>
> >> (require 2htdp/planetcute)
> >>
> >> (require (only-in racket/gui/base play-sound))
> >>
> >>
> >>
> >> Does Run from DrRacket  have a significant time penalty?
> >>
> >> Are there any steps I can take to make typed racket compile faster?
> >>
> >> In many cases I don’t care much about the execution speed.
> >>
> >>
> >>
> >> I would like to think that compiling and running a few hundred lines of
> code
> >> on a modern desktop system should be essentially instant.
> >>
> >>
> >>
> >>
> >>
> >> --
> >> 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.
>

-- 
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] Iteration speed

2015-06-01 Thread John Carmack
Is there an option to parse all the type annotations, but not do any of the 
checking? Highly interactive tuning sessions could work without type checking, 
then turn it back on for structural work.



> On Jun 1, 2015, at 9:05 PM, Sam Tobin-Hochstadt  wrote:
> 
> Unfortunately, Typed Racket typechecking is pretty slow, and so the
> times you have there are not out of the ordinary. The most significant
> thing that's slow in Typed Racket is type checking numeric operations,
> because both the numbers themselves and the operations have
> complicated types.
> 
> If you can say more about the program in particular, I can maybe
> suggest something that would speed it up, but it's currently a
> combination of expensive-in-principle algorithms and not being
> designed for speed many years ago when I started.
> 
> Sam
> 
>> On Mon, Jun 1, 2015 at 9:06 PM, John Carmack  wrote:
>> I am working on a little project to remotely drive a VR headset with code
>> written in Racket as an attempt to make a significantly faster development
>> environment for certain types of VR apps.  I am worried about what appears
>> to be the compile speed.
>> 
>> 
>> 
>> It takes over three seconds from hitting ctrl-R in DrRacket to executing the
>> first statement of a 350 line typed racket program.  It only uses:
>> 
>> #lang typed/racket/base
>> 
>> (require racket/tcp)
>> 
>> 
>> 
>> That seems to be about twice as slow as a larger untyped racket program
>> using a bunch more stuff, but even that isn’t great:
>> 
>> #lang racket
>> 
>> (require 2htdp/universe)
>> 
>> (require 2htdp/image)
>> 
>> (require 2htdp/planetcute)
>> 
>> (require (only-in racket/gui/base play-sound))
>> 
>> 
>> 
>> Does Run from DrRacket  have a significant time penalty?
>> 
>> Are there any steps I can take to make typed racket compile faster?
>> 
>> In many cases I don’t care much about the execution speed.
>> 
>> 
>> 
>> I would like to think that compiling and running a few hundred lines of code
>> on a modern desktop system should be essentially instant.
>> 
>> 
>> 
>> 
>> 
>> --
>> 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] Iteration speed

2015-06-01 Thread Sam Tobin-Hochstadt
Unfortunately, Typed Racket typechecking is pretty slow, and so the
times you have there are not out of the ordinary. The most significant
thing that's slow in Typed Racket is type checking numeric operations,
because both the numbers themselves and the operations have
complicated types.

If you can say more about the program in particular, I can maybe
suggest something that would speed it up, but it's currently a
combination of expensive-in-principle algorithms and not being
designed for speed many years ago when I started.

Sam

On Mon, Jun 1, 2015 at 9:06 PM, John Carmack  wrote:
> I am working on a little project to remotely drive a VR headset with code
> written in Racket as an attempt to make a significantly faster development
> environment for certain types of VR apps.  I am worried about what appears
> to be the compile speed.
>
>
>
> It takes over three seconds from hitting ctrl-R in DrRacket to executing the
> first statement of a 350 line typed racket program.  It only uses:
>
> #lang typed/racket/base
>
> (require racket/tcp)
>
>
>
> That seems to be about twice as slow as a larger untyped racket program
> using a bunch more stuff, but even that isn’t great:
>
> #lang racket
>
> (require 2htdp/universe)
>
> (require 2htdp/image)
>
> (require 2htdp/planetcute)
>
> (require (only-in racket/gui/base play-sound))
>
>
>
> Does Run from DrRacket  have a significant time penalty?
>
> Are there any steps I can take to make typed racket compile faster?
>
> In many cases I don’t care much about the execution speed.
>
>
>
> I would like to think that compiling and running a few hundred lines of code
> on a modern desktop system should be essentially instant.
>
>
>
>
>
> --
> 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] Iteration speed

2015-06-01 Thread William J. Bowman
My mistake! Do you have the same issues if you run program/compile from
the command line with just `racket`?

-- 
William J. Bowman

On Tue, Jun 02, 2015 at 01:17:45AM +, John Carmack wrote:
> I meant time-to-compile penalty, not execution speed.  None of those options 
> seem to make much difference in the Ctrl-R-to-first-effect time.
> 
> -Original Message-
> From: William J. Bowman [mailto:w...@williamjbowman.com] 
> Sent: Monday, June 01, 2015 8:13 PM
> To: John Carmack
> Cc: Racket Users
> Subject: Re: [racket-users] Iteration speed
> 
> On Tue, Jun 02, 2015 at 01:06:34AM +, John Carmack wrote:
> > Does Run from DrRacket  have a significant time penalty?
> By default, DrRacket has debugging instrumentation enabled, which can 
> significantly slow down programs that you may expect to run fast.
> Disabling these will speed things up for you.
> For more information, see:
> https://urldefense.proofpoint.com/v1/url?u=http://docs.racket-lang.org/guide/performance.html&k=ZVNjlDMF0FElm4dQtryO4A%3D%3D%0A&r=Kjg6LltY9QjkipKooaVldA%3D%3D%0A&m=TtP0k4PM6zxM6Zs2sFIAlEm48kO0Bz9hZxPboH5sekQ%3D%0A&s=d4be7aca906d01beded37362c11e777290a6062ee2ff4e0e6e0d735550063c53
> 
> --
> William J. Bowman
> 
> Northeastern University
> College of Computer and Information Science

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


signature.asc
Description: Digital signature


Re: [racket-users] Iteration speed

2015-06-01 Thread William J. Bowman
On Tue, Jun 02, 2015 at 01:06:34AM +, John Carmack wrote:
> Does Run from DrRacket  have a significant time penalty?
By default, DrRacket has debugging instrumentation enabled, which can
significantly slow down programs that you may expect to run fast.
Disabling these will speed things up for you.
For more information, see:
http://docs.racket-lang.org/guide/performance.html

-- 
William J. Bowman

Northeastern University
College of Computer and Information Science

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


signature.asc
Description: Digital signature


[racket-users] Iteration speed

2015-06-01 Thread John Carmack
I am working on a little project to remotely drive a VR headset with code 
written in Racket as an attempt to make a significantly faster development 
environment for certain types of VR apps.  I am worried about what appears to 
be the compile speed.

It takes over three seconds from hitting ctrl-R in DrRacket to executing the 
first statement of a 350 line typed racket program.  It only uses:
#lang typed/racket/base
(require racket/tcp)

That seems to be about twice as slow as a larger untyped racket program using a 
bunch more stuff, but even that isn't great:
#lang racket
(require 2htdp/universe)
(require 2htdp/image)
(require 2htdp/planetcute)
(require (only-in racket/gui/base play-sound))

Does Run from DrRacket  have a significant time penalty?
Are there any steps I can take to make typed racket compile faster?
In many cases I don't care much about the execution speed.

I would like to think that compiling and running a few hundred lines of code on 
a modern desktop system should be essentially instant.


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