/sys/doc/ Documentation archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

inferno and limbo discussions



this list has been amazingly quiet recently, considering
that a lot of inferno documentation has been released.

i'm sorry to break the hush, but i'd quite like
to discuss various aspects of inferno, in
particular limbo... if anyone feels that it's
inappropriate or annoying then i'll stop!

from looking at the limbo spec, there seem
to be a few things which aren't very obvious, or
seem ambiguous; here are a few... what do people think ?

tuples in expressions

  is it possible to turn a tuple into a scalar in a single expression.

  e.g. if you have a function
  divmod : fn(a, b : real) : (real, real);

  and you want the first value in the tuple, do you have to :

  (div, mov) := divmod(x, y);
  sum += div;

  or can you :

  sum += ...divmod(x, y);	# somehow

  i.e. discard one member of a tuple within an expression ?
  this is more of an issue with some functions that return
  a status along with a value - sometimes you only want to
  check the status, while ignoring the value.


alt statements

  do guarded alts work correctly ?

  e.g.

  wait(waitforoutput, waitforinput : int, chin, chout : chan of int)
  {
    alt
    {
      waitforoutput && chin <-= 99 =>
                          sys->print("sent value");
      waitforinput && val := <-chout =>
                          sys->print("val received: %d\n", val);
    }
  }


quote :
	"An uninitialized string, or one set to nil, is identical to
	the empty string (denoted "") for all the relational operators"

  also

	"A non-initialized string, or one whose value has been set to
	nil, compares equal to nil. (This is different from the
	zero-length string, which is denoted "")."

  these statements seem to conflict. which one is true ?

conversion from lists to arrays

  e.g. in tklib, there's the function :

    tkcmds : fn(t : ref Tk->Toplevel, cmds : array of string);

  if i wanted to pass the argument list passed to init to tkcmds, then
  is it possible to convert from a list of string to an array of string
  without writing an explicit function to do so ?

    cmds := array[len argv] of string;
    for (i := 0; argv; argv = tl argv)
      cmds[i++] = hd argv;

  in fact the API never seems quite sure when an array or a list
  is most appropriate... it might be necessary to duplicate the
  above lines of code all over the place.

slice expressions

  how is aliasing avoided (or is it) ?

  e.g.
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                                                            
                                           

  copybytes(to : array of byte, from : array of byte, count : int)
  {
    for (i := 0; i < count; i++)
      to[i] = from[i];
  }

  ...
  x := array[20] of byte;
  b, c : array of byte;

  b = x[10:15];
  c = x[11:16];

  copybytes(b, c, 5);

  is there some reason why this might be illegal ?

for what reason does the function srv->reads() exist ?

how possible would it be to implement inferno on a
non-shared-memory multiprocessor machine ?

why are all adt members visible by default, and doesn't
this make interface upgrades more difficult, as the whole
type is visible to all clients of that type ?



so, is anyone interested in talking about this, or are we all going
to just sit and stare speechlessly in awe ? :-)
(e.g. it would be interesting to hear (non bell-labs!) comparisons
with java (and other systems) from someone that's familiar with that language).

  cheers,
    rog.