Re: [racket-dev] Math library initial commit almost ready; comments on issues welcome

2012-10-01 Thread Neil Toronto
On 10/01/2012 04:20 PM, Sam Tobin-Hochstadt wrote: On Mon, Oct 1, 2012 at 6:08 PM, Neil Toronto wrote: On 10/01/2012 02:06 PM, Sam Tobin-Hochstadt wrote: On Mon, Oct 1, 2012 at 2:26 PM, Neil Toronto wrote: My timing tests also show that typechecking is apparently quadratic in the depth of

Re: [racket-dev] Math library initial commit almost ready; comments on issues welcome

2012-10-01 Thread Neil Toronto
On 10/01/2012 02:06 PM, Sam Tobin-Hochstadt wrote: On Mon, Oct 1, 2012 at 2:26 PM, Neil Toronto wrote: PR 13098 isn't really fixable, in some sense. There's just more data there with broader types, so it will always take longer than for more specific types. All of the things I'

[racket-dev] Math library initial commit almost ready; comments on issues welcome

2012-10-01 Thread Neil Toronto
I think I'm about a week away from having the math library's initial commit ready. It just needs some more docs and test cases. Here are the high-level issues, for which I'm soliciting comments, suggestions, questions, and answers: * Compile time. It currently takes 1m20s to compile `math' w

Re: [racket-dev] Racket Questions?

2012-09-17 Thread Neil Toronto
I'll implement `flmodulo' in the math library, which already has `flodd?' and `fleven?'. These things can be tricky to get right; for example, most people wouldn't notice that their implementation is wrong on negative inputs. I'll probably also do `flremainder'. Neil ⊥ On 09/15/2012 12:45 PM,

Re: [racket-dev] What are single flonums good for?

2012-09-17 Thread Neil Toronto
On 09/16/2012 04:10 PM, Matthias Felleisen wrote: Suppose we had started Racket long ago and maintained it until now. Then we'd be looking at 8bit, 16, 32, and 64 precision. In some N years from now, we may need 128. (Actually there were machines in the past that did, but never mind.) Could w

Re: [racket-dev] What are single flonums good for?

2012-09-12 Thread Neil Toronto
On 09/12/2012 10:24 AM, Vincent St-Amour wrote: I agree that having to handle single floats when reasoning about numbers complicates things, and it annoys me too. But I still think it's less problematic than what I describe above [compilation could change the behavior > of a program]. Interesti

[racket-dev] What are single flonums good for?

2012-09-12 Thread Neil Toronto
I ask because I'm tired of worrying about them. More precisely, I'm tired of Typed Racket (rightly) making me worry about them. I'm also a little bit tired of this: (: foo (case-> (Single-Flonum -> Single-Flonum) (Flonum -> Flonum) (Real -> Real))) (define (foo x)

[racket-dev] Syntax errors in a Scribble evaluator look like documentation errors

2012-09-11 Thread Neil Toronto
It doesn't seem to matter how I set up the evaluator (using `make-base-eval' or `make-evaluator'). If an example fails to typecheck, it looks like an ugly documentation error. This is an actual example in the math docs, which I would really like to keep: > (flabs (exact->inexact 0.5f0)) eval:8

Re: [racket-dev] typed racket non-monotonic in scary way?

2012-09-07 Thread Neil Toronto
On 09/07/2012 06:42 PM, John Clements wrote: I was trying to write a function on natural numbers today, and came up with an example that scares me all to bits. This program: #lang typed/racket (: int->nat (Natural -> Natural)) (define (int->nat n) (cond [(<= n 0) 13] [else (- n 1)]

Re: [racket-dev] TR's optimizer eventually going to unbox structs?

2012-08-27 Thread Neil Toronto
On 08/27/2012 09:11 AM, Vincent St-Amour wrote: TR's complex number optimizations eliminate repeated boxing and unboxing in chains of operations that each consume and produce complex numbers. Similar optimizations for structs would eliminate structs for intermediate results in chains of operatio

Re: [racket-dev] When is it safe to not rename a runtime value in a macro?

2012-08-25 Thread Neil Toronto
mutated, but having it search their lexical scope for `set!' should do it. I think. It hasn't been too bad so far. Neil ⊥ On 08/25/2012 11:03 AM, Matthias Felleisen wrote: It's the wrong way to go. Let's investigate more before we jump to conclusions. On Aug 25, 2012, at 12:

Re: [racket-dev] When is it safe to not rename a runtime value in a macro?

2012-08-25 Thread Neil Toronto
On 08/25/2012 11:33 AM, Ryan Culpepper wrote: On 08/25/2012 01:08 PM, Neil Toronto wrote: A number can expand to an arbitrary expression? How? And what do you mean by "the '#%datum' macro associated with them"? Applied to them? > (let-syntax ([#%datum (lambda (stx) #&

Re: [racket-dev] When is it safe to not rename a runtime value in a macro?

2012-08-25 Thread Neil Toronto
On 08/25/2012 10:53 AM, Ryan Culpepper wrote: On 08/25/2012 12:19 PM, Neil Toronto wrote: I've reordered these a bit: number string bytes character regexp In other words, "literal data". But did you check that the '#%datum' macro associated with them has the stand

Re: [racket-dev] When is it safe to not rename a runtime value in a macro?

2012-08-25 Thread Neil Toronto
wrote: This is definitely a macro writer bill of rights situation. Too bad that TR's optimizer cannot take advantage of all these kinds of things that are already happening in the optimizer one level down. Robby On Sat, Aug 25, 2012 at 11:19 AM, Neil Toronto wrote: A lot of macros start b

[racket-dev] When is it safe to not rename a runtime value in a macro?

2012-08-25 Thread Neil Toronto
A lot of macros start by renaming some syntax that's assumed to eventually represent a runtime value, like the `or' macro does: > (syntax->datum (expand-syntax #'(or #t #f))) '(let-values (((or-part) '#t)) (if or-part or-part '#f)) But it's not always a good thing, particularly when the output

[racket-dev] A more useful struct type predicate for structs with contravariant blah-de-blah?

2012-08-24 Thread Neil Toronto
A while ago, on PR 12903 (I don't know why it's not closed yet, FWIW, because I think it's fixed), we had this discussion: Me: I think this should work. #lang typed/racket (struct: (A) bar ([proc : (A -> Any)])) (define-predicate -bar? (bar Any)) Sam: That's evil; here's why. Suppose `bar` h

Re: [racket-dev] [plt] Push #25256: master branch updated

2012-08-23 Thread Neil Toronto
On 08/22/2012 02:52 PM, sa...@racket-lang.org wrote: e9f2099 Eric Dobson 2012-08-12 14:36 : | Fix typechecking of polymorphic structs with parent types. | | Closes PR12998. : A collects/tests/typed-racket/fail/poly-struct-parent2.rkt A collects/tests/typed-racket/fail/poly-struct-parent3.r

[racket-dev] TR's optimizer eventually going to unbox structs?

2012-08-18 Thread Neil Toronto
Is TR's optimizer eventually going to unbox structs in the same way it unboxes rectangular flonums? I have a design choice right now: how to represent probabilities. Floats are good because of their speed, but because of floating-point limitations, *four different representations* are typicall

Re: [racket-dev] [plt] Push #25220: master branch updated

2012-08-16 Thread Neil Toronto
On 08/16/2012 06:17 PM, ro...@racket-lang.org wrote: 01e7ede Robby Findler 2012-08-16 19:15 : | some performance improvements for the new drracket blueboxes | specifically, it doesn't trigger redrawing of the screen | as aggressively, which seems to make a little difference | under mac os x. | |

Re: [racket-dev] [plt] Push #25216: master branch updated

2012-08-16 Thread Neil Toronto
0452bd7 Matthew Flatt 2012-08-16 12:46 : | bytecode optimizer improvement | | Treat unsafe functional operations (which never raise an | exception) as omitable, which means that simple `let-values' | combinations can be split into `let' bindings, etc. : M collects/ffi/unsafe/com.rkt |

Re: [racket-dev] Wrapping loops for TR isn't working, and the type annotations are for the wrong value

2012-08-15 Thread Neil Toronto
On 08/15/2012 08:05 AM, Sam Tobin-Hochstadt wrote: On Wed, Aug 15, 2012 at 9:54 AM, Neil Toronto wrote: BTW, what do you think of deprecating result annotations and using body annotations instead? I'm not sure yet. This short exercise might convince you: implement `for/vector:'

Re: [racket-dev] Wrapping loops for TR isn't working, and the type annotations are for the wrong value

2012-08-15 Thread Neil Toronto
I've attached my latest. It's possibly better. On 08/15/2012 08:05 AM, Sam Tobin-Hochstadt wrote: So then the first value computed is replicated everywhere? That seems unappealing as well. I've implemented #:fill in this one. If both #:length and #:fill are given, the vector is created with

Re: [racket-dev] Wrapping loops for TR isn't working, and the type annotations are for the wrong value

2012-08-15 Thread Neil Toronto
On 08/15/2012 08:39 AM, J. Ian Johnson wrote: - Original Message - From: "Neil Toronto" To: "Sam Tobin-Hochstadt" So then the first value computed is replicated everywhere? That seems unappealing as well. It costs nothing, and if the #:length argument m

Re: [racket-dev] Wrapping loops for TR isn't working, and the type annotations are for the wrong value

2012-08-15 Thread Neil Toronto
On 08/15/2012 08:05 AM, Sam Tobin-Hochstadt wrote: On Wed, Aug 15, 2012 at 9:54 AM, Neil Toronto wrote: When #:length is given, it's similar in that it creates a vector outside the loop and bangs values into it. But I have to start with (define vs (vector)) and then (set! vs (make-vecto

Re: [racket-dev] Wrapping loops for TR isn't working, and the type annotations are for the wrong value

2012-08-15 Thread Neil Toronto
On 08/15/2012 05:24 AM, Sam Tobin-Hochstadt wrote: On Tue, Aug 14, 2012 at 11:52 PM, Neil Toronto wrote: Some typed "for" loops would have to be reimplemented, unless inference improves a lot. To make this easier, I've attached an example implementation of `for/vector:' an

[racket-dev] Wrapping loops for TR isn't working, and the type annotations are for the wrong value

2012-08-14 Thread Neil Toronto
I like the idea of wrapping Racket's standard "for" loops with a few annotations and letting inference figure out the rest of the types. The problem is, it doesn't work very well. 1. Even though the loop's type is technically optional, it seems to always be required. 2. Many simple loops d

Re: [racket-dev] TRPlot - A Typed Racket-ing of Plot

2012-08-12 Thread Neil Toronto
On 08/12/2012 06:14 PM, Ray Racine wrote: Just completed a first cut draft TRing the Plot collection. Completely untested, though the few things I've tried worked fine. Neil/Sam, any suggestions, naming or layout conventions are much appreciated. Otherwise, I'll do a cleanup pass, test it, and

Re: [racket-dev] [plt] Push #25179: master branch updated

2012-08-12 Thread Neil Toronto
I haven't tried it yet, but this sounds awesome. On 08/12/2012 07:46 AM, ro...@racket-lang.org wrote: robby has updated `master' from 5d81b80736 to 0c6734f782. http://git.racket-lang.org/plt/5d81b80736..0c6734f782 =[ One Commit ]= Direc

[racket-dev] Unfolding twice?

2012-08-10 Thread Neil Toronto
Using typed `flatten' takes too much manual instantiation. In the following program, the first three uses fail to typecheck; the last passes. #lang typed/racket (define-type (Treeof A) (Rec T (U A (Listof T (: flatten (All (A) ((Treeof A) (Any -> Boolean : A) -> (Listof A (define (flat

Re: [racket-dev] Is it possible to write `flatten' in TR?

2012-08-08 Thread Neil Toronto
On 08/07/2012 12:52 PM, Prabhakar Ragde wrote: Neil wrote: (define (flatten lst) (cond [(list? lst) (append* ((inst map (Listof A) (Listof* A)) flatten lst))] [else (list lst)])) This version of flatten has quadra

Re: [racket-dev] Is it possible to write `flatten' in TR?

2012-08-07 Thread Neil Toronto
On 08/07/2012 12:52 PM, Prabhakar Ragde wrote: Neil wrote: (define (flatten lst) (cond [(list? lst) (append* ((inst map (Listof A) (Listof* A)) flatten lst))] [else (list lst)])) This version of flatten has quadra

Re: [racket-dev] Is it possible to write `flatten' in TR?

2012-08-07 Thread Neil Toronto
(define-type (Listof* A) (Rec T (U A (Listof T (: flatten (All (A) ((Listof* A) -> (Listof A And then applying it as such: ((inst flatten (Listof Number)) (list (list 1 2 3))) This would typecheck and return the value (list 1 2 3) with the type (Listof (Listof Number)). This is bad and b

[racket-dev] Is it possible to write `flatten' in TR?

2012-08-07 Thread Neil Toronto
Short version: Creating arrays from nested lists (and vectors) would be a lot easier if I could write a `flatten' function in TR, but I haven't been able to. Is it possible? Long version: Given this type: (define-type (Listof* A) (Rec T (U A (Listof T I'd like this function: (: flatten (

Re: [racket-dev] Should I expect this program to typecheck?

2012-08-06 Thread Neil Toronto
So are the type errors an error in TR, or a known limitation? Neil ⊥ On 08/06/2012 02:25 PM, J. Ian Johnson wrote: How do you determine the difference between the two vector types is the question... -Ian - Original Message - From: "Neil Toronto" To: "" Sent: Monday,

[racket-dev] Should I expect this program to typecheck?

2012-08-06 Thread Neil Toronto
#lang typed/racket (: vector-first (All (A B) ((U (Vectorof A) (Vectorof B)) -> (U A B (define (vector-first vs) (vector-ref vs 0)) I can't think of a reason this shouldn't work, but I may not be taxing my imagination enough to come up with one. Neil ⊥ _ Racket

Re: [racket-dev] Plot Contour Intervals Question (Bug?)

2012-08-04 Thread Neil Toronto
On 08/03/2012 11:59 AM, Doug Williams wrote: (require plot) (plot (contour-intervals (lambda (x y) (define z (- x y)) (cond ((< z -1) -1) ((> z 1) 1) (else z))) -2 2 -2 2)) ... Why is the lower white triangle not colored red -

Re: [racket-dev] Plot Contour Intervals Question (Bug?)

2012-08-04 Thread Neil Toronto
On 08/03/2012 11:59 AM, Doug Williams wrote: Here is a simple contour-interval example that I don't understand. [We are changing out some uses of shade in older code when I came across something I simplified to this.] Consider the following simple program. (require plot) (plot (contour-interva

Re: [racket-dev] Release Announcement for v5.3, second draft

2012-08-01 Thread Neil Toronto
Findler wrote: How about this: * The API for fast floating-point bitmaps (flomaps) supports image processing operations. It is written in Typed Racket, so Typed Racket code may use it without the cost of contract checks. ? Robby On Wed, Aug 1, 2012 at 11:05 AM, Neil Toronto wrote:

Re: [racket-dev] Release Announcement for v5.3, second draft

2012-08-01 Thread Neil Toronto
On 08/01/2012 05:34 AM, Ryan Culpepper wrote: * The API for fast floating-point bitmaps (flomaps) supports image processing operations, including pointwise arithmetic, gradients, blur, resizing with correct downsampling, arbitrary spatial transformations, and pict-like combiners. This

Re: [racket-dev] A Const type constructor

2012-07-31 Thread Neil Toronto
On 07/25/2012 07:10 PM, D Herring wrote: On 07/25/2012 12:29 PM, Neil Toronto wrote: What if TR had a notion of const-ness, like in C? Suppose (Vectorof A) is a subtype of (Const-Vectorof B) when A is a subtype of B, and (Const-Vectorof A) is never a subtype of (Vectorof B). In C, "cons

Re: [racket-dev] raco make cannot marshal value error

2012-07-29 Thread Neil Toronto
Maybe it would be good to have official support for safe 3D values. I realized after I wrote the `images/compile-time' module that it was just a special case. It could be extended to handle anything serializable. Having to serialize values at expansion time and unserialize them at runtime make

Re: [racket-dev] Best way to handle duplicate identifiers

2012-07-25 Thread Neil Toronto
On 07/25/2012 01:50 PM, Robby Findler wrote: I think you're best off to release a new version of the science collection and make it require 5.3 as the minimum version (one that differs from the currently released one only by sorting out this conflict). I'm not sure which version of nan? and infin

Re: [racket-dev] A Const type constructor

2012-07-25 Thread Neil Toronto
On 07/25/2012 10:31 AM, Neil Toronto wrote: On 07/25/2012 10:26 AM, Sam Tobin-Hochstadt wrote: On Wed, Jul 25, 2012 at 9:29 AM, Neil Toronto wrote: After thinking about it, I don't want an Immutable-Vector type, for which v : Immutable-Vector proves (immutable? v) is #t. That wou

Re: [racket-dev] Pre-Release Checklist for v5.3

2012-07-25 Thread Neil Toronto
On 07/24/2012 08:03 AM, Ryan Culpepper wrote: * Neil Toronto - Plot Tests Done. Can you also add the following to future checklists? - Images tests - Inspect icons I've just done these, too. Sorry about replying late. I'm on a 1/2-to-3/4-time-ish vacat

Re: [racket-dev] Release Announcement for v5.3

2012-07-25 Thread Neil Toronto
On 07/25/2012 10:26 AM, Ryan Culpepper wrote: neil: - image, flomaps changes? - resizable plot snips (3ed1a787) "The Typed Racket API for fast floating-point bitmaps (flomaps) is now public. Image processing operations include pointwise arithmetic, gradients, blur, resizing with correct d

Re: [racket-dev] A Const type constructor

2012-07-25 Thread Neil Toronto
On 07/25/2012 10:26 AM, Sam Tobin-Hochstadt wrote: On Wed, Jul 25, 2012 at 9:29 AM, Neil Toronto wrote: After thinking about it, I don't want an Immutable-Vector type, for which v : Immutable-Vector proves (immutable? v) is #t. That would be seriously annoying to users of a vector li

[racket-dev] A Const type constructor

2012-07-25 Thread Neil Toronto
After thinking about it, I don't want an Immutable-Vector type, for which v : Immutable-Vector proves (immutable? v) is #t. That would be seriously annoying to users of a vector library. What if TR had a notion of const-ness, like in C? Suppose (Vectorof A) is a subtype of (Const-Vectorof B) w

Re: [racket-dev] [plt] Push #24997: master branch updated

2012-07-16 Thread Neil Toronto
On 07/16/2012 07:45 AM, sa...@racket-lang.org wrote: samth has updated `master' from 55a8445b0b to 9dac995e36. ~~ 030e563 Eric Dobson 2012-06-17 22:14 : | Make TR compile cleanly with contracts enabled. | | Added a couple of contracts and fixed some others up as well. | The two bugs wer

Re: [racket-dev] [plt] Push #24974: master branch updated

2012-07-11 Thread Neil Toronto
. We need a more scalable way to include these things. Check Syntax should go away (and it will when online check syntax is done), for example. Robby On Wed, Jul 11, 2012 at 12:34 PM, Neil Toronto wrote: I would hate to hide a nifty new tool away in a menu item. How about using narrower text on

Re: [racket-dev] [plt] Push #24974: master branch updated

2012-07-11 Thread Neil Toronto
for where this should go. Robby On Wed, Jul 11, 2012 at 11:40 AM, Vincent St-Amour wrote: At Wed, 11 Jul 2012 09:37:19 -0700, Neil Toronto wrote: On 07/11/2012 09:25 AM, stamo...@racket-lang.org wrote: 84feb38 Vincent St-Amour 2011-10-11 14:26 : | Enable performance report no matter the l

Re: [racket-dev] [plt] Push #24974: master branch updated

2012-07-11 Thread Neil Toronto
Excellent! On 07/11/2012 09:25 AM, stamo...@racket-lang.org wrote: 84feb38 Vincent St-Amour 2011-10-11 14:26 : | Enable performance report no matter the language. : M collects/typed-racket/optimizer/tool/tool.rkt | 21 +++-- I can't tell from the overall diff. Does that also

Re: [racket-dev] [plt] Push #24958: master branch updated

2012-07-10 Thread Neil Toronto
I've been looking forward to trying this since I read your paper draft last night. I didn't expect it so soon, though! Neil ⊥ On 07/10/2012 09:01 AM, jamesswa...@racket-lang.org wrote: jamesswaine has updated `master' from 48e154e3cb to dbec8765e3. http://git.racket-lang.org/plt/48e154e3cb.

Re: [racket-dev] Release for v5.3 is about to begin

2012-07-09 Thread Neil Toronto
On 07/09/2012 06:54 PM, Eli Barzilay wrote: [But if your main concern is sharing work, then you can just as well go with a GH fork, and either make a nice single commit when it's ready, or push your commits in a single batch.] Ha! Thanks for reminding me that I DO have a git server out there s

Re: [racket-dev] Release for v5.3 is about to begin

2012-07-09 Thread Neil Toronto
On 07/09/2012 06:48 PM, Eli Barzilay wrote: 30 minutes ago, Neil Toronto wrote: I suppose this means it's a bad time for the initial commits for the `math' library. :D As long as it's new code, there's no problem. It's unfinished and undocumented, and lacks seriou

Re: [racket-dev] Release for v5.3 is about to begin

2012-07-09 Thread Neil Toronto
I suppose this means it's a bad time for the initial commits for the `math' library. :D I'd like to make `math/array' accessible to Jens Axel so he can start on the linear algebra parts. What are my options? Neil ⊥ On 07/09/2012 01:24 PM, Ryan Culpepper wrote: The release process for v5.3 w

Re: [racket-dev] Custom write that pretty-prints and works well with quote?

2012-07-09 Thread Neil Toronto
ake-tentative-pretty-print-output-port' from `racket/pretty' help? At Sat, 07 Jul 2012 11:40:49 -0700, Neil Toronto wrote: I've got an array structure like so: (struct: (A) strict-array ([shape : (Listof Index)] [data : (Vectorof A)]) Say I have thi

Re: [racket-dev] Overly general types for mutable containers

2012-07-08 Thread Neil Toronto
On 07/07/2012 10:28 PM, Sam Tobin-Hochstadt wrote: On Sun, Jul 8, 2012 at 12:58 AM, Neil Toronto wrote: It runs directly counter to what I expect from immutable containers, which I use most of the time: This is the problem. Immutable containers are very different from mutable ones, and your

[racket-dev] Overly general types for mutable containers

2012-07-07 Thread Neil Toronto
#lang typed/racket (define: x : Index 1) (: bar ((Vectorof Index) -> (Vectorof Index))) (define (bar xs) xs) (: foo (All (A) ((Vectorof Index) -> (Vectorof Index (define (foo xs) xs) So we have an Index `x' and a couple of identity functions `bar' and `foo' that only differ by the fact t

Re: [racket-dev] math

2012-07-07 Thread Neil Toronto
On 07/07/2012 01:39 PM, Matthias Felleisen wrote: Neil, do you intend to provide differentiat and integrate and possibly > adjoin operations on operators from your math collection? I've considered numerical differentiation and integration. If you want them, I'll make sure they (eventu

[racket-dev] Custom write that pretty-prints and works well with quote?

2012-07-07 Thread Neil Toronto
I've got an array structure like so: (struct: (A) strict-array ([shape : (Listof Index)] [data : (Vectorof A)]) Say I have this value: (strict-array '(2 2) #(1 2 3 4)) I want it to print like this at the REPL: # If there's not enough room, I want this:

Re: [racket-dev] A very listy Typed Racket Integer

2012-07-06 Thread Neil Toronto
On 07/06/2012 09:11 AM, Sam Tobin-Hochstadt wrote: On Fri, Jul 6, 2012 at 11:59 AM, Neil Toronto wrote: Anticipating a bug fix, I've started converting my recent TR code so that it doesn't define predicates for mutable container types. Instead of using `define-predicate', I nee

Re: [racket-dev] A very listy Typed Racket Integer

2012-07-06 Thread Neil Toronto
On 07/05/2012 05:54 PM, Sam Tobin-Hochstadt wrote: On Jul 5, 2012 8:50 PM, "Neil Toronto" mailto:neil.toro...@gmail.com>> wrote: > > (define-predicate boxof-integer? (Boxof Integer)) This is the bug -- there's no way to write the boxof-integer? predicate, and define

[racket-dev] A very listy Typed Racket Integer

2012-07-05 Thread Neil Toronto
I just found this today: #lang typed/racket (define: b : (Boxof Any) (box 4)) (define-predicate boxof-integer? (Boxof Integer)) (define (set-b-box! v) (set-box! b v)) (: a-very-listy-integer (-> Integer)) (define (a-very-listy-integer) (cond [(boxof-integer? b) (set-b-box! '(1 2 3))

Re: [racket-dev] Sublinear functions of superfloat numbers

2012-07-03 Thread Neil Toronto
Perfectly good summary, my good man. Anyway, I've decided to regard `log' (with huge rationals) and `sqrt' (with perfect squares) as anomalies, because I'm finding more examples that don't work. Here's one: > (real->double-flonum (/ #e1e400 #e1e200)) 1e+200 > (/ #e1e400 1e200) +inf.0 So it a

Re: [racket-dev] Sublinear functions of superfloat numbers

2012-07-01 Thread Neil Toronto
How about more words and examples? "Argument reduction" is using function properties to reduce the magnitude of arguments to make computation more tractable or more accurate. I'll bet `log' uses this property: (log (sqrt x)) = (log (expt x 1/2)) = (* 1/2 (log x)) This form is nice for do

[racket-dev] Using licensed code

2012-06-30 Thread Neil Toronto
I'm cribbing from the Boost C++ libraries [*] for much of the `math' collection. The license is extremely liberal, requiring only that the text of the license be included in any source distribution. What's the protocol for this? FWIW, the FSF says Boost libraries and works derived from it can

[racket-dev] Sublinear functions of superfloat numbers

2012-06-30 Thread Neil Toronto
I've noticed something interesting about the `log' function. Check out this interaction: > (real->double-flonum #e1e400) +inf.0 > (log #e1e400) 921.0340371976183 It's obviously not just converting to flonum first; it's likely doing some kind of argument reduction internally. `sqrt' operates

Re: [racket-dev] [plt] Push #24933: master branch updated

2012-06-29 Thread Neil Toronto
Yay! On 06/29/2012 02:28 PM, stamo...@racket-lang.org wrote: stamourv has updated `master' from 9e97ea4cae to 1d43b5a0db. http://git.racket-lang.org/plt/9e97ea4cae..1d43b5a0db =[ One Commit ]= Directory summary: 100.0% collects/typed-

Re: [racket-dev] math collection [was: Hyperbolic functions]

2012-06-28 Thread Neil Toronto
On 06/28/2012 01:52 PM, Robby Findler wrote: One more comment (even tho I promised not (and even worse this is a kind of repetition)): I think it is easy to fall into the trap of thinking "well, I want to limit access to this because I know that X writes this code and thus can I can be sure that

Re: [racket-dev] math collection [was: Hyperbolic functions]

2012-06-26 Thread Neil Toronto
I haven't got a clue what you two are arguing about anymore. If you both stop, maybe Sam can implement that perfectly safe change to the typed -> untyped contract barrier that he said he could do. That would be nice. ;) Neil ⊥ On 06/26/2012 09:23 PM, Robby Findler wrote: On Tue, Jun 26, 2012

Re: [racket-dev] math collection [was: Hyperbolic functions]

2012-06-26 Thread Neil Toronto
7 PM, Robby Findler wrote: In this case, the contract could turn into a dependent one with the same semantics. Does it make sense for TR to allow a user to declare the equivalent contract? Robby On Tue, Jun 26, 2012 at 7:17 PM, Neil Toronto wrote: Ten minutes in, I've hit a snag. I'd

Re: [racket-dev] math collection [was: Hyperbolic functions]

2012-06-26 Thread Neil Toronto
Ten minutes in, I've hit a snag. I'd like the stuff in math/functions to have precise types. For example, log1p could have the type (case-> (Zero -> Zero) (Float -> Float) (Real -> Real)) It was easy to get the implementation to typecheck, but when I tried to plot it in u

Re: [racket-dev] Hyperbolic functions

2012-06-26 Thread Neil Toronto
With these two votes, it's official. I'll make it one of my vacation projects. Neil ⊥ On 06/26/2012 03:00 PM, Doug Williams wrote: Doug is for any of it. I'd love to get some student projects that move the science collection to TR. On Tue, Jun 26, 2012 at 1:42 PM, Matthias Felleisen wrote:

Re: [racket-dev] Hyperbolic functions

2012-06-26 Thread Neil Toronto
On 06/26/2012 08:04 AM, Jens Axel Søgaard wrote: Just in case: They are available in the Science Collection: They are - Doug's done good work. I'd convert those to TR, check TR's optimizations, and harden them if they need it (especially near 0.0 and +/-inf.0). Also, I have a few not in Doug'

Re: [racket-dev] Hyperbolic functions

2012-06-25 Thread Neil Toronto
On 06/24/2012 10:40 AM, Antonio Menezes Leitao wrote: Hi, Given that Racket implements the hyperbolic functions sinh, cosh, and tanh, I would like to suggest that it also provides the inverse functions asinh, acosh and atanh. For the moment, I'm living with my own definitions but it would be ni

Re: [racket-dev] Error message structure (error-message overhaul)

2012-06-19 Thread Neil Toronto
On 06/19/2012 06:11 PM, Eli Barzilay wrote: * There are two contexts where error messages are unwieldy: TR and contract errors. In both of these the error text is huge to the point of making a useless text that you need to manually grep through. In TR it got bad enough that Vi

Re: [racket-dev] Single-flonum-ness not preserved in racket/math functions

2012-06-05 Thread Neil Toronto
On 06/05/2012 03:57 PM, Vincent St-Amour wrote: At Tue, 05 Jun 2012 15:45:09 -0600, Neil Toronto wrote: Vincent, is there a quick way for me to test whether the types I give the new functions are sound? I recently added redex-based random testing for TR's float types. It's in coll

[racket-dev] Single-flonum-ness not preserved in racket/math functions

2012-06-05 Thread Neil Toronto
I'm currently adding degrees->radians, radians->degrees, exact-round, exact-floor, exact-ceiling, exact-truncate, nan?, and infinite? to racket/math. (Along with docs and test cases, of course.) When I started to add their types to Typed Racket's base environment, I found that some of the exis

Re: [racket-dev] Code micro-level organization

2012-05-31 Thread Neil Toronto
On 05/30/2012 03:40 PM, Eli Barzilay wrote: Now, lets imagine that instead of a simple `<>' hole, there are two kinds of holes with an "up" or a "down" direction -- this leads to this kind of a syntax: (○ "foo bar baz" (substring ↑ 3 8) (string-trim ↑) (let ([str ↑]) ↓)

Re: [racket-dev] [plt] Push #24770: master branch updated

2012-05-29 Thread Neil Toronto
llects/images/private/ 40.2% collects/images/scribblings/ 6.9% collects/images/ ~~ c7bea1d Neil Toronto 2012-05-29 17:50 : | images/flomap: public interface to floating-point bitmaps used by ray tracer : A collects/images/flomap.rkt M collects/images/icons/arrow.rkt

[racket-dev] Custom write for flvector?

2012-05-28 Thread Neil Toronto
Would it break anything to have flvectors print nicely? For example: > (flvector 1.0 2.0 3.0) (flvector 1.0 2.0 3.0) I've been working on publicizing/documenting the floating-point bitmaps module used internally in `images'. I realized that flvectors are the right data type for sending/receivi

Re: [racket-dev] error-message overhaul

2012-05-25 Thread Neil Toronto
New error format: +2 Changing my code: -1 Overall, +1. :D Should we have a Big Push to convert error message call sites, starting with actively maintained code? Neil ⊥ On 05/26/2012 06:09 AM, Matthew Flatt wrote: I've pushed a first cut at overhauling error messages from `racket/base'. The

Re: [racket-dev] match syntax-parse

2012-05-11 Thread Neil Toronto
On 05/11/2012 07:45 AM, stefan.israels...@se.abb.com wrote: 2. I must say that syntax-parse rocks and I would suggest that we implement the racket matcher completely with syntax parse. To see how it can look like consider looking at the file at, http://gitorious.org/guile-syntax-parse/guile-synt

Re: [racket-dev] A few suggestions on indentation and DrRacket graphical syntax

2012-05-11 Thread Neil Toronto
On 05/09/2012 02:18 AM, Laurent wrote: From the guide: "Caveat 1: Until language specifications come with fixed indentation rules, we need to use the default settings of DrRacket’s indentation for this rule to make sense." Maybe a special submodule like drracket-indentation with declarations li

Re: [racket-dev] Very quick poll re `string-trim'

2012-05-11 Thread Neil Toronto
I would say yes. Isn't this primarily a string function? How about a #:repeated? argument that defaults to #t? Neil ⊥ On 05/11/2012 08:38 AM, Matthias Felleisen wrote: The question you need to ask is whether you want string-trim to be usable by someone who is not familiar with our syntax (or

Re: [racket-dev] [plt] Push #24346: master branch updated

2012-02-25 Thread Neil Toronto
If you want to test picts in the REPL with a lot of stuff to draw, use `plot-pict' and `plot3d-pict'. For example, this one draws thousands of polygons and lines: (plot3d-pict (isosurfaces3d (compose abs max) -1 1 -1 1 -1 1)) That one currently makes the REPL pretty unresponsive. Maybe pai

Re: [racket-dev] [plt] Push #24346: master branch updated

2012-02-25 Thread Neil Toronto
This is nifty. What do you plan to do with it? Neil ⊥ On 02/25/2012 02:22 PM, mfl...@racket-lang.org wrote: mflatt has updated `master' from 678941ce5a to 645ca02e92. http://git.racket-lang.org/plt/678941ce5a..645ca02e92 =[ 1 Commits ]

Re: [racket-dev] Possible promotional poster (with apologies to Matthias)

2012-02-19 Thread Neil Toronto
Beat me to it. +2 On 02/19/2012 01:26 PM, Jay McCarthy wrote: Awesome On Sun, Feb 19, 2012 at 10:47 AM, Eli Barzilay wrote: Just now, Matthias Felleisen wrote: On Feb 19, 2012, at 12:42 PM, Matthias Felleisen wrote: Or, with the Matthias theme: I want YOU to build your own language [1]

Re: [racket-dev] new logo

2012-02-18 Thread Neil Toronto
On 02/18/2012 08:49 PM, Eli Barzilay wrote: An hour ago, Neil Toronto wrote: That's why after several attempts to connect the paren to the rest of the "R" I went back to Michael's original thing and left it disconnected, and instead used the pointy serifs that match the poin

Re: [racket-dev] Possible promotional poster (with apologies to Matthias)

2012-02-18 Thread Neil Toronto
On 02/18/2012 01:16 PM, Eli Barzilay wrote: Three hours ago, Neil Toronto wrote: [...] www.racket-lang.org Please make it just "racket-lang.org". Ah. That's where the logo goes, when we settle on one. You're a friggin' genius. Neil ⊥

Re: [racket-dev] new logo

2012-02-18 Thread Neil Toronto
I've attached my entry into the "lambda + R" prototype series. I went for symmetry on the lambda body, mimicked the round part of the Times New Roman "R", and compromised as little as possible on the angle of the left leg. This is a very tricky logo idea, FWIW. The left-leg angle is always har

Re: [racket-dev] Possible promotional poster (with apologies to Matthias)

2012-02-18 Thread Neil Toronto
On 02/18/2012 09:35 AM, Robby Findler wrote: On Sat, Feb 18, 2012 at 10:23 AM, Neil Toronto wrote: Another angle: what aspects of Racket do we want to advertise? Language building. Definitely. I like Sam's idea on this one. I want a hi-res picture of Matthew, pointing at the viewer

Re: [racket-dev] Possible promotional poster (with apologies to Matthias)

2012-02-18 Thread Neil Toronto
On 02/18/2012 09:03 AM, Matthew Flatt wrote: At Sat, 18 Feb 2012 08:56:22 -0700, Neil Toronto wrote: Jay had a cool idea to make propagan--er, promotional posters. The attached SVG isn't the style Jay wanted (like the Obama "Hope" posters) but I kinda like it. I

[racket-dev] Possible promotional poster (with apologies to Matthias)

2012-02-18 Thread Neil Toronto
Jay had a cool idea to make propagan--er, promotional posters. The attached SVG isn't the style Jay wanted (like the Obama "Hope" posters) but I kinda like it. It's here: http://students.cs.byu.edu/~ntoronto/matthias-poster.svg Comments and criticisms? I'm not sure where to put the PLT logo.

Re: [racket-dev] new logo

2012-02-15 Thread Neil Toronto
On 02/15/2012 12:21 PM, John Clements wrote: On Feb 15, 2012, at 10:24 AM, Michael W wrote: I'm no graphics designer but I've been playing with Eli's logo a bit. I went gradient-happy; sorry. Here it is with a silvery sheen: http://dl.dropbox.com/u/219506/racket-logo/whitesilver-subtle.png L

Re: [racket-dev] new logo

2012-02-14 Thread Neil Toronto
I decided to play with this one a bit. I used PLT's lambda, put the "r" in the same style, and then made it into a "lambda r.acket" banner. Here's the deal, though. This one, even just the "lambda r." in a circle, is pushing complexity. We've been approaching logo design too much like language

Re: [racket-dev] new logo

2012-02-14 Thread Neil Toronto
So do I. Ending it with a dot makes it feel like an unfinished program to me, parameterized on a Racket. Neil ⊥ On 02/13/2012 10:03 AM, Matthias Felleisen wrote: I do actually like the combination of lambda and r, though I am sure the color scheme could benefit from some variation. On Feb

Re: [racket-dev] new logo

2012-02-12 Thread Neil Toronto
On 02/12/2012 05:58 PM, Robby Findler wrote: On Sat, Feb 11, 2012 at 6:49 PM, Neil Toronto wrote: (Robby already said "no" to animations, but he has to do what you say, right? :p) For the record, I don't oppose animations. I said that privately in a series of messages to John

Re: [racket-dev] new logo

2012-02-12 Thread Neil Toronto
On 02/12/2012 01:04 PM, Eli Barzilay wrote: 20 minutes ago, Vincent St-Amour wrote: At Sun, 12 Feb 2012 11:01:44 -0800, John Clements wrote: I like this general idea. It seems to me that we're headed toward some kind of translucent ball with bands around it. If the sideways band is more visibl

Re: [racket-dev] new logo

2012-02-11 Thread Neil Toronto
On 02/11/2012 11:40 AM, Matthias Felleisen wrote: On Feb 11, 2012, at 1:27 PM, John Clements wrote: Would it be productive to choose one randomly on startup? Also, in case it's not obvious, a rotated and flipped version of the logo does recall the lambda pretty clearly: Re-rendering the i

<    1   2   3   4   >