david
MModular
•Created by david on 10/2/2023 in #questions
Will Mojo solve the Expression Problem?
As a software developer I want to apply Solid Design Principles to Mojo.
The open closed principle states that software entities should be open for extension but closed for modification.
In case of OOP operations are fixed but new types are introduced through vertical extension(inheritance)
In functional programming types can be fixed and new operations are introduced through horizontal extension(pattern matching)
Depending on the problem domain one over the other can be better for example if a compiler has fixed types and always new operations should be introduced on these types pattern matching might be better.
This would make Visitor pattern part of the language.
There is also I think a approach with Typeclasses in Haskell, which allows extension easily in both directions without violating ocp ,thus tries to solve the expression problem.
43 replies
MModular
•Created by david on 9/29/2023 in #questions
Will Mojo Metaprogramming support Lisp/Julia Style Macros?
As Paul Graham is describing in http://www.paulgraham.com/avg.html Lisp let you abstract things with macros which can’t still be easily abstracted in current popular languages. If this would be realized in Mojo, we could write less Code and be even more productive.
41 replies