@malloydata/malloy 0.0.324 → 0.0.325

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CONTEXT.md ADDED
@@ -0,0 +1,57 @@
1
+ # Malloy Core Package
2
+
3
+ The `malloy` package is the heart of the Malloy language implementation. It contains the compiler, translator, and runtime system that powers Malloy's semantic modeling and query capabilities.
4
+
5
+ ## Package Structure
6
+
7
+ ```
8
+ packages/malloy/
9
+ ├── src/
10
+ │ ├── lang/ # Translator: Parse tree → AST → IR (see src/lang/CONTEXT.md)
11
+ │ ├── model/ # Compiler: IR → SQL (see src/model/CONTEXT.md)
12
+ │ ├── dialect/ # Database-specific SQL generation
13
+ │ ├── api/ # Public API interfaces
14
+ │ ├── connection/ # Database connection abstractions
15
+ │ └── malloy.ts # Main entry point
16
+ ```
17
+
18
+ ## Two-Phase Architecture
19
+
20
+ The Malloy compilation process is split into two distinct phases:
21
+
22
+ ### Phase 1: Translation (src/lang/)
23
+ The translator takes Malloy source code and transforms it into an Intermediate Representation (IR).
24
+
25
+ **Process:**
26
+ 1. ANTLR parser generates parse tree from source code
27
+ 2. Parse tree is transformed into Abstract Syntax Tree (AST)
28
+ 3. AST is analyzed and transformed into IR
29
+
30
+ **Key characteristics:**
31
+ - IR is a **serializable data format** (plain objects, not class instances)
32
+ - IR fully describes the semantic model independent of SQL
33
+ - IR can be cached, transmitted, and reused across compilations
34
+
35
+ For detailed information about the translator, see [src/lang/CONTEXT.md](src/lang/CONTEXT.md).
36
+
37
+ ### Phase 2: Compilation (src/model/)
38
+ The compiler takes IR and generates SQL queries for specific database dialects.
39
+
40
+ **Process:**
41
+ 1. IR is read and analyzed
42
+ 2. Query operations are transformed into SQL expressions
43
+ 3. Dialect-specific SQL is generated
44
+ 4. Metadata is generated for result processing
45
+
46
+ **Key characteristics:**
47
+ - Produces SQL that can be executed on target database
48
+ - Includes metadata to interpret and render results
49
+ - Dialect-agnostic until final SQL generation step
50
+
51
+ For detailed information about the compiler, see [src/model/CONTEXT.md](src/model/CONTEXT.md).
52
+
53
+ ## Subsystem Context
54
+
55
+ For deeper details on specific subsystems:
56
+ - [src/lang/CONTEXT.md](src/lang/CONTEXT.md) - Translator architecture (grammar, AST, IR generation)
57
+ - [src/model/CONTEXT.md](src/model/CONTEXT.md) - Compiler architecture (SQL generation, expression compilation)
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const MALLOY_VERSION = "0.0.324";
1
+ export declare const MALLOY_VERSION = "0.0.325";
package/dist/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MALLOY_VERSION = void 0;
4
4
  // generated with 'generate-version-file' script; do not edit manually
5
- exports.MALLOY_VERSION = '0.0.324';
5
+ exports.MALLOY_VERSION = '0.0.325';
6
6
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy",
3
- "version": "0.0.324",
3
+ "version": "0.0.325",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",
@@ -41,9 +41,9 @@
41
41
  "generate-version-file": "VERSION=$(npm pkg get version --workspaces=false | tr -d \\\")\necho \"// generated with 'generate-version-file' script; do not edit manually\\nexport const MALLOY_VERSION = '$VERSION';\" > src/version.ts"
42
42
  },
43
43
  "dependencies": {
44
- "@malloydata/malloy-filter": "0.0.324",
45
- "@malloydata/malloy-interfaces": "0.0.324",
46
- "@malloydata/malloy-tag": "0.0.324",
44
+ "@malloydata/malloy-filter": "0.0.325",
45
+ "@malloydata/malloy-interfaces": "0.0.325",
46
+ "@malloydata/malloy-tag": "0.0.325",
47
47
  "antlr4ts": "^0.5.0-alpha.4",
48
48
  "assert": "^2.0.0",
49
49
  "jaro-winkler": "^0.2.8",