Renamed to Typia
https://github.com/samchon/typia
Hello, I'm developer of typescript-json typia.
In nowadays, I've renamed typescript...
For further actions, you may consider blocking this person and/or reporting abuse
This looks great!
Does the
ismethod support TS interfaces or just classes that exist during runtime? I ask because I played around with type guards for interfaces using code generation to create runtime representations of interfaces, and I wonder if that's somethingtypiadoes.I worked with TS in the past and now I work with Java and protocol buffers, where I also did code generation based on generated
MessageJava subclasses. Interesting to see what protobuf looks like in TS.Yes, this is a transformer library generating validation script by analyzing TypeScript type. If you're wondering how
typiagenerates protobuf message, reference test automation code.I know automatically generated message by current
typiais so ugly yet, but it would be reasonable. Also, as you are interested in protobuf, you may understand howtypiaimplemented non-protobuf supported type through detour expression.github.com/samchon/typia/tree/feat...
In another community, someone asked me the reason why such performance gap.
It's my answer and I also paste it here
dev.to"15,000x faster" is just a benchmark program result and such different is not weird considering principle of v8 optimization. It is enough reasonable and descriptable.
typiaperforms AOT compilation through TypeScript APIajvandtypeboxperforms JIT compilation through eval() functionclass-validatorabuses for in statement and dynamic [key, value] allocation in every stepV8 engine optimizes object construction by converting to a hidden class and avoid hash map construction for taking advantages of static class definition. However, if
for instatement or dynamic key allocation being used, v8 cannot optimize the object.The secret of extremely slow validation speed of
class-validatoris on there.class-validatorutilizes the un-optimizable in every process.For reference,
ajvandtypeboxare using JIT compilation, generating optimized code in runtime througheval()function (ornew Function(string)statement). In v8 engine, priority of optimization is the lowest and it is the principle reaon whytypiais faster than suchajvandtypeboxlibraries.Another reason is how to optimize object accessment. You can see the detailed story about it from below link (this article)
great job with this library🎉 will definitely give it a try.
I am proud to be your first comment.
There's too much I don't understand about your post 😅
But I recognize that there is genius here. And
typiawill be very famous 💙🔥As I've promised, wrote an article introducing how to use
typiainNestJS.dev.to/samchon/nestia-boost-up-you...
Can it replace the tsc? Very exciting project and I can't wait to try it out.
Well, this is not a project for replacing
tsc(TypeScript Compiler).Thanks for the interesting material, I use ajv actively, it's definitely worth it