4 ms·
This has been done many times before. I (for example) use a code generator I wrote myself to generate 80% of new biz applications. It is a very powerful tool.
by deterministic 4y ago
This has been done many times before. I (for example) use a code generator I wrote myself to generate 80% of new biz applications. It is a very powerful tool.
However I have never used it for work because most of the stuff I work on is old but highly valuable code.
- xcubic 3y agoCan you share more details about what makes it powerful? Is it open source? You got me curious!
- deterministic 3y agoI haven’t published it. I don’t want to spend time supporting it. It is quite simple though: 1. Decide on an architecture that scales well. 2. Redesign the architecture to maximise opportunities for auto generating code/schemas/protocols/client/server/DB etc. 3. Define your actual application in a declarative language. I use my own custom language but you can use JSON/YAML/… 4. Write a generator that reads the declarative files and generates as much of the code needed as possible to implement the application. 5. Hand code what remains (basically the core biz logic). That’s pretty much it. I have done this exercise more than 9 times and I learned a lot doing it. I highly recommend giving it a go yourself. You learn a true super power and it is great fun.
- xcubic 3y agoInteresting! I actually do something quite similar, which is why I created this code generator https://github.com/mintyPT/sal https://github.com/mintyPT/sal (still need to finish v2) How long have you been going this? You create a custom language instead of using json or yaml?
- deterministic 3y agoYeah I maintain compilers for a living so throwing together a parser for my own custom language is fun and quick. The custom language is just event definitions, state machines etc. Nothing complicated.