Effortless MATLAB Solutions: AI Code Generator Tool
https://zurl.co/RA7ha
#MATLAB #CodeGenerator #AITool #Efficiency #Technology #Programming #Automation #Productivity #Innovation #Solutions
Effortless MATLAB Solutions: AI Code Generator Tool
https://zurl.co/RA7ha
#MATLAB #CodeGenerator #AITool #Efficiency #Technology #Programming #Automation #Productivity #Innovation #Solutions
Thanks to @made I recently learned that dynamic code generation doesn't play nice with certain Content Security Policies (CSP). This has a major impact on a few core packages in #ThingUmbrella, like the https://thi.ng/vectors package which contains ~900 vector functions, most of them code generated and optimized for different vector sizes/dimensions (incl. n-dimensional versions). This package (and some others using a similar approach) are key dependencies for dozens of other geometry/visualization related packages... However, I found code generation the only way to practically manage & maintain the sheer amount of functionality provided.
Because of this (CSP impact), I've been working on a new code generator, which converts the dynamically generated code into statically generated source code files. This will make the overall initial package size bigger, but this shouldn't be a major problem in practice, since there're also very positive effects, including:
- The new format allows for doc strings for _all_ generated vector ops (with the dynamic approach there was no way to properly attach those in TypeScript)
- The new file structure (single function per source file) massively helps with dead code elimination when using a bundler, resulting in smaller final file/bundle sizes. When NOT using a bundler, similar filesize savings can be had by using direct imports (to individual functions) rather than full package imports
- None of the unused versions need to be code generated at runtime anymore, so also improving startup time
The new codegen is already covering around more than a third of the 900 ops. If you want to keep an eye on progress & discussion, follow this issue:
Lapidary-render 0.12.0 is now released.
To the best of my knowledge it's the only #codeGenerator that properly handles #jsonSchema anyOf and allOf.
Also has support for oneOf, but not per the specs.
https://github.com/python-lapidary/lapidary-render/releases/tag/v0.12.0
How to structure a #python project with both generated and authored code?
Python tools don't handle well anything other than $root/$package or $root/src/$package
Code generator removes files that it finds, assuming they're outdated
editors can handle a separate subdirectory, but using linter or tests would required synchronizing that directory with the main source directory.
Each of these solutions sucks.
I'm thinking of designating special sub-package `extras` would do the work, it wouldn't clash with generated code, but perhaps others have better ideas.
I wanted to build a #python client for some #openSource project that offers a good #openApi 3.0 description - just to test my generator on real-live service, but also to support the community.
I looked at @forgejo but it turns out it uses swagger 2. I didn't realise #golang was old enough...
Any way, other ideas would be very welcome.
Effortless MATLAB Solutions: AI Code Generator Tool
Generate MATLAB code solutions effortlessly with our AI tool.
https://zurl.co/6y8eG
#MATLAB #CodeGenerator #AITool #Efficiency #Technology #Programming #Automation #Productivity #Innovation #Solutions
Did some further updates to the #TypeScript code generator for #WASM bindings (https://thi.ng/wasm-api-bindgen) and released new versions of all https://thi.ng/wasm-api packages. The new codegen creates even smaller code (approx. -20%), achieved via better re-use of newly introduced helper functions to reduce boilerplate...
These changes will have compounding effects for larger numbers (or complexities) of generated types, especially those involving structs with string fields and/or arrays/slices...