Re: [racket-users] Typed/Untyped cost reduction and experience

2016-01-05 Thread JCG
On Tuesday, January 5, 2016 at 2:12:44 PM UTC-5, Matthias Felleisen wrote: > Late but I want to record principles and experiences in this thread: > > I don't understand this bullet. Bullet 1 says your code is now completely > typed. Our experience is that completely typed versions are about as

Re: [racket-users] Potential Contract Profiler UI Change

2016-01-05 Thread Benjamin Greenman
Sounds great! Two suggestions: 1. A `raco contract-profile` command to run the main submodule in a file. 2. Make even less output by default -- just the overall runtime & by-callee contracts. But this is just my opinion :) On Tue, Jan 5, 2016 at 6:06 PM, Vincent St-Amour < stamo...@eecs.northw

Re: [racket-users] Typed/Untyped cost reduction and experience

2016-01-05 Thread Hendrik Boom
On Tue, Jan 05, 2016 at 06:51:33PM -0800, Emmanuel Oga wrote: > On Tuesday, January 5, 2016 at 11:12:44 AM UTC-8, Matthias Felleisen wrote: > > TR is intended for people who wish to add types retroactively. > > Not sure I understand this stance: > > * Does this mean if I want to use types proact

Re: [racket-users] Typed/Untyped cost reduction and experience

2016-01-05 Thread Emmanuel Oga
On Tuesday, January 5, 2016 at 11:12:44 AM UTC-8, Matthias Felleisen wrote: > TR is intended for people who wish to add types retroactively. Not sure I understand this stance: * Does this mean if I want to use types proactively, TR is not a recommended PL? * Or maybe it means adding types proac

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Robby Findler
Well, if they aren't, the contract could dynamically decide to put in a chaperone. Robby On Tue, Jan 5, 2016 at 5:07 PM, Sam Tobin-Hochstadt wrote: > The problem in this specific case is that the hash tables in the data > structure might be mutable, and so the fully-eager check doesn't > really

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Sam Tobin-Hochstadt
The problem in this specific case is that the hash tables in the data structure might be mutable, and so the fully-eager check doesn't really help. But in general, I definitely agree. Sam On Tue, Jan 5, 2016 at 6:03 PM, Robby Findler wrote: > This is related to a thought I've had, tho. It seems

[racket-users] Potential Contract Profiler UI Change

2016-01-05 Thread Vincent St-Amour
I'm considering a change to the UI of the contract profiler, and would like opinions from people using it. As of 6.3, the contract profiler emits its various reports in a few separate files, whose names are hard-coded. This is (IMO) a UI disaster, which makes the profiler harder to use. As of HE

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Robby Findler
This is related to a thought I've had, tho. It seems like it is hard for TR or for the contract system to know if a lazy or a strict check is the most useful, but the programmer may have some good information. So maybe there could be a way for the TR programmer to say "make things with this type, w

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Sam Tobin-Hochstadt
It's possible; I'm not sure. The essence of the issue is here: https://gist.github.com/38f4ef694d1df822b3e2 with this contract: (recursive-contract (struct/c Trie number? (or/c #f (hash/c any/c Trie/c))) #:chaperone) The simil

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Robby Findler
Could the contract do something helpful here, or is this really a fix that needs to happen in TR and/or the pfds library? Robby On Tue, Jan 5, 2016 at 3:21 PM, Sam Tobin-Hochstadt wrote: > The actual problem (in addition to the slowness of chaperones that > exist at every level of a structure)

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Sam Tobin-Hochstadt
The actual problem (in addition to the slowness of chaperones that exist at every level of a structure) is that TR doesn't distinguish between mutable and immutable hash tables. Therefore, a contract that uses `hash/c` has to be a chaperone contract, thus causing the slowdown John reported. Sam O

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Vincent St-Amour
Easy to work around. #lang racket/base (module stack typed/racket/base (struct Stack ([s : (Listof Integer)])) (provide: [create (-> Stack)] [push (-> Integer Stack Stack)] [pop (-> Stack Stack)]) (define (create) (Stack '())) (: push : Intege

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Benjamin Greenman
Right, my comment was intended to show that innocent Typed Racket libraries may be harmful to Racket programmers. On Tue, Jan 5, 2016 at 3:30 PM, Jay McCarthy wrote: > Your comment is not evidence that Typed Racket libraries are useful to > Racket programmers, but in fact the opposite. > > Jay >

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Sam Tobin-Hochstadt
The overhead appears to be a combination of the following: - Typed Racket should see that checking whether something is a Trie is a flat contract, but it doesn't. - Typed Racket should be able to drop the result contract check entirely, but it can't (I don't think this is expensive, though). -

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Jay McCarthy
Your comment is not evidence that Typed Racket libraries are useful to Racket programmers, but in fact the opposite. Jay On Tue, Jan 5, 2016 at 3:28 PM, Benjamin Greenman wrote: > I'm afraid it's just O(n) contracts. For example: > > #lang racket/base > > (module stack typed/racket/base > (def

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Benjamin Greenman
I'm afraid it's just O(n) contracts. For example: #lang racket/base (module stack typed/racket/base (define-type Stack (Listof Integer)) (provide: [create (-> Stack)] [push (-> Integer Stack Stack)] [pop (-> Stack Stack)]) (define (create) '()) (define push cons) (define p

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Vincent St-Amour
(add1 Jay) That kind of overhead has to be a bug somewhere, or a bad way to write something. I hope. Vincent On Tue, 05 Jan 2016 13:40:33 -0600, Jay McCarthy wrote: > > I would prefer taking this useful library and making it actually > useful to all Racket users. > > Jay > > On Tue, Jan 5,

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Jay McCarthy
I would prefer taking this useful library and making it actually useful to all Racket users. Jay On Tue, Jan 5, 2016 at 2:39 PM, 'John Clements' via Racket Users wrote: > Asumu, does this make sense to you? Note that in particular, I think that a > warning at the top of the pfds package wouldn’

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread 'John Clements' via Racket Users
Asumu, does this make sense to you? Note that in particular, I think that a warning at the top of the pfds package wouldn’t have helped me; I think a warning at the top of each pfds page would make a lot more sense. John > On Jan 5, 2016, at 11:00 AM, Sam Tobin-Hochstadt wrote: > > Yes, I thi

Re: [racket-users] Typed/Untyped cost reduction and experience

2016-01-05 Thread Matthias Felleisen
Late but I want to record principles and experiences in this thread: On Dec 26, 2015, at 6:52 PM, JCG wrote: > Having just converted a server process of about 1800 lines of untyped Racket > to 1900 lines of typed Racket, I'd like to make some comments > > 1) I highly suggest starting in Type

Re: [racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread Sam Tobin-Hochstadt
Yes, I think a warning at the top of the documentation for the `pfds` package would make sense, and probably Asumu would accept such a pull request. You might follow the phrasing in the math/array library. Sam On Tue, Jan 5, 2016 at 1:49 PM 'John Clements' via Racket Users < racket-users@googlegr

[racket-users] warning on use trie functions in #lang racket?

2016-01-05 Thread 'John Clements' via Racket Users
This program constructs a trie containing exactly two keys; each is a list of 256 integers. On my machine, it takes *twelve seconds*. The time taken appears to be n^2 in the length of the key, so doubling it to 256 means it’ll take about a minute to add a key. #lang racket (require pfds/trie)

Re: [racket-users] typed/racket involved in matched (or)

2016-01-05 Thread JCG
I just did another workaround, this time better for me anyway. This is all to accommodate deprecated end-user data identifiers while promoting better-conceived names. I separated the (or pattern1, pattern2...) into a separate (normalize-request) function and removed the inline versions. As a

[racket-users] Test request

2016-01-05 Thread Héctor Mc
Hey guys I'm proving this app and I will be grateful if can help me with new ideas or evaluate it. I create a serie of videos that show your functions and objetive. Exist a survey that you can respond, it is in http://goo.gl/forms/jsNIgRvdr8 together with the videos. Not is problem if you respond

Re: [racket-users] How to generate unique link for one-time use in web server?

2016-01-05 Thread Marc Kaufmann
Thanks both, I will probably go with the no-continuations solution, since I am virtually certain that I will change the code while it is running - it runs over several weeks, and I sure to muck up both on survey and program design. Cheers, great feedback, Marc On Mon, Jan 4, 2016 at 2:15 PM, Jay

Re: [racket-users] making games in racket

2016-01-05 Thread Vincent St-Amour
On Tue, 05 Jan 2016 07:39:31 -0600, Alexander Shopov wrote: > > > break up your big function into small ones. > Apart from the obvious maintainability concerns - is there some rule > of thumb - how big a function shoul be in order to be inlined either > compile time or run time. If a code path is

Re: [racket-users] making games in racket

2016-01-05 Thread Matthias Felleisen
On Jan 5, 2016, at 8:39 AM, Alexander Shopov wrote: >> break up your big function into small ones. > Apart from the obvious maintainability concerns - is there some rule > of thumb - how big a function shoul be in order to be inlined either > compile time or run time. If a code path is hot - wha

Re: [racket-users] making games in racket

2016-01-05 Thread Alexander Shopov
> break up your big function into small ones. Apart from the obvious maintainability concerns - is there some rule of thumb - how big a function shoul be in order to be inlined either compile time or run time. If a code path is hot - what could stop the inlining? Kind regards: al_shopov -- You re

Re: [racket-users] Abridged summary of racket-users@googlegroups.com - 17 updates in 5 topics

2016-01-05 Thread Matthias Felleisen
htdp/image (I hope you mean 2htdp/image, both exist) is not a good platform for creating GUIs. Consider using Racket’s underlying GUI library. > On Dec 23, 2015, at 12:23 PM, sagar tripathy wrote: > > I am trying to make a gui for htdp/image packet with interactive windows but > the docum

Re: [racket-users] making games in racket

2016-01-05 Thread Matthias Felleisen
[[ Please, please break up your big function into small ones. A function per handler would be a good start. -- Matthias ]] On Dec 26, 2015, at 9:52 AM, Taro Annual wrote: > 2015年12月26日土曜日 21時54分52秒 UTC+9 Matthew Flatt: >> At Fri, 25 Dec 2015 22:17:21 -0800 (PST), Taro Annual wrote: >>> I mak

Re: [racket-users] Confused about the difference between the REPL and the toplevel.

2016-01-05 Thread Matthias Felleisen
> On Dec 22, 2015, at 8:46 AM, Matthew Flatt wrote: > > I think Robby was just confused by your example, because he's used to > starting with a fresh REPL. :) When Dan F. and I worked on TLL/3 way back in the 80s together, we confused ourselves several times with just HO functions and some au

Re: [racket-users] Errors in url dispatch of static files

2016-01-05 Thread Jay McCarthy
In the second case, #:servlet-regexp #rx"" makes it so that `start` gets first dibs on all requests. Your dispatch function includes an `else` case, so anything that doesn't match an explicit case is handled. If you remove the `else`, then things not explicitly mentioned will have (next-dispatch

Re: [racket-users] Have not found my (place)

2016-01-05 Thread JCG
On Monday, January 4, 2016 at 1:02:30 PM UTC-5, Matthew Flatt wrote: > I've pushed a repair for this bug. > > Thanks for the report! Thanks for the fix. It works well. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this

[racket-users] Errors in url dispatch of static files

2016-01-05 Thread pvt
I want to show some images, if I have only one application, the image could be showed in the web paged as expected: ```scheme #lang racket (require web-server/servlet) (require web-server/servlet-env) (define (my-app req) (response/xexpr '(html (head (title "OK")) (body (h1 "ok