Pouya Kary's Archive
2019-05-25 ┬ 1398/03/04
ANNO VICESIMO TERTIO DIE CENTESIMO TRICESIMO SEPTIMO VITAE POUYAE
Internals of @sugarpine

Internals of @sugarpine (1/6): Here the debugger parses the input and the type checker states no such overload is there for the given operation.

Internals of @sugarpine

Internals of @sugarpine (2/6): However, when the overload is found, compiler is able to fully generated the typed AST.

Internals of @sugarpine

Internals of @sugarpine (3/6): Internals of the system had a really beautiful structure. Here you could define the arguments it took and their types. The reason for this design is that these are named parameters in the Pine Script and therefore they could have any precedence.

Internals of @sugarpine

Internals of @sugarpine (4/6): And doing so you could even have union types.

Internals of @sugarpine

Internals of @sugarpine (5/6): And it was quite simple to define overloads.

Internals of @sugarpine

Internals of @sugarpine (6/6): And here it was all the overload signatures of the operation addition.