4 ms·
> It's also interesting because this style of API is portable more or less unchanged to just about any programming language, from C# to Idris. Yep I think a de
by krawczstef 4y ago
> It's also interesting because this style of API is portable more or less unchanged to just about any programming language, from C# to Idris.
Yep I think a declarative syntax is quite portable and can be reimplemented easily in other languages.
On the portable note, where portable we mean swapping dataframe implementations, it's even conceivable to write "agnostic" logic with Hamilton and then at runtime inject the right "objects" that then do the right thing at runtime. E.g. the following is polars specific:
col_c = (pl.col('a') + pl.col('b')).alias('c')
I think with Hamilton you could be more agnostic and enable it to run on both Pandas and Polars -- with TYPE here a placeholder to indicate something more generic...
def col_c(a: TYPE, b: TYPE) -> TYPE:
return a + b
So at runtime you'd instantiate in your Driver some directive to say whether you're operating on pandas or with polars (or at least that's what I imagine in my head) and the framework would take care of the rest...