3 ms·
JSON doesn't support behaviour (methods). They are very useful for composing programs IMO.
by vbezhenar 11y ago
JSON doesn't support behaviour (methods). They are very useful for composing programs IMO.
- wz1000 11y agoBehaviour could be implemented by shell commands. That way, if you wanted to implement a method for a particular object, you could just write a binary/shell script/whatever that reads the object from stdin and writes its result to stdout
- masklinn 11y agoMethods are useful to organise and abstract programs, they're really quite bad at composition. Many functions operating on the same primitives is much more composable than small sets of functions operating on their own custom primitives.
- sudioStudio64 11y agoif the deserialization mapped to a system wide type system then the methods could be mapped in at that point.
- current_call 11y agoThen you'd need a JavaScript interpreter. Which would be terrible.
- icebraining 11y agoWell, it doesn't have to be JS specifically. In theory, it could even be a piece of machine code.