Re:What can we learn from how compilers are designed?
by skybrian on Friday March 16, 2018 @08:54PM
(#16605027)
If you want to avoid OO you'll also want to avoid treating functions as first-class values. As soon as you have structs that contain functions, you can build OO.
[ Parent
| on HN ]
Re:What can we learn from how compilers are designed?
by adrianN on Saturday March 17, 2018 @02:48AM
(#16605876)
OO is a way of designing programs. You can avoid it in most languages if you want to and you can do it in most languages if you want to. The language only determines the amount of boilerplate you need.
Re:What can we learn from how compilers are designed?
by skybrian on Friday March 16, 2018 @11:53PM
(#16605526)
Since I'm getting downvoted:
Folks, this is Chapter 3 of Structure and Interpretation of Computer Programming. Technically you don't even need a struct; closures and mutability will do.
And how do you serialize data that function pointers in it?
Re:What can we learn from how compilers are designed?
by coldtea on Saturday March 17, 2018 @10:35AM
(#16607109)
You're not downvoted because people ignore that fact. You are downvoted because people disagree that it's important.
Yes, you can create objects with closures, but when people talk against OO programming, they mean the paradigm, not merely the possibility that a language can do objects. Forth and C can do object oriented programming just fine too, if one is so inclined.
Re:What can we learn from how compilers are designed?
by HumanDrivenDev on Saturday March 17, 2018 @01:48AM
(#16605756)
I am almost positive Rich Hickey hasn't read that book. The only thing more stunning than his ignorance when he talks about OO is the amount of young programmers who believe everything he says.
It blew my mind when I realised I could write objects from scratch in languages with closures, even statically typed ones! Of course each object has its own v-table in the SICP code, so probably not something you should use in production.