Type strategy for Scheme Lassi Kortela (09 Nov 2022 22:54 UTC)
Re: Type strategy for Scheme Marc Nieper-Wißkirchen (10 Nov 2022 07:07 UTC)
Re: Type strategy for Scheme Marc Nieper-Wißkirchen (10 Nov 2022 07:42 UTC)
Re: Type strategy for Scheme Peter Bex (10 Nov 2022 08:05 UTC)
Re: Type strategy for Scheme Philip McGrath (10 Nov 2022 08:54 UTC)
Re: Type strategy for Scheme Lassi Kortela (10 Nov 2022 09:49 UTC)
Re: Type strategy for Scheme Lassi Kortela (10 Nov 2022 09:08 UTC)
Re: Type strategy for Scheme Marc Feeley (10 Nov 2022 23:34 UTC)
Re: Type strategy for Scheme Lassi Kortela (11 Nov 2022 19:17 UTC)
Re: Type strategy for Scheme Marc Feeley (11 Nov 2022 21:34 UTC)
Re: Type strategy for Scheme Lassi Kortela (12 Nov 2022 21:58 UTC)
Re: Type strategy for Scheme Marc Nieper-Wißkirchen (12 Nov 2022 22:52 UTC)
Re: Type strategy for Scheme Lassi Kortela (12 Nov 2022 23:14 UTC)
Re: Type strategy for Scheme Marc Nieper-Wißkirchen (13 Nov 2022 09:41 UTC)
Re: Type strategy for Scheme Lassi Kortela (13 Nov 2022 11:59 UTC)
Re: Type strategy for Scheme John Cowan (13 Nov 2022 19:52 UTC)
Re: Type strategy for Scheme Lassi Kortela (13 Nov 2022 20:22 UTC)
Re: Type strategy for Scheme Marc Nieper-Wißkirchen (13 Nov 2022 20:35 UTC)
Re: Type strategy for Scheme Lassi Kortela (13 Nov 2022 21:41 UTC)
Re: Type strategy for Scheme Marc Feeley (14 Nov 2022 00:03 UTC)
Re: Type strategy for Scheme Lassi Kortela (14 Nov 2022 09:36 UTC)
Re: Type strategy for Scheme Marc Feeley (14 Nov 2022 16:27 UTC)
Re: Type strategy for Scheme Lassi Kortela (14 Nov 2022 19:58 UTC)
Re: Type strategy for Scheme John Cowan (13 Nov 2022 20:40 UTC)
Re: Type strategy for Scheme Marc Nieper-Wißkirchen (13 Nov 2022 20:42 UTC)
Re: Type strategy for Scheme Panicz Maciej Godek (20 Nov 2022 21:59 UTC)
Re: Type strategy for Scheme Per Bothner (20 Nov 2022 22:58 UTC)

Re: Type strategy for Scheme Philip McGrath 10 Nov 2022 08:52 UTC

On Thu, Nov 10, 2022, at 3:05 AM, Peter Bex wrote:
> On Thu, Nov 10, 2022 at 08:42:20AM +0100, Marc Nieper-Wißkirchen wrote:
>> PS Trying to find types of the following should also be done when
>> evaluating type systems:
>>
>> (vector 1 'foo '())
>
> And, not to forget, what if you do (vector-set! x 1 "bar") later in the
> program.
>
> Cheers,
> Peter
>

Just to point out the obvious, Sam Tobin-Hochstadt's PhD thesis is titled "Typed Scheme": https://www2.ccs.neu.edu/racket/pubs/dissertation-tobin-hochstadt.pdf

I don't know all of the history, but my understanding is that it builds on several previous attempts to add types to Scheme.

The implementation is the `#lang typed/scheme` language, a variant of the PLT `#lang scheme` language: https://docs.racket-lang.org/ts-reference/Compatibility_Languages.html

The project has become Typed Racket, which has an introductory Guide <https://docs.racket-lang.org/ts-guide/> and a reference manual <https://docs.racket-lang.org/ts-reference/index.html>. The upcoming Racket 8.7 release will include Shallow and Optional Typed Racket from Ben Greenman's work: https://racket.discourse.group/t/pre-release-shallow-and-optional-types/1303

Here's a working program:
```
#lang typed/racket
(: x (Vector Natural (U 'foo String) (Listof Real)))
(define x
  (vector 1 'foo '()))
(vector-set! x 1 "bar")
```

-Philip