Draft
Conversation
Create comprehensive plan to expand reflection system beyond the current minimal Builtin.reflect. Plan includes: - Adding 3 new core builtins (reflectType, typeOf, typeName) - Creating Darklang.LanguageTools.Reflection package with helpers - Adding tests and demos for reflection capabilities - Writing CLI integration report exploring reflection use cases - Keeping F# code changes minimal and focused Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Added three new builtins to Reflection.fs: - Builtin.reflectType: Get ValueType without full Dval structure - Builtin.typeOf: Human-readable type names (e.g., 'Int64', 'List<String>') - Builtin.typeName: Extract FQTypeName for custom types (records/enums) - Created comprehensive Darklang.LanguageTools.Reflection package module: - Type checking helpers: isPrimitive, isCollection, isCustomType, isFunction - Type-specific checks: isList, isDict, isTuple, isRecord, isEnum - Data extraction: getFields, getCaseName, getListElementType, getDictValueType - Added reflection-demo.dark with practical examples: - Type-aware pretty printing - Type validation and serialization checks - Metadata extraction from custom types - Schema inference for collections - Added comprehensive tests: - stdlib/reflection.dark: Tests for all new builtins with primitives, collections, and custom types - cli/reflection-test.dark: CLI integration test demonstrating reflection usage - Created reflection-cli-integration.md report analyzing: - CLI command ideas (inspect, type, debug, infer-schema, validate) - REPL enhancements with type display - App/editor integration possibilities (hover types, value inspector, auto-completion) - Implementation priorities and technical considerations Key design decisions: - Minimal F# code impact (only 3 new builtins in Reflection.fs) - Most functionality in Darklang package code for flexibility - Focused on practical, useful reflection operations - Lightweight alternatives to full reflection for performance Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We had a
Builtin.reflect. I had AI think: what similar things might we find useful?