-
Notifications
You must be signed in to change notification settings - Fork 64
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
Improve code generation with text/template #32
Comments
There's also |
That's coming in 1.4, right? I'm not too familiar with it, but the proposal I read simply allowed it to run arbitrary user-written code generation scripts, right? So doing this would still be necessary. |
Yes, It's nice because it's a standard that's easy to follow and makes contributing to various Go packages easier. You know it's always See here for an example of replacing a bash file with |
I tried to rewrite genprog using The main idea was to place all crucial information directly in the template and not in the program that generates code. I know, I could have passed meta info about types and functions to template. Or I could have used sub-templates for each function for example. In the end I decided against it. Template almost looks like a go code, if you squint hard enough. And that's a good thing, I guess. Except maybe there will be First of all it works. It is a zero-diff change... well, not actually. The order of functions in Here is some caveats:
|
Issues #30 and #29 are basically on hold because of some of the difficulty in rewriting the code generation. I think it would just plain be easier to rewrite the incredibly ad-hoc, ugly code gen script with text/template.
The new version likely would no longer use the Makefile, and instead directly generate the
float64
version due to text/template's greater flexibility.The text was updated successfully, but these errors were encountered: