PUBLISHED SCARP v0.0.6-alpha.3 · SOURCE-VERIFIED

Inspect a Scarp project's modules

Use the published Scarp-first CLI to inspect a full project module graph without executing its program. This project includes a real import, public constant and byte-exact interpreter output.

01

Verify

scarp verify tutorials/module-inspection
02

Inspect

scarp inspect modules --json tutorials/module-inspection
03

Launch

scarp launch tutorials/module-inspection

Inspection does not execute the program. It is static and emits schema-v1 metadata, not program output. The JSON includes project-relative file/module metadata and should not be confused with a compiler execution result. launch uses the interpreter. There is no scarp compile command.

Compiler alpha.6 also supports scarp inspect symbols --json tutorials/module-inspection and scarp inspect references --json tutorials/module-inspection. These show definitions and use sites without executing code. IDs are local to one inspection, not permanent editor identities.

REAL PROJECT MANIFEST

Scarp.project

scarp-project: 1
name: module-inspection
entry: src/main.srp
IMPORTED ENTRYPOINT

src/main.srp

import "lib/math.srp" as math;
print(math.answer);
REAL SUPPORT MODULE

src/lib/math.srp

// Public compile-time scalar binding imported by main.srp.
pub bind answer = 21 * 2;
LAUNCH STDOUT FIXTURE

expected.stdout

Real compiler
42

WHAT IS INSPECTED?

Read the project without running it

The manifest selects src/main.srp as the entrypoint. It imports lib/math.srp, which exposes a public compile-time scalar constant. inspect modules --json DIRECTORY checks the actual graph and returns metadata without evaluating print. launch DIRECTORY executes the entrypoint and prints the verified result 42.

Try it: Run inspection against the project directory, then against tutorials/module-inspection/src/main.srp. Compare imports, dependencies and symbols. Schema-v1 module display labels may differ across platforms; the checked-in CLI tests compare the underlying graph.

Scarp.project में src/main.srp को entrypoint चुना गया है। यह lib/math.srp मॉड्यूल import करता है। inspect modules --json DIRECTORY बिना print चलाए मॉड्यूल और dependencies की सूची देता है। launch DIRECTORY interpreter से प्रोग्राम चलाकर सत्यापित आउटपुट 42 प्रिंट करता है।

अभ्यास: पहले project फ़ोल्डर की inspection करें, फिर उसके src/main.srp को inspect करें। दोनों JSON inventories में imports, dependencies और symbols की तुलना करें। Display path अलग हो सकता है।

Pinned compiler v0.0.6-alpha.3, source ceff07d9014f. No browser Scarp execution or simulated JSON results.

Next: trace declarations and uses →

← Your first Scarp project · Published compiler compatibility