News for hackers. Stuff that matters.
Re:Stack-Oriented Programming by punkbrwstr on Tuesday January 14, 2020 @09:26PM (#22051268)
The stack-oriented approach can also be used within modern languages to realize the benefits of simplicity and code-reusablility. I created a python package for data analysis that treats a data frame like a stack of columns and lets you manipulate columns using postfix operators: https://github.com/punkbrwstr/pynto
Re:Stack-Oriented Programming by reedwolf on Tuesday January 14, 2020 @10:13PM (#22051478)
Wow, this looks really interesting. Was there any particular reason you decided on this approach?
Re:Stack-Oriented Programming by punkbrwstr on Saturday January 25, 2020 @05:24PM (#22148995)
Building up complicated time series transformations by composing simple functions helps me be sure I'm doing what I think I'm doing. Since the transformations are tacit expressions that don't define specific parameters they are then very easy to re-use and combine. And I have some combinators that can apply the functions in pretty flexible ways. Also, since its all lazy-evaluated on a per-column level I can work with huge tables, but only end up operating on the subset I need.
Re:Stack-Oriented Programming by heavenlyblue on Wednesday January 15, 2020 @01:42PM (#22057050)
How is that more interesting than simple .modify_column(params)?
Re:Stack-Oriented Programming by punkbrwstr on Saturday January 25, 2020 @05:36PM (#22149054)
You definitely could do a similar column-level functional approach that way, but I think the simple syntax of the stack-oriented approach makes it easier to read and catch errors. The code would be a lot longer that way.