Re:The type system is a programmer's best friend
by throwaway2037 on Sunday November 06, 2022 @03:36AM
(#33490477)
Can you provide a concete example? If you do, I am sure Rust/C++/C/Java/C# programmers can show you how to implement in their language.
[ Parent
| on HN ]
Re:The type system is a programmer's best friend
by maxbond on Sunday November 06, 2022 @08:19PM
(#33499829)
Not GP, but for instance, Python web frameworks are oriented around decorators, and Rust web frameworks are oriented around macros. The syntax looks pretty similar, but like GP says, in dynamic languages you're using a (higher order) function, and in static languages you're using code generation for the same purpose.
Re:The type system is a programmer's best friend
by throwaway2037 on Tuesday November 08, 2022 @09:12AM
(#33519123)
I am confused. "Code gen" is a fuzzy concept once you have a virtual machine because you can do it at runtime. This is how mocking works in Java and C#. What you describe already exists in Java and C# -- decorators for web frameworks. I would not describe Java nor C# as dynamic. I describe them as "stricter" (types) and Python as "weaker" (types). To quote Norman Ramsey: "Every time I see a question about "strong" or "weak" typing, I kill a kitten." :-)