Benjamin Goldberg wrote:
Donal K. Fellows wrote:
OK, let’s go for a more concrete question. What sequence of bytecodes
would let me open a socket and talk to a remote host? The Parrot I/O
operation opcodes don’t mention anything about sockets and nor can I
tell how I would invoke a piece of helper C or C++ to do the job on my
behalf.
Just as there are “stdio”, “unix”, and “win32” ParrotIO layers, one
would define a “socket” layer (and maybe an “xti” layer, for the really
adventurous). Obviously, this needs a bit more C code to be added.
Once that layer is added, you could read from and write to sockets just
like you would from files.
OK, what sequence of bytecodes would instantiate and invoke those layers? The
expositions I’ve found online so far have been rather too dry for me to actually
see how such a thing could be done.
Donal (fed up of hand-waving, particularly in his day job. Must write code…)
···
–
“Windows is a car with square wheels (architecture) and a huge engine (hype,
etc.), capable of of making the car move despite the square wheels. Linux
is a car with round wheels but a small engine, capable of making the car go
despite the small engine.” – John Latham jtl@cs.man.ac.uk
Donal K. Fellows wrote:
Benjamin Goldberg wrote:
[snip Q: How to do sockets]
Just as there are “stdio”, “unix”, and “win32” ParrotIO layers, one
would define a “socket” layer (and maybe an “xti” layer, for the
really adventurous). Obviously, this needs a bit more C code to be
added.
Once that layer is added, you could read from and write to sockets
just like you would from files.
OK, what sequence of bytecodes would instantiate and invoke those
layers? The expositions I’ve found online so far have been rather too
dry for me to actually see how such a thing could be done.
Umm, err, I don’t know… I’ve merely looked (briefly) at the docs and
source of Parrot, and never programmed for it. But I’m sure
that it can be done.
Donal (fed up of hand-waving, particularly in his day job. Must write
code…)
Sorry about the handwaving, but it’s the best I can offer. If it can’t
be done now, someone will add it in the future.
“Windows is a car with square wheels (architecture) and a huge engine
(hype, etc.), capable of of making the car move despite the square
wheels. Linux is a car with round wheels but a small engine, capable
of making the car go despite the small engine.”
– John Latham jtl@cs.man.ac.uk
I would say that Linux has an equally big engine, but a manual
transmission, which discourages folks who are used to automatic.
···
–
my $n = 2; print +(split //, ‘e,4c3H r ktulrnsJ2tPaeh’
…“\n1oa! er”)[map $n = ($n * 24 + 30) % 31, (42) x 26]
Donal K. Fellows wrote:
OK, what sequence of bytecodes would instantiate and invoke those
layers? The expositions I’ve found online so far have been rather
too
dry for me to actually see how such a thing could be done.
Umm, err, I don’t know… I’ve merely looked (briefly) at the docs and
source of Parrot, and never programmed for it. But I’m sure
that it can be done.
I’m fairly sure it can be done. I was just trying to evaluate
whether it could be done with a reasonably small input of effort or
whether it was going to be a really big porting job. (Everything I’ve
seen so far makes me think that it will be enough effort that I’ll
leave it to someone with a commercial interest in having things work
together.)
Donal (fed up of hand-waving, particularly in his day job. Must
write
code…)
Sorry about the handwaving, but it’s the best I can offer. If it can’t
be done now, someone will add it in the future.
It’s just that given the size of the semantic disconnect between Tcl
and Parrot, it’s pretty clear to me that there’s going to be great
amounts of C code (or some other language, I suppose) involved in
building a bridge between the two. Hence my intense interest in
seeing how this might be done, and my irritation at someone saying
“oh, it must be possible”. And I was feeling frustrated at cow-orkers
that day too… ;^)
Donal (posting through Google due to sucky local news-server.)
···
[This space unintentionally left blank.]