I use typed racket in production too, and I also heavily use Scribble on
the same source codebase.

Here is my requirement that not so important:
(exn:break:hang-up) and (exn:break:terminate) are useful in server
application, if I (typed/require) them in the a common rkt and this file is
also (require)ed by scribble (which is untyped), then it will complains
that they are already required. So can you make these two structs available
in typed racket? Thanks.

On Sun, Feb 21, 2016 at 12:12 PM, Benjamin Greenman <
benjaminlgreen...@gmail.com> wrote:

> Hi Piyush,
>
> Is it viable to use typed racket for production use ?
>>
>
> At least 3 people are using Typed Racket in production:
> -
> https://groups.google.com/forum/#!searchin/racket-users/typed$20racket|sort:date/racket-users/rfM6koVbOS8/JHaHG03cCQAJ
> - https://www.youtube.com/watch?v=QoYJfA7cq2I
> - https://twitter.com/ID_AA_Carmack/status/695702976745381889
>
>
>
>> is it entirely different language ?
>>
>
> Nope. Typed Racket's main design goal is to support the features of
> untyped Racket. You should be able to convert a #lang racket program to a
> #lang typed/racket program only by adding type annotations.
>
> Disclaimer: the type system is very expressive, but doesn't do much type
> inference. So may need to write a lot of annotations, for example
>
> (map (lambda ([v : (U 'cats 'dogs Natural)]) ...) '(9 cats 8 dogs))
>
> (for/fold : (U #f Integer)
>
>           ([biggest : (U #f Integer) #f])
>
>           ([i (in-list '(1 2 3 4))])
>
>   (if biggest
>
>     (max biggest i)
>
>     i))
>
>
> But we're always trying to improve.
>
>
>
>> how much extra speed/performance we achieve compare to plain racket ?
>>
>
> You can expect modest runtime improvements if your whole program is
> written in Typed Racket. Probably 5-10%, but I've seen 30% for a program
> that made lots of vector accesses. Arithmetic can get much faster too.
> Clicking the optimization coach button in Dr. Racket will find places where
> the optimizer might be able to do more with the types.
>
> (Compile times will be slower, though)
>
>
> Does it support all open source libs ?
>>
>
> You can use any Racket library in Typed Racket if you give a
> `require/typed` annotation that matches your use-case:
>
> (require/typed
>
>   [serialize (Any -> Any)]
>
>   [deserialize (Any -> (HashTable Symbol (List Integer)))])
>
>
> One thing to keep in mind: these type annotations are checked at runtime,
> so each call to deserialize will be a little slower to make sure it really
> gives a hashtable with the right values inside. The slowdowns can add up in
> surprising ways, but we're working on that too.
>
>
> Hope you'll try Typed Racket. We're happy to answer questions here or on
> the #racket IRC channel.
>
>
> --
> 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.

Reply via email to