SaaSHub helps you find the best software and product alternatives Learn more →
Top 23 Reflection Open-Source Projects
-
Project mention: Using Jolt with flecs & Dear ImGui: Game Physics Introspection | dev.to | 2024-04-17
EnTT is a popular alternative to flecs for C++, which has different performance/memory characteristics.
-
that's surprising considering `pry`[1] is such an amazing debugger IMO.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
Magic Enum C++
Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code
Project mention: What C++ library do you wish existed but hasn’t been created yet? | /r/cpp | 2023-07-08I'm not sure this is quite what you're asking for, but this library has been super helpful to me in the past : https://github.com/Neargye/magic_enum
-
Counter to this post, as soon as I read the title I knew what this was, & I knew it was speaking exactly to something we've wanted for a long time. This is asking for more official & better supported https://github.com/rbuckton/reflect-metadata .
TypeScript is a compiler. It has a lot of type information during compilation. We could write that type information out into a file. Instead what we do is throw that information out when the compile ends. Taking all that typing information & throwing it away at the end of compile time is a bad dumb & silly limitation. Especially for a language like JavaScript, which historically could be semi-proud it had such a strong Everything Is An Object philosophy running through it (such as the malleable prototype-based inheritance system); so much type information should be on that Class object. Reflect-metadata for example defined new methods on Reflect to store this metadata.
I could not be more delighted to see the pennon of this website go up. We needed a rallying point for this. We needed a rallying point for keeping class data around. A rallying point for enriching the runtime with good actionable data is a good rallying point.
It's not what's afoot here, but I think you're a bit off-base about the impossibility of adding even some type-safety. We might not be able to get exact TS type safety. But we can definitely build some safety in. Owing to the malleable prototype-based type system in JS, we can add getters/setters to objects to do a lot of type checking. This doesn't even begin to explore the possibility of what we might do with es2015's proxies, which could allow even more interesting checks to be layered in. I also wish JS had an official AST (and renderer), so had more official options for code-rewriting that might let us weave in type checks.
What we can do as programmers is limited by what we have at our disposal. Not throwing out all the typing information, keeping it around at runtime, opens a lot of interesting doors.
-
-
Nameof C++
Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
-
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
I really like better_enums instead of magic_enums. There’s no limit on enum size with it: http://aantron.github.io/better-enums/
It was heavily used at a former employer of mine, so definitely a solid production-ready solution.
-
Project mention: How Do Nested Static Generic Types Work When Their Outer Types Are Also Generic? | /r/csharp | 2023-04-25
Your example runs as I'd expect. I'm using DotNext's TypeMap and am not understanding why underlying arrays (entries) are indexed differently for two instances of the same type am seeing what I expected. I obviously idioted.
-
This single feature opens a world of new possiblities. For example, it makes implementing "getting the number of fields" trivial. Furthrmore, and much more importantly, it enables turning a struct into a tuple. Currently, this can only be done by enumerating cases (therefore it's not fully generic), as with Boost PFR. By the way, PFR greatly simplifies our codebases, especially for parts with serialization and/or reflection.
-
Runtime
A Swift Runtime library for viewing type info, and the dynamic getting and setting of properties. (by wickwirew)
-
-
refl-cpp
Static reflection for C++17 (compile-time enumeration, attributes, proxies, overloads, template functions, metaprogramming).
Project mention: Out of bounds memory access in V8 in Google Chrome prior to 120.0.6099.224 | news.ycombinator.com | 2024-01-25You'd be surprised how much friction you'd have for C++ reflection. First, since it's a custom build step, you can do a mix of custom code gen and C++ constexpr/consteval for static reflection. Here's a header-only implementation for adding compile time reflection purely within the language [1]. And v8 already does dynamic code gen as part of its build process (to generate the snapshot to speedup instantiation of the isolate). Dynamic reflection is a must since JS is a dynamic language with reflection support.
Now of course, I don't know the specific details of reflection needed for the abstractions you reference and clearly V8 is still doing some amount of manual IR generation, so it's possible it would be a substantial investment to actually retrofit those techniques into v8. One would have to do a careful analysis of historical security exploits & specific techniques and their ability to prevent to figure out if it's worth adding those abstractions (especially since there is a potential performance tradeoff as you mention). As I said, I think there's insufficient research in this area to establish a compelling body of best practices (not to take away from the contributions of the GraalJS team to this space).
-
EVReflection
Reflection based (Dictionary, CKRecord, NSManagedObject, Realm, JSON and XML) object mapping with extensions for Alamofire and Moya with RxSwift or ReactiveSwift
-
Project mention: tRPC – Move Fast and Break Nothing. End-to-end typesafe APIs made easy | news.ycombinator.com | 2023-08-12
DX for front or back end? The beauty of tRPC is that the types are derived/inferred from the backend runtime code (like, as you type). It would be nigh impossible to do that with grpc(-web) using proto files as the source of truth.
It's possible there's a project out there which could automatically produce proto files from something like zod, json-schema, etc. which could be directly interpreted by TS to provide similar (as you type) DX while still allowing some other language backend to consume the derived proto files (though the DX there would be less than ideal).
If you're just looking for similar TS clients/interfaces for grpc-web then I'd recommend https://github.com/timostamm/protobuf-ts which operates on plain JS objects (no new MyMessage().serialize(), instead the code generator mostly produces TS interfaces for you to work against: const myMessage: MyMessage = pojoConformingToInterface; const binary = MyMessage.toBinary(myMessage);)
-
-
-
Project mention: Pepe Inu🐸 | 280K Mcap Gem | born on 4/20 | building the next Memetoken🚀 | ETH | /r/AllCryptoBets | 2023-04-25
Techrate.org (http://techrate.org/) Smart Contract Audit
-
ExpressionEvaluator
A Simple Math and Pseudo C# Expression Evaluator in One C# File. Can also execute small C# like scripts
-
It's also not a big risk because if it does fail it will fail every time you just load the class that implements the interface so probably your while site will error. If you do cursory testing of the new version before you deploy it you can find the problem quickly before it becomes a problem. You can also do static analysis checks on your code to make sure its compatible with the libraries you use including when you upgrade them. And library maintainers can run Roave/BackwardCompatibilityCheck/ to make sure they don't accidentally introduce a new interface method without declaring a new major version.
-
-
Serilog.Exceptions
Log exception details and custom properties that are not output in Exception.ToString().
Project mention: How can I fix logger maximum destructuring reached error when using Serilog C#? | /r/csharp | 2023-05-11You might also wanna check out Serilog.Exceptions if not already using it. I think that they have some examples of how you could intercept these yourself.
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
Reflection related posts
- Out of bounds memory access in V8 in Google Chrome prior to 120.0.6099.224
- Rooting for P1061 "Structured Bindings can introduce a Pack"
- What C++ library do you wish existed but hasn’t been created yet?
- A basic reflection-like system for editing object fields in a C++ game engine
- How can I fix logger maximum destructuring reached error when using Serilog C#?
- Compile-Time 'Fun' with Std.ranges
- How Do Nested Static Generic Types Work When Their Outer Types Are Also Generic?
-
A note from our sponsor - SaaSHub
www.saashub.com | 18 Apr 2024
Index
What are some of the best open-source Reflection projects? This list will help you:
Project | Stars | |
---|---|---|
1 | entt | 9,428 |
2 | Pry | 6,715 |
3 | Magic Enum C++ | 4,390 |
4 | reflect-metadata | 3,119 |
5 | rttr | 2,971 |
6 | Nameof C++ | 1,933 |
7 | cista | 1,638 |
8 | Better Enums | 1,590 |
9 | dotNext | 1,510 |
10 | pfr | 1,257 |
11 | Runtime | 1,056 |
12 | schemats | 1,024 |
13 | refl-cpp | 986 |
14 | EVReflection | 965 |
15 | protobuf-ts | 939 |
16 | glaze | 882 |
17 | Reflection | 600 |
18 | Smart-Contract-Audits | 562 |
19 | ExpressionEvaluator | 562 |
20 | BackwardCompatibilityCheck | 558 |
21 | reflections | 503 |
22 | Serilog.Exceptions | 478 |
23 | harmony-reflect | 469 |