Open certik opened 2 years ago
This should now be possible with overload
decorator.
This particular case can be. We still need generics/templates.
The overload in a sense is a subset of generics: you provide specific implementations ahead of time. The templates do not provide specific implementations, the compiler instantiates them.
Was this picked up by any person? Or is it still open for contribution?
Yes, it's still open. We have quite solid generics in libasr thanks to LFortran, and we should hook them into LPython.
Hi, I'm doing more research into this. I found some generics implemented in GSoC 2022. I'd just appreciate if there were more details on which generics have higher priority or where to start
They are implemented in LFortran, you can start here: https://docs.lfortran.org/en/asr/generics/.
We need to allow writing generic functions (templates) and template constraints.
One idea that we can explore is to also support something like: https://github.com/lcompilers/lpython/pull/152#issuecomment-1047082741: