When I started learning computer languages in 1980 (I started with Commodore C64 Basic, later it was Turbo Pascal, C/C++, Java, Prolog, Haskell, …), I asked myself, why do we need different languages?
Since then, I’ve got used to much more programming paradigms and methods (like imperative, functional, declarative, object oriented, test driven, or agile techniques, …), and I still ask myself, why isn’t there a simple language combining the best out of all of them?
A couple of months ago I started the revival of my never-ending dream to invent a multi paradigm, one-fits-all programming language, and I called it MB0.
In this Blog I’ll keep you informed about the progress and obstacles.
it took me much longer to determine the right functional structure (but this might be due to less experience)
side effects can be handles much easier in C++: in the example it’s necessary to have all agents in one list. The list can be easily build in the C++ constructors, in Haskell one need to add them separately (agents = [producer, modifier, consumer])
C++ is stronger in class polymorphism: defining the parent object (data Agent), all child objects (Producer, Modifier, Consumer) need already be known at parent definition
Code hiding/protection is not possible in Haskell
I do welcome your feedback on both examples! Maybe you have some additional ideas of how to facilitate better some language specialties.
Especially, I am interested in some feedback from an experienced Haskell programmer who might suggest a different approach.