johnynek / bosatsu

A python-ish pure and total functional programming language
Apache License 2.0
224 stars 11 forks source link

parallel type checking #1044

Closed johnynek closed 6 months ago

johnynek commented 11 months ago

When we see a let x = y in z if we have a type annotation on x, we can check both y and infer z in parallel.

Even if we don't use parallel processing here, we can report both errors instead of just one. So, if let x: Foo = y in z if y doesn't type check as Foo we fail currently without checking anything for z, but we don't have to. We can assume the type of x is Foo and also report any errors in z.

A similar issue comes up when you have a series of lets and the next items may not depend on the previous:

x = foo
y = bar
z = baz
f(x, y, z)

In this example, even without a type annotation, we could potentially collect all the errors on x, y, z before going on to f(x, y, z).

johnynek commented 6 months ago

this was closed by #1046 and later PRs. It's not parallel in terms of CPU, but parallel with error reporting.