On Jul 1, 2015, at 1:13 PM, Neil Toronto <[email protected]> wrote:
> On 07/01/2015 10:47 AM, John Carmack wrote: >> >> S-expressions actually are one of the core wins from my use of lisp so far >> -- embracing read/write (and the associated bandwidth cost) as a wire >> protocol over yet another hand crafted binary format has been a significant >> win (however, the flexibility of the win seems to fight with static typing, >> perhaps at a fundamental level, in my limited typed-racket experience so >> far -- a good topic for discussion?). > > Definitely a good topic for discussion. > > Where do you predict fights with static typing? Or, if it's just a general > feeling based on past experience with static typing, how do you expect to use > it? > > There's every chance that Typed Racket's union types, singleton symbol types, > and occurrence typing will make it fairly easy to type an s-expression-based > wire protocol; e.g. > > (define-type Command (List '<command-name> <arg-types> ...) > (define-type Commands (Pair 'begin (Listof Command))) > (define-predicate valid-commands? Commands) > > At a rough count, I've written more than 100,000 lines of Typed Racket code, > much of which has had to be available to call in untyped Racket without > significant performance loss. I admit that Typed Racket is the only Racket > language that has made me want to throw things, but that's increasingly rare, > it's been much more pleasant than other type systems I've used, and I'm > pleased with the guarantees and increased performance I've gotten from it. Let me add one thought here. One of the thoughts I have played with in this context is to have a dissertation on XML-style type extensions for Typed Racket (CDuce, XDuce). I am not interested in XML (or JSON) per se but in type systems that can say more about S-expression-like data. Of course, as in the past, this would have to be balanced between theoretical expressive power and practical expressiveness/impact. (We tend to err in the direction of the former, because we finance Racket via research grants.) In a way, TR's union-type system ought to make an integration of these ideas simpler. You could then successively refine types of S-expressions and verify more claims about them if this played a role in your program. But as Neil and Tony said, the type system gets in your way with such things, but no longer enough to be annoying. -- Matthias -- 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 [email protected]. For more options, visit https://groups.google.com/d/optout.

