goscript 0.0.23 → 0.0.25

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.
Files changed (94) hide show
  1. package/README.md +2 -2
  2. package/cmd/goscript/cmd_compile.go +18 -2
  3. package/compiler/analysis.go +74 -132
  4. package/compiler/analysis_test.go +220 -0
  5. package/compiler/assignment.go +37 -43
  6. package/compiler/builtin_test.go +90 -0
  7. package/compiler/compiler.go +307 -22
  8. package/compiler/composite-lit.go +108 -43
  9. package/compiler/config.go +7 -3
  10. package/compiler/config_test.go +6 -33
  11. package/compiler/decl.go +7 -1
  12. package/compiler/expr-call.go +212 -2
  13. package/compiler/expr-selector.go +66 -41
  14. package/compiler/expr-star.go +57 -65
  15. package/compiler/expr-type.go +1 -1
  16. package/compiler/expr-value.go +1 -1
  17. package/compiler/expr.go +125 -20
  18. package/compiler/field.go +4 -4
  19. package/compiler/primitive.go +11 -10
  20. package/compiler/spec-struct.go +3 -3
  21. package/compiler/spec-value.go +75 -29
  22. package/compiler/spec.go +9 -3
  23. package/compiler/stmt-assign.go +36 -2
  24. package/compiler/stmt-for.go +11 -0
  25. package/compiler/stmt-range.go +314 -1
  26. package/compiler/stmt.go +52 -0
  27. package/compiler/type.go +83 -15
  28. package/dist/gs/builtin/builtin.d.ts +9 -0
  29. package/dist/gs/builtin/builtin.js +46 -0
  30. package/dist/gs/builtin/builtin.js.map +1 -0
  31. package/dist/gs/builtin/channel.d.ts +193 -0
  32. package/dist/gs/builtin/channel.js +471 -0
  33. package/dist/gs/builtin/channel.js.map +1 -0
  34. package/dist/gs/builtin/defer.d.ts +38 -0
  35. package/dist/gs/builtin/defer.js +54 -0
  36. package/dist/gs/builtin/defer.js.map +1 -0
  37. package/dist/gs/builtin/index.d.ts +1 -0
  38. package/dist/gs/builtin/index.js +2 -0
  39. package/dist/gs/builtin/index.js.map +1 -0
  40. package/dist/gs/builtin/io.d.ts +16 -0
  41. package/dist/gs/builtin/io.js +15 -0
  42. package/dist/gs/builtin/io.js.map +1 -0
  43. package/dist/gs/builtin/map.d.ts +33 -0
  44. package/dist/gs/builtin/map.js +44 -0
  45. package/dist/gs/builtin/map.js.map +1 -0
  46. package/dist/gs/builtin/slice.d.ts +173 -0
  47. package/dist/gs/builtin/slice.js +799 -0
  48. package/dist/gs/builtin/slice.js.map +1 -0
  49. package/dist/gs/builtin/type.d.ts +203 -0
  50. package/dist/gs/builtin/type.js +744 -0
  51. package/dist/gs/builtin/type.js.map +1 -0
  52. package/dist/gs/builtin/varRef.d.ts +14 -0
  53. package/dist/gs/builtin/varRef.js +14 -0
  54. package/dist/gs/builtin/varRef.js.map +1 -0
  55. package/dist/gs/cmp/index.d.ts +4 -0
  56. package/dist/gs/cmp/index.js +27 -0
  57. package/dist/gs/cmp/index.js.map +1 -0
  58. package/dist/gs/context/context.d.ts +26 -0
  59. package/dist/gs/context/context.js +305 -0
  60. package/dist/gs/context/context.js.map +1 -0
  61. package/dist/gs/context/index.d.ts +1 -0
  62. package/dist/gs/context/index.js +2 -0
  63. package/dist/gs/context/index.js.map +1 -0
  64. package/dist/gs/internal/goarch/index.d.ts +6 -0
  65. package/dist/gs/internal/goarch/index.js +14 -0
  66. package/dist/gs/internal/goarch/index.js.map +1 -0
  67. package/dist/gs/iter/index.d.ts +1 -0
  68. package/dist/gs/iter/index.js +2 -0
  69. package/dist/gs/iter/index.js.map +1 -0
  70. package/dist/gs/iter/iter.d.ts +4 -0
  71. package/dist/gs/iter/iter.js +91 -0
  72. package/dist/gs/iter/iter.js.map +1 -0
  73. package/dist/gs/math/bits/index.d.ts +47 -0
  74. package/dist/gs/math/bits/index.js +298 -0
  75. package/dist/gs/math/bits/index.js.map +1 -0
  76. package/dist/gs/runtime/index.d.ts +1 -0
  77. package/dist/gs/runtime/index.js +2 -0
  78. package/dist/gs/runtime/index.js.map +1 -0
  79. package/dist/gs/runtime/runtime.d.ts +41 -0
  80. package/dist/gs/runtime/runtime.js +158 -0
  81. package/dist/gs/runtime/runtime.js.map +1 -0
  82. package/dist/gs/slices/index.d.ts +1 -0
  83. package/dist/gs/slices/index.js +2 -0
  84. package/dist/gs/slices/index.js.map +1 -0
  85. package/dist/gs/slices/slices.d.ts +8 -0
  86. package/dist/gs/slices/slices.js +20 -0
  87. package/dist/gs/slices/slices.js.map +1 -0
  88. package/dist/gs/time/index.d.ts +1 -0
  89. package/dist/gs/time/index.js +2 -0
  90. package/dist/gs/time/index.js.map +1 -0
  91. package/dist/gs/time/time.d.ts +57 -0
  92. package/dist/gs/time/time.js +208 -0
  93. package/dist/gs/time/time.js.map +1 -0
  94. package/package.json +3 -2
@@ -0,0 +1,57 @@
1
+ export declare class Time {
2
+ private _date;
3
+ private _nsec;
4
+ private _monotonic?;
5
+ constructor(date: globalThis.Date, nsec?: number, monotonic?: number);
6
+ clone(): Time;
7
+ Sub(u: Time): Duration;
8
+ Add(d: Duration): Time;
9
+ Equal(u: Time): boolean;
10
+ Before(u: Time): boolean;
11
+ After(u: Time): boolean;
12
+ Round(d: Duration): Time;
13
+ Truncate(d: Duration): Time;
14
+ String(): string;
15
+ }
16
+ export declare class Duration {
17
+ private _nanoseconds;
18
+ constructor(nanoseconds: number);
19
+ lt(other: Duration): boolean;
20
+ static multiply(duration: Duration, multiplier: number): Duration;
21
+ multiply(multiplier: number): Duration;
22
+ valueOf(): number;
23
+ toString(): string;
24
+ }
25
+ export declare function multiplyDuration(duration: Duration, multiplier: number): Duration;
26
+ export declare class Location {
27
+ private _name;
28
+ constructor(name: string);
29
+ get name(): string;
30
+ }
31
+ export declare enum Month {
32
+ January = 1,
33
+ February = 2,
34
+ March = 3,
35
+ April = 4,
36
+ May = 5,
37
+ June = 6,
38
+ July = 7,
39
+ August = 8,
40
+ September = 9,
41
+ October = 10,
42
+ November = 11,
43
+ December = 12
44
+ }
45
+ export declare function Now(): Time;
46
+ export declare function Date(year: number, month: Month, day: number, hour: number, min: number, sec: number, nsec: number, loc: Location): Time;
47
+ export declare const UTC: Location;
48
+ export declare const Nanosecond: Duration;
49
+ export declare const Microsecond: Duration;
50
+ export declare const Millisecond: Duration;
51
+ export declare const Second: Duration;
52
+ export declare const Minute: Duration;
53
+ export declare const Hour: Duration;
54
+ export declare function Since(t: Time): Duration;
55
+ export declare function Until(t: Time): Duration;
56
+ export declare function Sleep(d: Duration): Promise<void>;
57
+ export declare const May = Month.May;
@@ -0,0 +1,208 @@
1
+ // Time represents a time instant with nanosecond precision
2
+ export class Time {
3
+ _date;
4
+ _nsec; // nanoseconds within the second
5
+ _monotonic; // high-resolution monotonic timestamp in nanoseconds
6
+ constructor(date, nsec = 0, monotonic) {
7
+ this._date = new globalThis.Date(date.getTime());
8
+ this._nsec = nsec;
9
+ this._monotonic = monotonic;
10
+ }
11
+ // clone returns a copy of this Time instance
12
+ clone() {
13
+ return new Time(this._date, this._nsec, this._monotonic);
14
+ }
15
+ // Sub returns the duration t-u
16
+ // If both times have monotonic readings, use them for accurate duration calculation
17
+ Sub(u) {
18
+ // If both times have monotonic readings, use them for more accurate duration calculation
19
+ if (this._monotonic !== undefined && u._monotonic !== undefined) {
20
+ const diffNs = this._monotonic - u._monotonic;
21
+ return new Duration(diffNs);
22
+ }
23
+ // Fallback to Date-based calculation
24
+ const diffMs = this._date.getTime() - u._date.getTime();
25
+ const diffNs = (this._nsec - u._nsec);
26
+ return new Duration(diffMs * 1000000 + diffNs); // Convert ms to ns and add ns difference
27
+ }
28
+ // Add adds the duration d to t, returning the sum
29
+ // Preserves monotonic reading if present
30
+ Add(d) {
31
+ const durationNs = d.valueOf();
32
+ const newDate = new globalThis.Date(this._date.getTime() + Math.floor(durationNs / 1000000));
33
+ const newNsec = this._nsec + (durationNs % 1000000);
34
+ const newMonotonic = this._monotonic !== undefined ? this._monotonic + durationNs : undefined;
35
+ return new Time(newDate, newNsec, newMonotonic);
36
+ }
37
+ // Equal reports whether t and u represent the same time instant
38
+ // Uses monotonic clock if both times have it
39
+ Equal(u) {
40
+ if (this._monotonic !== undefined && u._monotonic !== undefined) {
41
+ return this._monotonic === u._monotonic;
42
+ }
43
+ return this._date.getTime() === u._date.getTime() && this._nsec === u._nsec;
44
+ }
45
+ // Before reports whether the time instant t is before u
46
+ // Uses monotonic clock if both times have it
47
+ Before(u) {
48
+ if (this._monotonic !== undefined && u._monotonic !== undefined) {
49
+ return this._monotonic < u._monotonic;
50
+ }
51
+ const thisMs = this._date.getTime();
52
+ const uMs = u._date.getTime();
53
+ return thisMs < uMs || (thisMs === uMs && this._nsec < u._nsec);
54
+ }
55
+ // After reports whether the time instant t is after u
56
+ // Uses monotonic clock if both times have it
57
+ After(u) {
58
+ if (this._monotonic !== undefined && u._monotonic !== undefined) {
59
+ return this._monotonic > u._monotonic;
60
+ }
61
+ const thisMs = this._date.getTime();
62
+ const uMs = u._date.getTime();
63
+ return thisMs > uMs || (thisMs === uMs && this._nsec > u._nsec);
64
+ }
65
+ // Round returns the result of rounding t to the nearest multiple of d
66
+ // Strips monotonic reading as per Go specification
67
+ Round(d) {
68
+ // Implementation would round to nearest duration
69
+ // For now, simplified version that strips monotonic reading
70
+ return new Time(this._date, this._nsec);
71
+ }
72
+ // Truncate returns the result of rounding t down to a multiple of d
73
+ // Strips monotonic reading as per Go specification
74
+ Truncate(d) {
75
+ // Implementation would truncate to duration
76
+ // For now, simplified version that strips monotonic reading
77
+ return new Time(this._date, this._nsec);
78
+ }
79
+ // String returns the time formatted as a string
80
+ String() {
81
+ // Format as "YYYY-MM-DD HH:MM:SS +0000 UTC" to match Go's format
82
+ const year = this._date.getUTCFullYear();
83
+ const month = String(this._date.getUTCMonth() + 1).padStart(2, '0');
84
+ const day = String(this._date.getUTCDate()).padStart(2, '0');
85
+ const hour = String(this._date.getUTCHours()).padStart(2, '0');
86
+ const minute = String(this._date.getUTCMinutes()).padStart(2, '0');
87
+ const second = String(this._date.getUTCSeconds()).padStart(2, '0');
88
+ let result = `${year}-${month}-${day} ${hour}:${minute}:${second} +0000 UTC`;
89
+ // Include monotonic reading in debug output as per Go specification
90
+ if (this._monotonic !== undefined) {
91
+ result += ` m=${this._monotonic}`;
92
+ }
93
+ return result;
94
+ }
95
+ }
96
+ // Duration represents a span of time
97
+ export class Duration {
98
+ _nanoseconds;
99
+ constructor(nanoseconds) {
100
+ this._nanoseconds = nanoseconds;
101
+ }
102
+ // Compare this duration with another
103
+ lt(other) {
104
+ return this._nanoseconds < other._nanoseconds;
105
+ }
106
+ // Multiply duration by a number (for expressions like Hour * 24)
107
+ static multiply(duration, multiplier) {
108
+ return new Duration(duration._nanoseconds * multiplier);
109
+ }
110
+ // Add support for * operator
111
+ multiply(multiplier) {
112
+ return Duration.multiply(this, multiplier);
113
+ }
114
+ // valueOf returns the primitive number value, allowing direct comparison with < > etc
115
+ valueOf() {
116
+ return this._nanoseconds;
117
+ }
118
+ // toString for string representation
119
+ toString() {
120
+ return this._nanoseconds.toString() + "ns";
121
+ }
122
+ }
123
+ // Override multiplication operator for Duration * number
124
+ export function multiplyDuration(duration, multiplier) {
125
+ return Duration.multiply(duration, multiplier);
126
+ }
127
+ // Location represents a time zone
128
+ export class Location {
129
+ _name;
130
+ constructor(name) {
131
+ this._name = name;
132
+ }
133
+ get name() {
134
+ return this._name;
135
+ }
136
+ }
137
+ // Month represents a month of the year
138
+ export var Month;
139
+ (function (Month) {
140
+ Month[Month["January"] = 1] = "January";
141
+ Month[Month["February"] = 2] = "February";
142
+ Month[Month["March"] = 3] = "March";
143
+ Month[Month["April"] = 4] = "April";
144
+ Month[Month["May"] = 5] = "May";
145
+ Month[Month["June"] = 6] = "June";
146
+ Month[Month["July"] = 7] = "July";
147
+ Month[Month["August"] = 8] = "August";
148
+ Month[Month["September"] = 9] = "September";
149
+ Month[Month["October"] = 10] = "October";
150
+ Month[Month["November"] = 11] = "November";
151
+ Month[Month["December"] = 12] = "December";
152
+ })(Month || (Month = {}));
153
+ // Now returns the current local time with monotonic clock reading
154
+ export function Now() {
155
+ const date = new globalThis.Date();
156
+ let monotonic;
157
+ // Use performance.now() for high-resolution monotonic timing if available
158
+ if (typeof performance !== 'undefined' && performance.now) {
159
+ // performance.now() returns milliseconds with sub-millisecond precision
160
+ // Convert to nanoseconds for consistency with Go's time package
161
+ monotonic = performance.now() * 1000000;
162
+ }
163
+ return new Time(date, 0, monotonic);
164
+ }
165
+ // Date returns the Time corresponding to
166
+ // yyyy-mm-dd hh:mm:ss + nsec nanoseconds
167
+ // in the appropriate zone for that time in the given location
168
+ // Does not include monotonic reading as per Go specification
169
+ export function Date(year, month, day, hour, min, sec, nsec, loc) {
170
+ let date;
171
+ if (loc.name === "UTC") {
172
+ // Use Date.UTC for proper UTC handling
173
+ const utcTime = globalThis.Date.UTC(year, month - 1, day, hour, min, sec, Math.floor(nsec / 1000000));
174
+ date = new globalThis.Date(utcTime);
175
+ }
176
+ else {
177
+ // For local time or other timezones, use regular Date constructor
178
+ date = new globalThis.Date(year, month - 1, day, hour, min, sec, Math.floor(nsec / 1000000));
179
+ }
180
+ return new Time(date, nsec % 1000000); // No monotonic reading
181
+ }
182
+ // Common locations
183
+ export const UTC = new Location("UTC");
184
+ // Common durations (matching Go's time package constants)
185
+ export const Nanosecond = new Duration(1);
186
+ export const Microsecond = new Duration(1000);
187
+ export const Millisecond = new Duration(1000000);
188
+ export const Second = new Duration(1000000000);
189
+ export const Minute = new Duration(60000000000);
190
+ export const Hour = new Duration(3600000000000);
191
+ // Since returns the time elapsed since t
192
+ // Uses monotonic clock if available for accurate measurement
193
+ export function Since(t) {
194
+ return Now().Sub(t);
195
+ }
196
+ // Until returns the duration until t
197
+ // Uses monotonic clock if available for accurate measurement
198
+ export function Until(t) {
199
+ return t.Sub(Now());
200
+ }
201
+ // Sleep pauses the current execution for at least the duration d
202
+ export async function Sleep(d) {
203
+ const ms = d.valueOf() / 1000000; // Convert nanoseconds to milliseconds
204
+ return new Promise(resolve => setTimeout(resolve, ms));
205
+ }
206
+ // Export month constants
207
+ export const May = Month.May;
208
+ //# sourceMappingURL=time.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.js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,MAAM,WAAW,GAAG,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC;AACjD,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,UAAU,CAAC,CAAC;AAC/C,MAAM,CAAC,MAAM,MAAM,GAAG,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC;AAChD,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,QAAQ,CAAC,aAAa,CAAC,CAAC;AAEhD,yCAAyC;AACzC,6DAA6D;AAC7D,MAAM,UAAU,KAAK,CAAC,CAAO;IAC3B,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC;AAED,qCAAqC;AACrC,6DAA6D;AAC7D,MAAM,UAAU,KAAK,CAAC,CAAO;IAC3B,OAAO,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC;AACtB,CAAC;AAED,iEAAiE;AACjE,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,CAAW;IACrC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,sCAAsC;IACxE,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,0BAA0B;AAC1B,MAAM,CAAC,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "goscript",
3
3
  "description": "Go to TypeScript transpiler",
4
- "version": "0.0.23",
4
+ "version": "0.0.25",
5
5
  "author": {
6
6
  "name": "Aperture Robotics LLC.",
7
7
  "email": "support@aperture.us",
@@ -48,7 +48,7 @@
48
48
  "test": "npm run test:go && npm run test:js",
49
49
  "test:go": "go test -v ./...",
50
50
  "test:js": "npm run typecheck && vitest run",
51
- "typecheck": "tsc --noEmit",
51
+ "typecheck": "tsgo --noEmit",
52
52
  "format": "npm run format:go && npm run format:js && npm run format:config",
53
53
  "format:config": "prettier --write tsconfig.json package.json",
54
54
  "format:go": "gofumpt -w .",
@@ -86,6 +86,7 @@
86
86
  "@types/node": "^22.15.18",
87
87
  "@typescript-eslint/eslint-plugin": "^8.31.0",
88
88
  "@typescript-eslint/parser": "^8.31.0",
89
+ "@typescript/native-preview": "^7.0.0-dev.20250523.1",
89
90
  "eslint": "^9.25.1",
90
91
  "eslint-config-prettier": "^10.0.2",
91
92
  "husky": "^9.1.7",