12 ms·
How would you suggest a typical run-of-the-mill object-oriented programmer go about learning such a methodology? Most of the links in that article are dead.
by Styx- 10y ago
How would you suggest a typical run-of-the-mill object-oriented programmer go about learning such a methodology?
Most of the links in that article are dead.
- sklogic 10y ago> How would you suggest a typical run-of-the-mill object-oriented programmer go about learning such a methodology? That's exactly what's wrong with this thoroughly broken industry. They should not have learned this awful religion in the first place. Now it's much harder to unlearn and re-learn from scratch than learn it without ever being exposed to the wrong ways. This methodology is far, far easier than anything OOP (the latter cannot even be defined comprehensively), and if you learn it first you can become productive much quicker than if you go the typical OO way. And the most important feature of this methodology is that it's far more accessible. You don't need to be smart to use it. No need to memorise dozens of "design patterns" and all that. No need to invent complex twisted designs, trying to cram as many patterns as possible into a trivial task. DSL-based approach is very straightforward and mechanical, and can be executed by practically anyone who managed to learn how to read and write (i.e., around 95% of the population).
- klibertp 10y ago> DSL-based approach is very straightforward and mechanical, and can be executed by practically anyone who managed to learn how to read and write (i.e., around 95% of the population). I mostly agree with your comments, but here I think you're underestimating the difficulty of creating a good DSL way too much. It's like saying that anyone who managed to learn to read and write can create Esperanto. Also, being able to read and write does not guarantee the ability of clearly expressing one's thoughts. Without this crucial skill inventing a DSL is an exercise in frustration, both for the original author and later for the poor users of such a DSL. And one more thing: you can create (internal) DSLs in almost all existing languages, by (ab)using their syntax and semantics. Smalltalk and Ruby are quite happy with their many DSLs, despite being an OO language. As for GP: > How would you suggest a typical run-of-the-mill object-oriented programmer go about learning such a methodology? See Avail: https://klibert.pl/output/avail-and-articulate-programming.html https://klibert.pl/output/avail-and-articulate-programming.h... Then learn Scala, Ruby, Elixir, Racket, Smalltalk, F#, Elm, Haskell. They all make use of DSLs and contain many examples of well-designed eDSLs. After that, go read a bit on language design and compiler construction and you're done.
- sklogic 10y ago> you're underestimating the difficulty of creating a good DSL way too much. I'm doing this for living, and I can't stop wondering at how laughably easy it is. The method is very simple: * describe the problem in plain English (maybe with some diagrams) * iterate it a few times until you have a syntax you think is unambiguous enough * strip this syntax from all the sugar you just introduced in order to define an AST * find DSLs in your toolbox that are potentially close to the one you're building and cherry-pick the necessary language components from them * write a sequence of very simple transforms that would lower your source AST into a combination of the parts of the ASTs of the target DSLs of your choice * Done. An efficient DSL compiler is ready, with a language designed as closely to your current view of the problem domain as possible. * If you later find that your DSL is inadequate and your understanding of the domain was insufficient, than just start over again, this entire process is so cheap and simple that it does not really matter. > ability of clearly expressing one's thoughts. This is crucial indeed, but not having such a skill is a functional illiteracy. Current estimation of the functionally illiterate population in the first world countries is from 5 to 10%. The remaining numbers are sill much higher than the percentage of people who are capable of understanding OOP. > you can create (internal) DSLs in almost all existing languages, by (ab)using their syntax and semantics. But in order to do this you need to be smart (or smart-assed). It's a hack, and hacks are bad. OTOH, macro-based DSL implementation is purely mechanical and does not involve any thinking at all.
- another_user 10y agoawesome! (and sounds totally intuitive and obvious, not like a trick, but like a proper methodology, proper approach, never had this feeling of before) thank you for info! will try to dig in
- Styx- 10y agoBTW, are you /u/combinatorylogic on Reddit? Just guessing because of the (potential) serendipity.