News for hackers. Stuff that matters.
Re:Macropy: Syntactic Macros for Python by nubela on Saturday May 16, 2020 @09:46AM (#23203328)
Other than `@case`, are there other examples of macropy macros?? @case means nothing to me.
Re:Macropy: Syntactic Macros for Python by dhash on Saturday May 16, 2020 @10:51AM (#23203830)
Lihaoyi mostly authors scala libraries. I switched from python to scala and found many of the things that I love about scala ported to python with this library.

Case classes (pretty .toString, structural equality, .copy, and destructuring), Scala 3-esque enums, f-string interpolations before python added them, pattern matching, and _ based lambdas are the highlights for me.

Re:Macropy: Syntactic Macros for Python by lihaoyi on Saturday May 16, 2020 @10:37AM (#23203702)
The page has links to a dozen different examples, with code snippets and discussion of the motivations and potential use cases for each
Re:Macropy: Syntactic Macros for Python by sitkack on Saturday May 16, 2020 @12:12PM (#23204651)
Totally off topic, but I was wondering if you have looked at Coconut, a kind of ML Lite that compiles to Python? And if so, what do you think?

http://coconut-lang.org/

Are you still mainly programming in Scala? Do you see yourself programming in your current language in 5 years?

Re:Macropy: Syntactic Macros for Python by anentropic on Saturday May 16, 2020 @12:16PM (#23204702)
This project is great

Would love to see a new release on PyPI that works with Python > 3.4

;)

(last release seems to be "1.1b2" in 2018...)

Re:Macropy: Syntactic Macros for Python by carver on Saturday May 16, 2020 @10:18AM (#23203552)
Tail call optimization is appealing. Sometimes recursion is the cleanest implementation, but call depth is not known up front.
Re:Macropy: Syntactic Macros for Python by memco on Saturday May 16, 2020 @10:39AM (#23203723)
I’m having a hard time understanding what advantages @case has over data classes.
Re:Macropy: Syntactic Macros for Python by lihaoyi on Saturday May 16, 2020 @10:42AM (#23203757)
The main reason @case is an example macro is that data classes did not exist when this project was conceived