News for hackers. Stuff that matters.
Re:Ribosome – A simple generic code generation tool by klelatti on Friday June 18, 2021 @07:32AM (#27549326)
I'm using code generation to go from a super simple finance DSL to a c program which then gets compiled using clang. Could I do it without code generation? Maybe, but I get the flexibility of a dynamic language to do the DSL parsing etc.

I see it as a bit like LLVM - an intermediate stage that adds flexibility.

Re:Ribosome – A simple generic code generation tool by ltbarcly3 on Friday June 18, 2021 @07:59AM (#27549450)
You are describing a compiler, not code generation as I am criticizing. When people generate code, the generated code is the code they check in and modify going forward, not just some intermediate step in a language implementation.
Re:Ribosome – A simple generic code generation tool by HelloNurse on Friday June 18, 2021 @09:16AM (#27549946)
There's a misunderstanding, generated code is only "modified going forward" by very immature organizations. For extra negative credits there is the false idol of "round-trip engineering", like in the old Together Control Center, usually involving UML.

Generating from nice models and nice templates (the real source code) verbose and correct "boilerplate" that won't be usually read, let alone modified, is simply a shift to an ad hoc, specialized programming language.

Re:Ribosome – A simple generic code generation tool by klelatti on Friday June 18, 2021 @09:54AM (#27550318)
You were critical of this tool. I could easily see this tool being used for my use case. It generates human readable c which I can exactly what I want and is not what compilers do.

Who says you have to check the generated code in and modify it going forward?

You're commenting on your own definition of 'code generator' without properly considering this tool and its use cases.

[dead]
Re:Ribosome – A simple generic code generation tool by klelatti on Friday June 18, 2021 @12:16PM (#27551902)
So you're criticising templating languages now. No point in engaging further. Bye.
Re:Ribosome – A simple generic code generation tool by ltbarcly3 on Friday June 18, 2021 @12:36PM (#27552145)
Well, I use templating languages and I think they are quite useful. I've used many in my career, probably 10 or more. Now there is another one, which is good to know I guess.