Question

Whether this question is a wide range or not I would like to ask : Is it possible to implement aspect-oriented programming (AOP) features into OCaml language?

Was it helpful?

Solution

It is interesting to observe that, in contrast to the traditional concept of crosscutting in the OO setting where aspects typically crosscut several classes, the majority of the applications of aspects in functional programming only involve a single function in the pointcut. We believe the realisation of this difference as concluded by this paper is important to both the functional and AOP commu- nity. There is a pressing need to properly interpret and develop of the concept of ‘crosscutting’ in the functional setting before functional AOP spreads its wings. [emphasis mine]

What Does Aspect-Oriented Programming Mean for Functional Programmers? (PDF)

Regardless, there are direct attempts/translations of AOP to OCaml or ML systems. From my comment, I don't find these convincing, and believe that proper use of modules and functors can do a lot to capture the demarcation of concerns. Those direct attempts are,

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top