Thanks for the prompt reply, connectivity issues during travel didn't allow the same kindness....
To be clear it's still quite a prototpe, and while I've gotten CUDA & debugging to work it's been with isolated shaders, not networks.
The focus at this point is getting GLSL transformation done for viewport rendering, which likekly can be easily shared back into OSL.
I'm aware of the NVIDIA and Pixar projects, but as noted they've been announced but not materialized in public. I'm not trying to be disparaging (or announce yet another one that isn't public), but wanted to get a better sense of whether language additions/changes are palpable before relying on them.
On the language features, it's good to know that there's some common ground.
Already gotten initializer lists and simple method calling to work, so I'll clean up & submit some pull requests when I get a chance.
Builtin vector types are of particular importance to me as not having it a guaranteed type makes generating GLSL that much more difficult.
I'm not advocating a swath of ivec, uvec, bvec, etc. Just core float based vector 2,3,4. And assuming there is a backend that outputs to SIMD IR, doesn't it become beneficial to have a strict contract on the alignment/size so that those types can also benefit and not make the runtime optimizer & LLVM-codegen jobs that much more difficult? In a header based approach, whose to say some enterprising youth hasn't done this:
struct color4 { string key; int value; color rgb; float a; };
Swizzling; I understand being lukewarm about, but component wise access is something I feel would benefit the language.
Cf.r is just a more convenient and obvious notation in a local context (the ambiguity of Cf[0] requires a bit more knowledge of what Cf is). Once that was done, swizzling was trivial to add, and has the benefit if builtin vector types get added, they would be backward compatible with the current implementation (as well as not needing to manage additional intermediate shaders for MaterialX). It also makes some code more way more concise:
color c = Cf.r; // c is obviously an RGB of the red-channel.
color4 b = c4.bgra;
vs:
color c = Cf[0]; // What is c now, is Cf an array or a color?
color4 b = { color(a.rgb[2], a.rgb[1], a.rgb[0]), a.a }; // Tha't a lot of typing and not necessarily particularly easy to read.
And finally about the early IR generation. That wasn't to be taken as a proposal for OSL per-se but more context as to what is trying to be accomplished with the language itself (outside the context of shading, something more akin to VEX). Assuming a network of shader/nodes whose source will never change: load the binaries/IR and immediately start processing (no JIT), in the background a new llvm::Module is built from the network of all node's IRs and constant parameters, on which LLVM optimization passes are run.
Whether or not it optimizes as well and the overhead is certainly a concern; though I feel porting the runtime optimizations to LLVM passes wouldn't be too painful.
Additional optimization strategies also become possible, like having the pre-compiled version provide profile-guided optimizations after a few runs.