Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clojure -> GLSL translation #1

Closed
rogerallen opened this issue Apr 14, 2013 · 2 comments
Closed

Clojure -> GLSL translation #1

rogerallen opened this issue Apr 14, 2013 · 2 comments

Comments

@rogerallen
Copy link
Member

Transferring this issue from original repository rogerallen#9

Sam Aaron suggested:
Another interesting option would be to write a transpiler from Clojure to glsl code.

Karsten Schmidt followed up with:
Re: Sam's comment about a CLJ -> GLSL compiler: Zach Tellman's old
Penumbra project has a mention of something like that, though I can't
comment on if or how well it works:

See here:
https://github.com/ztellman/penumbra/tree/master/src/penumbra/glsl

From the forum
On Thu, Apr 4, 2013 at 1:40 AM, Stathis sideris@---.com wrote:
I may be a bit late to the party, but the "transpiler" bit for generating GLSL code from Clojure has already been implemented in Penumbra which is no longer in development, but maybe could be cannibalised? Here is an example of a shader written in "clojure" code that's translated to GLSL by this part of Penumbra.

Stathis

And finally, the original author also mentioned:

Speaking as the person who wrote the GLSL transpilation, I'd recommend against using the Penumbra code wholesale. The type inference is finicky, and the implementation is fairly opaque. However, if you have any questions about what's going on there, feel free to get in touch. I don't guarantee I remember enough to answer everything, but I can at least point you in the right direction.

Zach

So, when I get ready to do this, I'll follow up with Zach

@rogerallen
Copy link
Member Author

First steps went in today with 47cb759

At this point, it just does a straight translation of "clojure-like" s-expressions--not Clojure. That might be as far as this goes...I'm not sure.

rogerallen added a commit that referenced this issue May 28, 2013
…filename or an atom that contains the shader program string. Allows you to adjust & reload the shader string.
rogerallen added a commit that referenced this issue Jul 27, 2013
…sue #1 complete.  At least complete enough to argue about.

Add if and switch tests.
@rogerallen
Copy link
Member Author

This isn't Clojure->GLSL, but I really don't know if that's worth the pain of implementation for what it will be used for. If anyone is aware of a Clojure->C compiler I could use, then please add a comment. Otherwise, I'm just going with this simple single-pass lisp->string converter for now.

I'm calling this "good enough" to close. We'll open further issues for things that come up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant