https://0hmx.com/artifacts/tscircuit function based component contracts/?draft=alpha1 is this what providers want when they what to convert datasheet rules into actual rules?
https://0hmx.com/artifacts/tscircuit-function-based-component-contracts/?draft=alpha1
is this what providers want when they what to convert datasheet rules into actual rules?
yes, but....
i can say with some confidence that it's a bad idea to introduce a DSL, working within TSX is the only way that things won't get out of hand with training data etc.
so you want to create the schema to represent 99% of the checks that manufacturers have. We don't want people defining custom functions often, and when they do, we want it to be in such a way that implementations can't differ greatly
It's tempting to introduce a DSL-function system but it would be self-sabotage. TSX is the way to go
It is actually not smarter to create generic systems- this is a trap that our competitors fall into. It is far, far harder to design an API with great terms that represent the manufacturer's intent.
e.g. `<pinrequirement requirementType="requiresEnablePin" pinRef="U1.ADC1" enablePinRef="U1.EN_ADC1" />`
Of course generic checks should be possible in userland. But there are far more variants of the function-DSL representation than the TSX representation
Seve
This is related to the bull-Bun argument. "Why should bun have a large standard library?"
0hmx
> e.g. <pinrequirement requirementType="requiresEnablePin" pinRef="U1.ADC1" enablePinRef="U1.EN_ADC1" />
I think I get the idea!
But chip-level DRC could be difficult, especially for cases like the example in the blog.
It could also extend the existing `<drccheck />` tag. I didn’t know we already had this tag; otherwise, I probably would have designed the API differently.
but do you think the 2 example that we picked is a real case to handel?
0hmx
The big idea I have in mind is to convert these datasheet rules into component-level DRCs. Since tscircuit is so easy to share, I think this could become something really unique to us.
Seve
I mean the AM3552 is probably going to be something we play with for a while
Seve
it has a massive list, i think i scrolled through it in the last meeting recording
Seve
i will get you a link
Seve
yea i think basically when we ship a chip re-usable module, we include <drccheck /> or other elements
Seve
keeping the representation minimal and extremely explicit is how we'll be able to represent the most rules. Typescript functions are crazy flexible, and we should support them, but the same way we compress and standardize footprints we should apply for DRC rules
Seve
it's also just a lot easier to ask an AI to identify all the pinrequirements for a pin then have a super testable TSX outcome
Want to add to the conversation?
Reply in Discord so your notes stay connected to the source.