4 ms·
Same for OOP, example from 1988: "Building a backtracking facility in smalltalk without kernel support"[1] Languages like Snobol, Prolog, and Icon were design
by mpweiher 8y ago
Same for OOP, example from 1988:
"Building a backtracking facility in smalltalk without kernel support"[1]
Languages like Snobol, Prolog, and Icon were designed with backtracking facilities from the outset and these facilities are deeply intertwined with the implementation. Retrofitting a backtracking facility in a language that wasn't designed for it has never been achieved. We report on an experiment to retrofit Smalltalk with a backtracking facility. The facility is provided through a small number of primitives written in the language (no modifications to the kernel were made). The ability to do this is a direct result of the power provided by the objectification of contexts.
There's tons of other examples, for example various distributed objects mechanisms, my own Higher Order Messaging [2] the way Gemstone creates queries from procedural selection code etc.
[1] https://dl.acm.org/citation.cfm?doid=62084.62094 https://dl.acm.org/citation.cfm?doid=62084.62094
[2] https://en.wikipedia.org/wiki/Higher_order_message https://en.wikipedia.org/wiki/Higher_order_message
- corysama 8y agoYep. Java’s strawman implementation of OOP lead most of the world to never learn OOP’s potential. In Smalltalk, if was a virtual method of Boolean! Sounds horrible for performance, eh? Despite that, the Strongtalk spin off of Smalltalk was used as the internals of Java’s Hotspot JIT.
- mpweiher 8y agoFrom The Evolution of the Smalltalk Virtual Machine (Dan Ingalls, in Smalltalk-80, Bits of History, Words of Advice, Krasner): "Smalltalk-76 had to provide a mechanism for passing unevaluated code. [Blocks/Closures] Since the Smalltalk-76 design had no experience to draw from, it was weak in several areas.[..] One Problem which was discovered in the process of of supporting error recovery was that block contexts could not be restarted because they did not include their initial PC as part of their state. This was normally needed for looping , since all such code fragments ended with a branch back to the beginning. Happily, we were able to fix this by defining a new subclass." So they were able to fix a bug in the language implementation by writing code in the language itself!
- formula1 8y agoJava is fine
- reitanqild 8y agoTotally agree. Most problems with Java are cultural. It seems the more experince people get with large team efforts the more they value Java and other well supported type safe languages. I'm a perfect example myself as a person who used to think that a number of other languages would be better but after having to maintain my own (yep, not only someone elses bad code, but also my own precious code) in a number of languages I've come to really prefer Java.
- manglav 8y agoCan you point to some resources that teach Java "the right way"? Without the cultural baggage? I need to learn it for a new job and I'm inundated with resources that I can't determine the quality of.
- meddlepal 8y agoJVM dev here... unfortunately there aren't any great holistic books for modern Java that I can think of. A lot of it is just community learned (e.g. put the XML away, stop making everything a damn GoF design pattern, stop trying to create mega class hierarchies, favor small libraries over mega frameworks). I will say Joshua Bloch's Effective Java is something ever Java dev should have read at some point.
- lmm 8y agoThe trouble with OOP is that objects you can send messages to are already too complex to reason about. You can't send the same message twice and expect to get the same reply (or even, in some implementations, get a reply at all). So the fact that you can implement anything with objects isn't that surprising, because saying something is an object doesn't really constrain what it can do - you might as well say you can implement anything with a "thing", which is true but useless. Functions - or rather, constructive, well-typed functions - occupy a nice sweet spot where they're constrained enough to reason about, but powerful enough to do what you need. https://tahoe-lafs.org/~davidsarah/noether-friam4.pdf https://tahoe-lafs.org/~davidsarah/noether-friam4.pdf has a more concrete set of tradeoffs: starting from a small, highly symmetric core, you add more capabilities to the language but you break a symmetry each time. One of the levels in the rainbow is an OOP language, but that requires breaking enough symmetries that I wouldn't want to work in it if I could avoid it.
- KirinDave 8y agoIt's extremely frustrating that whenever anyone talks about even the slightest positive mention of FP, this site tends to immediately have 2-3 folks pop out of nowhere demanding that everyone recognize OO exists. Yes. Yes. We know. You can write programs with OO. It's the dominant paradigm of the software industry. No one here saidthat OO is somehow ineffective, cannot abstract, or lacks cleverness. Please for even comment section just put down the sword and let other folks with equally interesting approaches talk about their work.
- seanmcdirmid 8y agoI feel like the HN bias tends to go the other way, that FP is some kind of awesome magic sauce and OOP is the bane of good software. In reality, most of the techniques we discuss don’t really depend on a specific language orientation.
- KirinDave 8y agoYou can probably prove this one way or another.
- reitanqild 8y agoA good number of the posters here are fans of Paul Graham who is a loud FP advocate. Also I've been here for a number of years and I can never recall seeing anyone bashing FP. (Which is totally fine with me.) Bashing Java and and general OO however is to be expected in any programming related thread here (a little tiring but understandable, I too have seen my share of bad OO code.) Neither of this counts as proof but yes, this site comes off as extremely pro FP for me as well.
- KirinDave 8y agoPaul Graham is not a fan of FP, he's a Lisp advocate. Every Lisper will be quick to tell you their approach is a superset of FP with its own unique meta-syntactic tools. This is a great illustration of my point. If you place every differing viewpoint in one bucket and then take the sum, yeah it's gonna see overwhelming. In actuality, there are lots of factions with interesting viewpoints.