Here's a mundane issue - but one that I seem to be stuck on. I'm
hoping that someone will know about a solution that I am not seeing.

Converting to new syntax mostly isn't that hard. It's an adventure in
shift/reduce errors, to be sure, but that's not such a big deal. The
hidden challenge is turning out to be iterator syntax. I'm hoping
somebody will have a suggestion that I have not seen.

In traditional "systems" languages, we have three types of loops:

  while(expr) { ... };
  do {...} while(expr);
  for(pre; test; incr) {...};   // syntactically rewritable to while form

This style relies on the fact that the languages are imperative. If
these languages were pure, then of course the predicate expression
results would not change.

There are two sub-cases:

  - We know how many iterations before we enter the loop. This is true
with FORALL
  - The loop condition computation result is altered by the loop body. This is
    the usual case in systems codes.

In pure languages, we tend to have loop syntaxes that turn into
labeled-continue mechanisms. LET LOOP is a good example. After a time,
these seem normal to LISP programmers, but remain puzzling in the eyes
of systems programmers.

Given that BitC wants to straddle the line between imperative and
functional styles, I'm struggling with finding a comfortable looping
syntax. If I can't find one, I'll probably just bite the bullet and
support distinct imperative and functional syntaxes, but it would be
nice not to do that.

Suggestions? Other languages to look at?


Jonathan
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to