vapourlang / vapour

Typed superset of R
http://vapour.run
Apache License 2.0
169 stars 2 forks source link

Type casting? #73

Open ElianHugh opened 4 days ago

ElianHugh commented 4 days ago

Sorry for opening so many issues -- this is a very exciting project :)

From what I understand with vapour, there's a plan to generate types for a lot of R, but that understandably wouldn't be feasible for every package and function. So, I suppose that either functions are imported as any typed, or you have to define types like in a types.d.ts file. Is my understanding correct?

In typescript, you can use the as keyword to tell the type checker a variable is a specific type. Is this something that might be useful for vapour? Maybe a different form because of the name collision with as.xyz()...

JohnCoene commented 4 days ago

I didn't really think about type casting but it's probably something that should be added

I hope to start looking at lexing, and parsing R to see how difficult this type inference will be exactly (I suspect very).