B
Bill Atkins
Is there any reason to use Marshal instead of YAML? Is there anything
Marshal can do that YAML cannot?
Marshal can do that YAML cannot?
Bill said:Is there any reason to use Marshal instead of YAML? Is there anything
Marshal can do that YAML cannot?
# =>"\004\010[\ac\vStringc\fInteger"Marshal.dump [String, Integer]
ArgumentError: can't dump anonymous class ClassYAML.dump [String, Integer]
Joel said:Marshal is, in my experience, a bit faster.
why said:Mostly you want to use YAML in place of Marshal if:
* You need portable serialization.
* You will be hand-editing your objects.
* You need to read saved objects (for debugging).
YAML bytecode will only really solve the first of those.
Hal said:Can you explain this to me? I sense some irony here. You're taking a
format which is renowned for making persistent objects readable in
plain text, and you're making it unreadable.
No flame intended. I like YAML, I use it all the time, and I appreciate
all your hard work.
why said:Why not provide a wire format that is more efficient than YAML and keep
its portability? My big use case is this: I love DRb. I want it to
work across languages. I guess you could do this with plain YAML. But
we don't really need YAML's readability. And we could use the
efficiency a bit.
Didn't you just say "No flame intended" in another thread? Seriously.
It's starting to sound really insincere, Hal.
Hal said:<flame>You know, _why, sometimes your code isn't as high-quality as it
usually is.</flame>
Why not provide a wire format that is more efficient than YAML and keep
its portability? My big use case is this: I love DRb. I want it to
work across languages. I guess you could do this with plain YAML. But
we don't really need YAML's readability. And we could use the
efficiency a bit.
Gavin said:Doesn't DRb use Marshal, and isn't Marshal faster than YAML? Won't
YAML bytecode be no faster than Marshal? Isn't Marshal suitably
cross-platform?
No flame intended, but you got a lot of questions to answer
I guess _why's suggestion is to make it possible for the drb protocol to
talk between languages, if someone wanted to develop DRb for Python or
Perl. But that does raise a lot of questions...
Reinvention? YAML is already a serialization language. All we'reAra.T.Howard said:wouldn't that be soap? ;-) i hate xml, but this would be wheel reinvention
for sure...
Reinvention? YAML is already a serialization language. All we're
talking about is providing a bytecode to allow efficiency where
readability isn't needed. It's no different from Rite in that regard.
We don't need to tax the parser all the time.
You could use the same useful YAML APIs but have Marshal's tightness. I
don't know about you, but I'm convinced!
_why
why said:Reinvention? YAML is already a serialization language. All we're
talking about is providing a bytecode to allow efficiency where
readability isn't needed. It's no different from Rite in that regard.
We don't need to tax the parser all the time.
You could use the same useful YAML APIs but have Marshal's tightness. I
don't know about you, but I'm convinced!
I say, go for it!
Right, yeah. Method dispatch stuff would have to be worked out. ThatAra.T.Howard said:by reinvention i meant the 'object access protocol' bit. i mean, soap is a
lot more than just serialization, it's __what__ you are serializing (an object
request) that has had much work done... but i guess if you leveraged drb...
then who knows...
Your faith is unimpeachable, Ara. And give my best to your 36 machines.my latest yaml project is an nfs accessed on disk priority queue that i'm
using to distribute jobs to consumers located on 36 machines. the cool thing
about it is that grep and vi work to modifiy it - too cool.... so - i'm
definitely a believer...
Reinvention? YAML is already a serialization language. All we're
talking about is providing a bytecode to allow efficiency where
readability isn't needed.
My big use case is this: I love DRb. I want it to
work across languages.
Reminds me a bit of the early days of Java:
1. Hey, let's make a virtual machine that's PROCESSOR INDEPENDENT!
2. Hey, let's make a new chip that will run this natively!
I don't know that they ever did, though.
Hugh
I agree. Having a couple of standards for one action is always a good thing.I certainly think it would be cool to have both formats -- both
functionally equivalent, but one being faster and the other being a
lot handier for debugging.
Maybe it's not so much reinventing the wheel, as constructing a
unicycle...
* Hal Fulton said:Reminds me a bit of the early days of Java:
1. Hey, let's make a virtual machine that's PROCESSOR INDEPENDENT!
2. Hey, let's make a new chip that will run this natively!
I don't know that they ever did, though.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.