I'm working away at the lisp to glsl compiler now.
Compiler is probably a bit grand a name for what I'm
doing but ah well!
Just added a couple of things for me to think about when I next
come back to this.
Step by step I'm working out how this will work.
I'm getting someway there...not sure how well it'll hold up under
pressure but I'm hopefull
remove glsl bit
Made some real strides with the achitecture of the lisp-to-glsl
translator.
There still is a way to go and once the basics are working I still
need to write all the commands to the glsl spec, but I'm getting
there!
*Not Currently Working* I'm in process of writing the lisp->glsl
translator and its going pretty well. I am working through a copy
of the 330 spec and slowly adding all the functionality.

I needed to push as this was getting to be too large a changeset for me to be happy just having it on my computer.

Changes:
* Fixed a bug in cepl-gl where a generic function was refering
  to a class created later in the file.

* Added intesperse to the cepl-utils folder

* Added cglsl-core cglsl-maths cglsl-matrices cglsl-test and
  cglsl-vectors. These are going to hold functionality which will
  mirror that of the cepl meaning the user can happily copy code
  between gpu shaders and local functions and know they will work.

* Modified cglsl to keep this file for meta functionality of the
  cglsl stuff.

* Added generic matrices functionality. This did require tweaking
  matrix3 and matrix4 a little. I need to come back to those two
  and really spruce them up

* Tweaked a doco string

Right, like I said at the top this isn't a working push
unfortunatly, but I'm slowly chugging through the work now so it
shouldn't be too many weeks before I get my first shaders written
in lisp.
Take care all!
Moved cglsl files into their own directory.
I've also modified the method generating macro to be able to create
permutations of types for definitions. There are some cases that
are not covered but these will probably be addressed later on.

I'm a good chunk through the built-in functionality but do need to
look at types and constructors again soon.
Still stumbling along, adding things from the standard.
More work on glsl, nothing much not note.
Going to round off more of this soon
I'm happy to see that I'm able to write a defshader that will spit
out something resembling glsl code. I have however come up against
the fact that within cepl-gl there isn't a standard way to referring
to different types. This is something that needs some thinking about
before I dive into another type conversion function for cglsl.
Righto, goodnight all
*WARNING NOT CURRENTLY WORKING* As you can see from the log I have
been focusing on cepl-gl. The major thing is that I have found out
how I want to handle foreign types:
I have defined foreign bool, float, int and uint based on the cffi
basic types. From these I have defined all the basic glsl types
(except samplers for now).
The reason for redefining the 4 most primitive types is that then
all the glsl types are under the cepl-gl package and so the
programmer doesnt have to think 'hmm was the float part of cffi or
cepl-gl?' though obviously they can if the want to.
Structs can also be used in other structs.
For example the following:

(defglstruct vert
  (position vec3)
  (color vec4))

(def poly
  (vectices vert :count 3))

Is totally valid.
All structs produce getters and setters of their own as well as for
their slots which makes it possible to use a slightly experimental
style of setting their contents.
For example using the structs defined above:

(setf (poly-vert (aref-gl *example-poly 1)) '((v! 1 2 3)
                                              (v! 4 5 6 7)))

will set the first vert in the poly's vert array to the contents
of the list where the contents are assigned in order, slot-wise.

Next I am back working on the defshader and defprogram code, trying
to use these types to make setting streams and uniforms both as
efficient and as easy as possible. This will take a while
especially as I am moving soon, but it will be great when it is
done. At that milestone I will finish the lisp->glsl translator and
rewrite all the examples to show how well it can work.

Goodnight all!
*WARNING NOT CURRENTLY WORKING* Done a little more work on the
defprogram function. I've come up with how the code should look so
I'm currently implemening it.
Night all
Quick changes while I had a few mins spare. I am still working
on the defprogram macro. I just have to work out how to handle the
fact that lisp shaders pass on their outputs to be used as inputs
to the next shader. THis will be easy enough though and once it is
done we can have a better look at the shader loading & compiling
options in general
*Not Working* I've be having a really struggle with types tonight
I wanted to sit down and work on the lisp-glsl translation function
but quickly ran into issues.
 - I didnt have a way of creating gpu arrays of simple types
 - glvertexattribpointer uses enums that are not present for my
   vec & matrix types
 - Streams can be made of multiple array, so our function has to
   handle this.
 - Stream cannot take streams of Struct data. For me that means
   that any Struct that has slots types as a struct or an array
   of any non-simple type is unnacceptable
I have fixed these but now have the issue of what to name the
stream data on the glsl side of things. For most it is easy as I
have the slot names, but for gpu-arrays of simple type there is no
obvious thing to name the other side. This probably means I will
have to specify this in the stream-spec.

I also need to put some sanity check in some of my macros so I can
get some sane errors when they are used incorrectly. This is as
much to stop me barking up the wrong tree when I get an error in the
repl as anything else!

Right, time to sleep
Night all!
Man these changes suck! I need some serious refactoring.
BUt I am tired... enough...brain no more worky
Reworked much of the structure of many of the functions.
I have:
* rewritten the code theat generates the glsl layout for
  in-vars
* become aware of many incorrect assumptions about the internal
  types and have made efforts to make the code more robust
* identified code repetition and cleaned it up
* removed the notion of layout lists, used by other functions to
  setup the attrib-pointers, and just generate methods to assign
  the attrib-pointers directly.

Most importantly I'm getting a better vision of how the glsl
translator will work. Only a few weeks until my coding retreat now
so my goal is to have it working by the end of that time.

Goodnight all!
The GLSL generating code is being spun off into a seperate project
called Umbra. See that repo for recent development. I'm off on a
coding retreat soon so I will get Umbra up to 1.0 and then focus on
the links from cepl so make everything seamless.
Take care all
Well, I had a great time away and now I'm ripping out the old attempt at generating glsl and
replacing it with varjo. Varjo is my lisp->glsl translator and while it still is in need of a
hefty refactor the interface is solid enough to be worth integrating with Cepl.

This is mostly a reworking of cepl-gl-types and cepl-gl to start down the road of getting this
to work. I have gl-arrays and gpu-arrays working well, I now need to look at generating vaos,
this turns out to be a bit of a pain in the backside! It needs to be able to handle any glsl
type and also any type created by the user using defglstruct, getting with right is taking time.

Okidokey, ciao for now
Defglstruct now makes full varjo structs along with its own foreign
struct allows for seamless integration between foreign-c and
foreign-glsl code. See below for example:

;; DEFINE THE STRUCT

CGL> (defglstruct vert
       (pos :vec3)
       (col :vec4))
VERT

;; USE IT IN A VARJO SHADER

CGL> (varjo:defshader :test ((a vert) &uniform (b vert))
       a)

;; SHADER CODE IS GENERATED

#version 330

struct vert {
    VEC3 POS;
    VEC4 COL;
};

layout(location=0) in vec3 _f_A_POS;
layout(location=1) in vec4 _f_A_COL;

uniform vert B;

void main() {
    A;
}
Man this is coming along well! This commit sees the following:

* Function better than symbolicate-package called symb-package which
  does the same thing in tidier code.

* Added generic function definitions for primitive types. This
  includes dpopulate, gl-pull and the vertex-attrib-assigner

* made substantial improvements to the gl-assign-attrib-pointers
  generic for struct types

* got rid of old redundant code

* Lots of effort going into the make-vao functions, these MIGHT be
  nearly done but all need testing. To test I need shader programs
  hence the work mentioned below

* Started writing the defprogram macro and assosiated functions.
  This includes the rolling-translate which uses the out vars of
  a preious shader as the in-vars for the next. (works great!)

(defprogram test ((a :vec3) &uniform (b :int))
       (:vertex (varjo::out c (+ (aref a 0) b)))
       (:fragment c))

 --------- Becomes ---------
#version 330

layout(location=0) in vec3 A;

uniform int B;

out float c;
void main() {
    c = (A[0] + B);
}

   --- and ---
#version 330

layout(location=0) in float C;

uniform int B;

void main() {
    C;
}

---- Thats bloody great! (even with the littel bugs there)