Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1025,8 +1025,34 @@ if(BUILD_TESTING)
add_test(NAME nil.semantic-index
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/semantic_contract.py"
--compiler $<TARGET_FILE:nilcompiler>)
add_test(NAME nil.completion
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/completion_contract.py"
--compiler $<TARGET_FILE:nilcompiler>)
set_tests_properties(nil.completion PROPERTIES LABELS "analysis;semantic" TIMEOUT 90)
add_test(NAME nil.member-completion
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/member_completion_contract.py"
--compiler $<TARGET_FILE:nilcompiler>)
set_tests_properties(nil.member-completion PROPERTIES LABELS "analysis;semantic" TIMEOUT 120)
add_test(NAME nil.signature
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/signature_contract.py"
--compiler $<TARGET_FILE:nilcompiler>)
set_tests_properties(nil.signature PROPERTIES LABELS "analysis;semantic" TIMEOUT 90)
add_test(NAME nil.module-context
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/module_context_contract.py"
--compiler $<TARGET_FILE:nilcompiler> --interpreter $<TARGET_FILE:nilinterpreter>
--llvm "${NIL_ENABLE_LLVM}")
set_tests_properties(nil.module-context PROPERTIES LABELS "analysis;typecheck;routes" TIMEOUT 120)
set_tests_properties(parser.source-spans parser.matrix-source-spans nil.semantic-index
PROPERTIES LABELS "analysis;semantic" TIMEOUT 60)
add_test(NAME matrix.function-values
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/matrix/function_value_contract.py"
--compiler $<TARGET_FILE:nilcompiler> --interpreter $<TARGET_FILE:nilinterpreter>)
set_tests_properties(matrix.function-values PROPERTIES LABELS "matrix;analysis;interpreter" TIMEOUT 60)
add_test(NAME matrix.named-arguments
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/matrix/named_argument_contract.py"
--compiler $<TARGET_FILE:nilcompiler> --interpreter $<TARGET_FILE:nilinterpreter>
--stdlib "${CMAKE_CURRENT_SOURCE_DIR}/nilstd/src" --llvm "${NIL_ENABLE_LLVM}")
set_tests_properties(matrix.named-arguments PROPERTIES LABELS "matrix;analysis;routes" TIMEOUT 120)
add_test(NAME nil.reflection-consumer
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/reflection_contract.py"
--compiler $<TARGET_FILE:nilcompiler> --interpreter $<TARGET_FILE:nilinterpreter>
Expand Down Expand Up @@ -2324,6 +2350,8 @@ if(BUILD_TESTING)
set_tests_properties(ny.qualified-enum-contract PROPERTIES
LABELS "typecheck;analysis;rc" TIMEOUT 120)
foreach(parity_fixture IN ITEMS scientific-literals scientific-literals-matrix
formatted-text formatted-text-matrix
signed-numbers-matrix
integer-literal-widths integer-literal-widths-matrix
checked-text-spans checked-text-spans-matrix
checked-i64-conversion checked-i64-conversion-matrix
Expand Down Expand Up @@ -2360,6 +2388,26 @@ if(BUILD_TESTING)
LABELS "tools;native;rc" SKIP_RETURN_CODE 77 TIMEOUT 240)
endif()
endforeach()
add_test(NAME nil.formatted-text-contract
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/formatted_text_contract.py"
--compiler $<TARGET_FILE:nilcompiler> --llvm "${NIL_ENABLE_LLVM}")
set_tests_properties(nil.formatted-text-contract PROPERTIES
LABELS "ny;matrix;analysis;interpolation" TIMEOUT 120)
if(TARGET nilassembler AND TARGET nillinker)
add_test(NAME nil.formatted-nil-contract
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/formatted_nil_contract.py"
--interpreter $<TARGET_FILE:nilinterpreter> --assembler $<TARGET_FILE:nilassembler>
--linker $<TARGET_FILE:nillinker> --runtime $<TARGET_FILE:nilruntime>
--llvm "${NIL_ENABLE_LLVM}")
set_tests_properties(nil.formatted-nil-contract PROPERTIES
LABELS "nil;native;interpreter;interpolation" TIMEOUT 120)
endif()
add_test(NAME nil.tuple-contract
COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/tuple_contract.py"
--compiler $<TARGET_FILE:nilcompiler> --interpreter $<TARGET_FILE:nilinterpreter>
--llvm "${NIL_ENABLE_LLVM}")
set_tests_properties(nil.tuple-contract PROPERTIES
LABELS "ny;matrix;analysis;tuples;routes" TIMEOUT 180)
add_test(
NAME ny.scientific-literals-contract
COMMAND "${Python3_EXECUTABLE}"
Expand All @@ -2369,6 +2417,15 @@ if(BUILD_TESTING)
)
set_tests_properties(ny.scientific-literals-contract PROPERTIES
LABELS "typecheck;analysis;rc" TIMEOUT 120)
add_test(
NAME matrix.signed-numbers-contract
COMMAND "${Python3_EXECUTABLE}"
"${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/matrix_signed_numbers_contract.py"
--compiler $<TARGET_FILE:nilcompiler>
--llvm "${NIL_ENABLE_LLVM}"
)
set_tests_properties(matrix.signed-numbers-contract PROPERTIES
LABELS "matrix;typecheck;analysis;rc" TIMEOUT 120)
add_test(
NAME ny.integer-literals-contract
COMMAND "${Python3_EXECUTABLE}"
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ original team and the community.
- Ryan Nierman
- Elizabeth Young
- Eli Young
- Miguel Petersen

## Community contributors

Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ The framework includes:
- **Systems programming facilities.** Typed scalar and bitwise operations,
raw pointers, managed values, checked local ownership of scalar buffers,
typed faults, and bounded parallel execution.
- **Shared language features.** Structural tuples provide typed multiple
results and local destructuring. Explicit string interpolation supports
expressions with consistent scalar formatting across execution routes.
- **A shared standard library.** `nil.std.*` provides collections, text,
mathematics, binary I/O, diagnostics, and reflection, alongside SQLite and
PostgreSQL access. Existing `ny.lang.*` imports remain compatible aliases.
Expand All @@ -85,6 +88,7 @@ The framework includes:
Live editor analysis includes unsaved source dependencies through a shared
workspace snapshot. Compiler-resolved source bindings support Go to Definition
for local variables, parameters and imported functions across both languages.
Certified local variables also support references and checked rename.

See the [standard-library reference](docs/standard-library/index.md),
[analysis API](docs/analysis-api.md), and [tool reference](docs/tools/index.md)
Expand Down Expand Up @@ -141,7 +145,11 @@ The [VS Code extension](vscode/README.md) supports both languages with syntax
highlighting, completion, compiler diagnostics, quick fixes, build tasks, and
source debugging. Follow its installation instructions, then set `ny.sdkPath`
to the SDK directory. The extension also discovers `sdk/` when working in this
repository.
repository. Compiler-backed completion includes visible locals, imported functions
and supported receiver members. Signature help follows resolved call parameters,
including Matrix named arguments. Definition navigation follows
checked bindings across both languages; references and rename are available for
locals whose complete occurrence sets the compiler can certify.

For projects with multiple source modules, add a
[`nil.project.json`](docs/tools/projects.md) manifest. Project check, build and
Expand Down
13 changes: 12 additions & 1 deletion docs/advanced/nil-format.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Executable NIL format and compatibility

NIL is Ny's stack-machine intermediate representation. Text and binary
NIL is the shared stack-machine intermediate representation for Ny and Matrix. Text and binary
executables carry the same schemas, function declarations, constants and
instructions in the current compiler. They are inputs to `nilinterpreter` and
`nilassembler`; the latter emits an ordinary host object for `nillinker`.
Expand All @@ -17,6 +17,9 @@ instructions in the current compiler. They are inputs to `nilinterpreter` and
| Class-bearing library | 4 / 1 | V3 records, embedded sources, and class declarations; the same source-bootstrap import contract |

Version numbers describe file layouts, not language or release versions.
The optional type-annotation flag (`2`) adds annotations to schema records;
it combines with the library flag (`1`). For example, generated tuple schemas
carry `@nil_tuple`, so an ordinary tuple executable uses version/flags `3 / 2`.
Readers reject unknown versions/flags. Current compilers emit executable v3
without classes and v4 when class metadata is present. `--debug-info` selects
v5 executable output independently of class use. Older SDKs cannot read
Expand All @@ -30,6 +33,14 @@ Retaining `@ai_context` in NIL is independent of opt-in native
[executable context](executable-context.md) embedding. Neither annotation
retention nor that section implements source-level debugger maps.

Tuples use ordinary typed record schemas with canonical `tuple<T1,T2,...>`
names and ordered numeric fields. See [NIL-0015](../design/NIL-0015-structural-tuples.md).
Formatted text lowers to `STR_CONCAT` and `TO_STRING <scalar-type>`; the
zero-operand legacy `TO_STRING` remains readable. The explicit type distinguishes
boolean formatting from integer formatting and preserves native/VM parity.
See [NIL-0014](../design/NIL-0014-formatted-text.md) for supported values and
conversion rules.

Text NIL preserves function declaration lines with a reserved
`# declaration_line N` comment immediately before the function header, after
its annotations. `N` is unsigned decimal in `0..2147483647`; zero or absent
Expand Down
Loading
Loading