jezza / def_mod Goto Github PK
View Code? Open in Web Editor NEWA proc macro that simplifies implementation routing and statically verifies module exports.
License: MIT License
A proc macro that simplifies implementation routing and statically verifies module exports.
License: MIT License
Github repository lacks some metadata.
Should be something like
a Rust proc macro allows to forward-declare a module interface and route it to specific implementation depending on cfg.
Now, as I write this, I honestly believe it's not possible...
At least, not without a great deal of work.
I think the solution would, at the very least, involve a compiler plugin, but there's definitely some things that are working against us here.
First hurdle:
We need to look at what things a module exports.
Now, in a very simple case, we could just look at the file, inspect the contents, and determine what types and methods it exported.
Programmatically, of course.
Where things start getting difficult is when it's more complex than just exporting a type that was declared in the module.
What if someone exports a type from a library?
And that library isn't available on the given system, because it's on a different os?
Honestly, I think it's not possible simply due to how... well, logic works.
I can't access and inspect something that isn't there...
There's definite solutions that get us halfway, such as the aforementioned scraping, but that's going to be nothing more than superficial at best.
If anyone has any ideas about how to implement this nicely, or I've misunderstood accessibility, please do chime in.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.