Adding modifiers to NCI

Markus Mayr maxl.mayr at aon.at
Sat Jan 3 21:11:46 UTC 2009


On Friday 26 December2008 22:33 -0800 Allison Randla wrote:
> >> chromatic wrote:
> > 
> > What could be more consistent with 40 years of C function signatures than the 
> > same C function signature syntax that C function signatures have had for 40 
> > years?
> 
> NCI doesn't use the C function signature syntax. So, you're either 
> repeating something that's simply not true (which seems unlikely), or 
> you're making a metaphorical point. If you're making a metaphorical 
> point, perhaps you could be more explict: in what way(s) are the current 
> NCI signatures similar to C function signatures? What are the specific 
> mental associations you see captured in the current syntax that aren't 
> captured in the hypothetical syntax?
IMHO, you could potentially capture anything that could be captured with
the current syntax provided that you extend the syntax further and care
about all modifiers and types. Nevertheless the syntax seems unnatural
compared to the current one. C signatures can be read from right to
left, as well as the current NCI-syntax, for example
	i 33
could be interpreted as "push two pointers on the stack, call a function
on them, (pop the pointers, depending on CC) and store the return
value", though it is not always that simple. Your proposed syntax seems
less similar to the C syntax and therefore less clear. But, as you said,
similar things should be similar.

Now, one could argue that the syntax
	i <- 33 or T <- T* T*
would fit both calling conventions better ... However I think that this
syntax would not represent the CPS of the PCC, as good as the current
syntax, though this might be a personal preference.

But there are other, more important reasons, anyway, I think.

> I'm not invested in the hypothetical syntax, but it's a useful framework 
> for the conversation.
Yes, it actually is. But generally, I'd prefer an easier-to-read syntax,
even if this would result in a slighted more bloated syntax. For
example, T representing an inTeger is not too obvious, IMHO.

Markus Mayr



More information about the parrot-dev mailing list