Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.

Questions tagged [code-generation]

Filter by
Sorted by
Tagged with
1 vote
3 answers
402 views

I need to design a code generator system that produces serialisation/deserialisation libraries for multiple languages running on multiple platforms. Hard Constraints I need this to capture a pre-...
avigt's user avatar
  • 133
1 vote
3 answers
601 views

Yesterday I screwed up: One of the classes of my C# contained a property, called "DeliverdQuantity" (yep, there's a spelling mistake indeed). When I saw that, I decided to correct that, ...
Dominique's user avatar
  • 1,844
0 votes
1 answer
110 views

HINT: the purpose of this question is to identify downsides for the scenario described. If something is a downside, then it should be quantifiable and it should clearly have a negative impact. ...
pgpb.padilla's user avatar
0 votes
2 answers
514 views

In our company, there is no standard for how to document APIs. Missing API documentation slows down the development process. Therefore, we want to introduce OpenAPI. We want to use code generators to ...
Harold L. Brown's user avatar
-3 votes
2 answers
409 views

Github Copilot got update yesterday (2023 St. Valentine) https://github.blog/2023-02-14-github-copilot-now-has-a-better-ai-model-and-new-capabilities/ but still no information for its use in the ...
TomR's user avatar
  • 1,029
1 vote
2 answers
527 views

CONTEXT My project is about implementing the "conventional method for house-energy-efficiency assessment" in France (120 pages). I want to provide a strict yet easy to use API to this method....
Lionel du Peloux's user avatar
7 votes
2 answers
2k views

The Java project I am working on currently has a complicated folder structure, and to add a new functionality, one needs to add many .java files in different places in order to let it work in our ...
teamol's user avatar
  • 1
0 votes
1 answer
237 views

Hypothetically, consider a social photo platform - each pic gets its own url, this page contains the image, text about the image, buttons for the user to click, related pics, and some user-specific ...
ahron's user avatar
  • 165
0 votes
2 answers
270 views

I'm developing a commercial closed-source application that will have a user-interface, and the back-end will be generating C++ code that needs to be compiled to produce a final end result. When I ...
Mode77's user avatar
  • 121
1 vote
1 answer
459 views

I wish to develop an application that can generate code based on an user input. Long story short: a user gives a formal description of a Resource (can be viewed as a REST resource) and based on this ...
jbolt's user avatar
  • 131
0 votes
0 answers
898 views

I googled this and found questions like "How to use Protobuf message as java class without a java outer class?" (https://stackoverflow.com/questions/60312156/how-to-use-protobuf-message-as-...
Matt Welke's user avatar
1 vote
3 answers
369 views

Let me try to clarify my question with an example. Assume a library of some sort which has a built in logging system and it is published as Library.Core. As the maintainer you want to add a wrapper ...
Twenty's user avatar
  • 121
-6 votes
1 answer
230 views

First, the most obvious grouse someone has against this I can think of is the intricacies of an actual method. It's not enough to merely ensure no errors are thrown. Functions usually contain ...
I Want Answers's user avatar
23 votes
8 answers
6k views

I have a C header that is generated from a CSV file and a Python script. The C header mainly contains a list of #define constants. I want to be able to detect manual changes to this header during ...
9a3eedi's user avatar
  • 2,099
8 votes
3 answers
2k views

In this and this stack overflow questions, the answers state that C as a compiler backend is a bad idea. But why? C has many compilers that can heavily optimize it. Every platform has a compiler ...
Kied Llaentenn's user avatar
3 votes
4 answers
1k views

I am working at a medium-size semi-govermental organization managing subcontractors for software projects. One of our contractors recently turned in the "source code" for the project they had ...
humblemike's user avatar
1 vote
0 answers
119 views

It seems pretty common knowledge that code is read far more than it is written. Does this mean that if a tool produces code that's checked in, then it's a net negative (saves the author some time in ...
user avatar
-2 votes
1 answer
238 views

I am writing drivers for different devices to work with my embedded system. Currently I write any new driver manually but for the future I would like to automate this using a settings file. I figure I ...
Nader's user avatar
  • 119
3 votes
1 answer
1k views

In my company, I'm currently working on a project with some (REST) web services involved. The development is based on the OpenAPI specification and the Swagger tooling. The target platform is an ...
Matthias Preu's user avatar
-1 votes
1 answer
863 views

I am writing a simple compiler. I have written lexer and parser and it now generates assembly code from given code. Now I need to write an assembler which generates machine code. But the problem is ...
Greatcode's user avatar
4 votes
3 answers
875 views

where I currently work, there is a team that uses code-generation to generate slight variations of a program. I find this a little bit awkward. I can imagine using code generators that produce complex ...
Zavulon's user avatar
  • 51
138 votes
27 answers
33k views

If something can be generated, then that thing is data, not code. Given that, isn't this whole idea of source code generation a misunderstanding? That is, if there is a code generator for something, ...
0 votes
1 answer
1k views

Presume this situation: Max Number of 256 key slots. Key slots are defined by a struct, and a variable for each (256) has to exist. User defines which keys slots are active at initiation (in my ...
Anon's user avatar
  • 3,649
8 votes
4 answers
4k views

My team doesn't write tests for generated code (e.g. some POJOs). An engineer that I greatly respect recently wrote this on the subject: Research over the past 10 years has revealed that generated ...
Justin R.'s user avatar
  • 189
1 vote
3 answers
747 views

I have written a code generator for my company, that basically has the following workflow: entity xml definition | v gets ...
Dominik Reinert's user avatar
5 votes
3 answers
651 views

How do game makers/engines like Buildbox, GameSalad, Construct, GameMaker, etc work in principle? I am not interested in getting a list of technologies (programming languages, APIs, etc), but how - ...
Sean Nam's user avatar
6 votes
3 answers
872 views

I'm writing a compiler that compiles to C. This means that most of the time I piggyback on top of C for optimisations and generating code for multiple platforms. Right now I can think of a few ...
flooblebit's user avatar
3 votes
1 answer
557 views

I'm working with Swagger to generate the API of my application. Swagger is an API specification language that can be used by a code generator to generate code stubs for your application. Obviously you ...
David George's user avatar
4 votes
3 answers
3k views

How is Bytecode "parsed"? It is my understand that Bytecode is a binary, intermediate representation of the syntax of a given programming language. Certain programming languages convert their source ...
Chris's user avatar
  • 2,860
11 votes
1 answer
10k views

I have simple POCO classes, like this: public class Book { public string BookId { get; set; } public string Name { get; set; } //etc... } I want to get all those classes and generate ...
Yurii N.'s user avatar
  • 341
6 votes
1 answer
462 views

I'm writing a compiler that compiles to C, one thing I'm attempting to do is implement a construct like Rust's match: // { some function let mut foo = 32; match foo { 3 => return "...
Jon Flow's user avatar
  • 383
0 votes
1 answer
1k views

I am recently developing multi-tents cloud application that can help to generate classes and dbcontext dynamically for other ASP MVC projects. How can I do this task from my application to another ...
Kerlis's user avatar
  • 9
0 votes
2 answers
126 views

Have been hired to modernize an old binary compiler that has been forgotten since a few years by people who have died already. The compiler has a parser, an objectmodel and a generator of ...
Grim's user avatar
  • 262
5 votes
2 answers
11k views

For a scientific simulation I need to write some computations in C++. Since this became extremely tedious, I built myself a small code generator: In a scripting language (Python) you put together a ...
Michael's user avatar
  • 225
10 votes
5 answers
4k views

Consider a situation where a class implements the same basic behavior, methods, et cetera, but multiple different versions of that class could exist for different uses. In my particular case, I have a ...
Parker Hoyes's user avatar
2 votes
1 answer
146 views

I'm using a code generator which has the following workflow: Configure stuff Generate code Modify generated code with user code at specifically annotated positions. If changes are required to the ...
Frank Kusters's user avatar
2 votes
1 answer
307 views

(preface - boring stuff, feel free to skip down to the implementation details) I need to provide exception handling to a language I am working on. It "compiles" to a subset of C, and since I ...
dtech's user avatar
  • 763
1 vote
1 answer
128 views

I'm looking for an algorithm that can generate optimized syntactically valid variable names (for javascript in this case) without collisions. So as general rule I would want something that generated ...
user254694's user avatar
1 vote
0 answers
152 views

I will approach this from two directions (+ raw HTML itself being de-facto third) Proprietary HTML-generating code Code generating facilities provided by a popular library Proprietary HTML-generating ...
Dennis's user avatar
  • 8,267
5 votes
2 answers
283 views

A significant portion of the application I work on every day consists of Javascript that outputs a lot of (what might as well be) Excel spreadsheet formulas. Yes, Excel is barely a Turing-complete ...
Ixrec's user avatar
  • 27.7k
33 votes
6 answers
10k views

Why not have the compiler take a program like this: function a(b) { return b^2 }; function c(b) { return a(b) + 5 }; and convert it into a program like this: function c(b) { return b^2 + 5 }; ...
moonman239's user avatar
  • 2,063
7 votes
1 answer
2k views

Right now this is just a crazy idea that I had, but I was able to implement the code and get it working properly. I am not entirely sure of what the use cases would be just yet. What this code does ...
bazola's user avatar
  • 255
1 vote
2 answers
222 views

Lately I've been playing with CSS (and other web technologies). I'm a non-web programmer, and probably this is influencing way too much my approach. I found CSS syntax very limited, thus gave a shot ...
peoro's user avatar
  • 273
7 votes
2 answers
3k views

We're trying to plan how to mash together a build server for our shiny new Java backend. We use a lot of JAXB XSD code generation and I was getting into a heated argument with whoever cared that the ...
Peter Turner's user avatar
  • 6,985
22 votes
4 answers
71k views

Is there an easy way to visualize the step between assembling code to machine code? For example if you open about a binary file in notepad you see a textually formatted representation of machine code....
user12979's user avatar
  • 375
12 votes
2 answers
1k views

tl;dr Some widely used programs, which generate html, will only generate opening paragraph tags, and not closing ones, assuming that the browser will properly close paragraphs. On the face of it, it ...
blueberryfields's user avatar
6 votes
4 answers
2k views

I am looking to create a simple code generator to convert XSD definitions to C# classes. This is partly as a learning exercise, but I would also like to get some practical use out of it eventually. ...
Robert Harvey's user avatar
10 votes
4 answers
2k views

This is part of a series of questions which focuses on the sister project to the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. The ...
2 votes
4 answers
2k views

We have a project that was written over a period of 2 years, but has a poorly designed architecture and not unit tests. The software works well, but we're at the point where we want to refactor some ...
zavg's user avatar
  • 121
51 votes
5 answers
15k views

I'm developing a .Net application that uses google protocol buffers. Historically the application used the approach, advocated by the protobuf-net team, of decorating the classes with attributes ...
Dave Hillier's user avatar
  • 3,938