Syntax highlighting, snippets, and language support for NXLang — the programming language for the NXPU neurosymbolic reasoning chip.
Features
-
Syntax Highlighting for
.nxfiles- Keywords:
fact,rule,query,knowledge,perception,simulate,orchestrate - Variables (uppercase):
Server,Drug,Patient - Predicates (lowercase + parentheses):
vulnerable(...),patient_takes(...) - Operators:
:-(rule definition),->(pipeline),@(engine tags) - Comments:
#line comments,/* */block comments - Wildcards:
_(don't care)
- Keywords:
-
Snippets with tab completion
fact— insert a fact declarationrule— insert a rule with body atomsquery— insert a queryknowledge— full knowledge block templatepharma— drug interaction detection templatesecurity— network security assessment templaterbac— role-based access control template
-
Bracket Matching and Auto-Closing
-
Code Folding for knowledge/perception/simulate/orchestrate blocks
Example
# Drug interaction detection
fact: patient_takes(patient_A, warfarin).
fact: inhibits(fluconazole, CYP2C9).
fact: drug_metabolized_by(warfarin, CYP2C9).
fact: narrow_therapeutic(warfarin).
rule: adverse_interaction(Patient, Drug) :-
patient_takes(Patient, Drug, _),
drug_metabolized_by(Drug, Enzyme, _),
inhibits(Inhibitor, Enzyme, _),
patient_takes(Patient, Inhibitor, _),
narrow_therapeutic(Drug, _, _).
query: adverse_interaction.
Installation
From VSIX (local install)
code --install-extension nxlang-0.3.0.vsix
From Marketplace (coming soon)
Search "NXLang" in the VS Code Extensions panel.
Compiling NXLang
# Compile to FPGA format
nxc hw-compile program.nx --format tcl
# Compile to binary
nxc hw-compile program.nx --format nxb
# Interactive REPL
nxc repl --transport sim
Links
License
Proprietary — Dyber, Inc. All rights reserved.