4 ms·
Python calls it "pickling"[0] which is also pretty cool. While others have already given examples re "marshalling" I'll go ahead and add one to the pile: Ruby
by sodapopcan 5y ago
Python calls it "pickling"[0] which is also pretty cool.
While others have already given examples re "marshalling" I'll go ahead and add one to the pile: Ruby also uses this term[1]. However, in my ~10 years of working with Rub daily, I have never Marshalled anything, nor have I known anyone who has. On the contrary, the few pythonists I talk to on the regular seem to be pickling all the time.
...but I seem to be maybe getting off track here.
[0] https://docs.python.org/3/library/pickle.html https://docs.python.org/3/library/pickle.html
[1] https://ruby-doc.org/core-2.6.3/Marshal.html https://ruby-doc.org/core-2.6.3/Marshal.html
- kuang_eleven 5y agoTypically, one wouldn't use the term 'pickling' for JSON however, it's usually used for a more general serialization process. Most of the time I just hear people talk about 'loading' and 'dumping' JSON, also from the Python JSON library.
- quietbritishjim 5y agoPickling is just one specific type of marshalling, so the terms are not equivalent. I'm not familiar with Ruby, but from your link it's clear that the Marshal library is also for one specific marshaling format. By the way, pickling is great for transmitting data at runtime between processes that you own, because it can marshal almost any Python object and it's very fast. But it's bad at storing data (on disk or in a database) because it can execute arbitrary code and the format of the objects can change between package releases. That's quite different from marshaling as JSON, which is a very stable format supporting a deliberately restricted set of types.
- sodapopcan 5y agoYou're right—my bad.