Ask Lemmy
A Fediverse community for open-ended, thought provoking questions
Rules: (interactive)
1) Be nice and; have fun
Doxxing, trolling, sealioning, racism, and toxicity are not welcomed in AskLemmy. Remember what your mother said: if you can't say something nice, don't say anything at all. In addition, the site-wide Lemmy.world terms of service also apply here. Please familiarize yourself with them
2) All posts must end with a '?'
This is sort of like Jeopardy. Please phrase all post titles in the form of a proper question ending with ?
3) No spam
Please do not flood the community with nonsense. Actual suspected spammers will be banned on site. No astroturfing.
4) NSFW is okay, within reason
Just remember to tag posts with either a content warning or a [NSFW] tag. Overtly sexual posts are not allowed, please direct them to either [email protected] or [email protected].
NSFW comments should be restricted to posts tagged [NSFW].
5) This is not a support community.
It is not a place for 'how do I?', type questions.
If you have any questions regarding the site itself or would like to report a community, please direct them to Lemmy.world Support or email [email protected]. For other questions check our partnered communities list, or use the search function.
6) No US Politics.
Please don't post about current US Politics. If you need to do this, try [email protected] or [email protected]
Reminder: The terms of service apply here too.
Partnered Communities:
Logo design credit goes to: tubbadu
view the rest of the comments
Is automatic code generation LLM?
I'd be into a video about how to do that without falling into the pitfalls
Not at all. In my case, automatic code generation is a process of automated parsing of an existing Ruby on Rails API code plus some machine-readable comments/syntax I created in the RoR codebase. The way this API was built and versioned, no existing Gem could be used to generate docs. The code generation part is a set of C# "templates" and a parser I built. The parser takes the Ruby API code plus my comments, and generates unit and integration tests for nUnit. This is probably the most common use case for automatic code generation. But... doesn't building unit tests based on existing code potentially create a bad unit test? I'm glad you asked!
The API endpoints are vetted and have their own RoR tests. We rebuilt this API in something more performant than Ruby before we moved it to the cloud. I also built generators that output ASP.NET API endpoint stubs with documentation. So the stubs just get filled out and the test suite is already built. Run Swashbuckle on the new code and out comes the OpenAPI spec, which is then used to build our documentation site and SDKs. The SDKs and docs site are updated in lockstep with any changes to the API.
Edit: extra word and spaces
That is really cool! I am not educated enough to understand details. But is it similar to how a compiler uses high level syntax to generate low level assembly code?
Is compiling a type of automatic code generation?
This is an apt comparison, actually.
This is also an apt comparison. Most modern languages are interpreted rather than compiled. C#*, Java, Ruby, Python, Perl... these all sit on top of runtimes or virtual machines such as .NET or JVM. Compilation is a process of turning human-readable language into assembly. Interpreting turns human-readable programming language into instructions for the runtime; in the case of .NET, C# gets interpreted into MSIL which tells the .NET runtime what to do, which in turn tells the hardware what to do.
Automatic code generation is more of "Hey computer, look at that code. Now translate that code to do different things, but use these templates I made."
FWIW, compilers was two semesters in engineering school, so I'm trying to keep this discussion accessible.
*Before anyone rightfully and correctly jumps on my shit about C#, yes, I know C# is technically a compiled language.
Thanks, this is all very interesting. I never knew what .NET was before. Now it makes sense that programs require you to host the specific runtime required for that version of the instructions for the runtime to work.