windjammer 0.48.0

A simple language inspired by Go, Ruby, and Elixir that transpiles to Rust - 80% of Rust's power with 20% of the complexity
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
{
  "name": "windjammer",
  "version": "0.2.0",
  "types": [],
  "functions": [],
  "constants": [],
  "structs": [
    {
      "name": "Vec2",
      "doc": "2D vector",
      "fields": [
        {"name": "x", "field_type": {"Primitive": "Float32"}, "doc": "X component"},
        {"name": "y", "field_type": {"Primitive": "Float32"}, "doc": "Y component"}
      ]
    },
    {
      "name": "Vec3",
      "doc": "3D vector",
      "fields": [
        {"name": "x", "field_type": {"Primitive": "Float32"}, "doc": "X component"},
        {"name": "y", "field_type": {"Primitive": "Float32"}, "doc": "Y component"},
        {"name": "z", "field_type": {"Primitive": "Float32"}, "doc": "Z component"}
      ]
    },
    {
      "name": "Vec4",
      "doc": "4D vector",
      "fields": [
        {"name": "x", "field_type": {"Primitive": "Float32"}, "doc": "X component"},
        {"name": "y", "field_type": {"Primitive": "Float32"}, "doc": "Y component"},
        {"name": "z", "field_type": {"Primitive": "Float32"}, "doc": "Z component"},
        {"name": "w", "field_type": {"Primitive": "Float32"}, "doc": "W component"}
      ]
    },
    {
      "name": "Quat",
      "doc": "Quaternion for 3D rotations",
      "fields": [
        {"name": "x", "field_type": {"Primitive": "Float32"}, "doc": "X component"},
        {"name": "y", "field_type": {"Primitive": "Float32"}, "doc": "Y component"},
        {"name": "z", "field_type": {"Primitive": "Float32"}, "doc": "Z component"},
        {"name": "w", "field_type": {"Primitive": "Float32"}, "doc": "W component"}
      ]
    },
    {
      "name": "Color",
      "doc": "RGBA color",
      "fields": [
        {"name": "r", "field_type": {"Primitive": "Float32"}, "doc": "Red (0-1)"},
        {"name": "g", "field_type": {"Primitive": "Float32"}, "doc": "Green (0-1)"},
        {"name": "b", "field_type": {"Primitive": "Float32"}, "doc": "Blue (0-1)"},
        {"name": "a", "field_type": {"Primitive": "Float32"}, "doc": "Alpha (0-1)"}
      ]
    },
    {
      "name": "Transform2D",
      "doc": "2D transform (position, rotation, scale)",
      "fields": [
        {"name": "position", "field_type": {"Custom": "Vec2"}, "doc": "Position"},
        {"name": "rotation", "field_type": {"Primitive": "Float32"}, "doc": "Rotation in radians"},
        {"name": "scale", "field_type": {"Custom": "Vec2"}, "doc": "Scale"}
      ]
    },
    {
      "name": "Transform3D",
      "doc": "3D transform (position, rotation, scale)",
      "fields": [
        {"name": "position", "field_type": {"Custom": "Vec3"}, "doc": "Position"},
        {"name": "rotation", "field_type": {"Custom": "Quat"}, "doc": "Rotation quaternion"},
        {"name": "scale", "field_type": {"Custom": "Vec3"}, "doc": "Scale"}
      ]
    },
    {
      "name": "Rect",
      "doc": "Rectangle",
      "fields": [
        {"name": "x", "field_type": {"Primitive": "Float32"}, "doc": "X position"},
        {"name": "y", "field_type": {"Primitive": "Float32"}, "doc": "Y position"},
        {"name": "width", "field_type": {"Primitive": "Float32"}, "doc": "Width"},
        {"name": "height", "field_type": {"Primitive": "Float32"}, "doc": "Height"}
      ]
    }
  ],
  "enums": [
    {
      "name": "Key",
      "doc": "Keyboard keys",
      "variants": [
        {"name": "A", "value": 0},
        {"name": "B", "value": 1},
        {"name": "C", "value": 2},
        {"name": "D", "value": 3},
        {"name": "E", "value": 4},
        {"name": "F", "value": 5},
        {"name": "Space", "value": 32},
        {"name": "Enter", "value": 13},
        {"name": "Escape", "value": 27},
        {"name": "Left", "value": 37},
        {"name": "Up", "value": 38},
        {"name": "Right", "value": 39},
        {"name": "Down", "value": 40}
      ]
    },
    {
      "name": "MouseButton",
      "doc": "Mouse buttons",
      "variants": [
        {"name": "Left", "value": 0},
        {"name": "Right", "value": 1},
        {"name": "Middle", "value": 2}
      ]
    },
    {
      "name": "RigidBodyType",
      "doc": "Physics body type",
      "variants": [
        {"name": "Dynamic", "value": 0, "doc": "Affected by forces"},
        {"name": "Static", "value": 1, "doc": "Never moves"},
        {"name": "Kinematic", "value": 2, "doc": "Moves via velocity"}
      ]
    },
    {
      "name": "ColliderShape",
      "doc": "Collider shape type",
      "variants": [
        {"name": "Box", "value": 0},
        {"name": "Sphere", "value": 1},
        {"name": "Capsule", "value": 2},
        {"name": "Cylinder", "value": 3}
      ]
    }
  ],
  "classes": [
    {
      "name": "App",
      "doc": "Main application class",
      "fields": [],
      "constructors": [
        {"params": []}
      ],
      "methods": [
        {
          "name": "add_system",
          "params": [{"name": "system", "param_type": {"Function": {"params": [], "return_type": "Void"}}}],
          "return_type": "Void",
          "doc": "Adds a system that runs every frame"
        },
        {
          "name": "run",
          "params": [],
          "return_type": "Void",
          "doc": "Runs the application"
        }
      ]
    },
    {
      "name": "World",
      "doc": "ECS world containing all entities",
      "fields": [],
      "constructors": [
        {"params": []}
      ],
      "methods": [
        {
          "name": "create_entity",
          "params": [],
          "return_type": {"Custom": "Entity"},
          "doc": "Creates a new entity"
        },
        {
          "name": "destroy_entity",
          "params": [{"name": "entity", "param_type": {"Custom": "Entity"}}],
          "return_type": "Void",
          "doc": "Destroys an entity"
        }
      ]
    },
    {
      "name": "Entity",
      "doc": "Game entity (ECS)",
      "fields": [
        {"name": "id", "field_type": {"Primitive": "Int64"}, "doc": "Entity ID"}
      ],
      "constructors": [],
      "methods": []
    },
    {
      "name": "Input",
      "doc": "Input system",
      "fields": [],
      "constructors": [
        {"params": []}
      ],
      "methods": [
        {
          "name": "is_key_pressed",
          "params": [{"name": "key", "param_type": {"Custom": "Key"}}],
          "return_type": {"Primitive": "Bool"},
          "doc": "Check if key was just pressed this frame"
        },
        {
          "name": "is_key_held",
          "params": [{"name": "key", "param_type": {"Custom": "Key"}}],
          "return_type": {"Primitive": "Bool"},
          "doc": "Check if key is currently held down"
        },
        {
          "name": "is_mouse_button_pressed",
          "params": [{"name": "button", "param_type": {"Custom": "MouseButton"}}],
          "return_type": {"Primitive": "Bool"},
          "doc": "Check if mouse button was just pressed"
        },
        {
          "name": "mouse_position",
          "params": [],
          "return_type": {"Custom": "Vec2"},
          "doc": "Get current mouse position"
        }
      ]
    },
    {
      "name": "Time",
      "doc": "Time and delta time management",
      "fields": [],
      "constructors": [],
      "methods": [
        {
          "name": "delta_time",
          "params": [],
          "return_type": {"Primitive": "Float32"},
          "doc": "Time since last frame in seconds"
        },
        {
          "name": "total_time",
          "params": [],
          "return_type": {"Primitive": "Float32"},
          "doc": "Total time since app started"
        },
        {
          "name": "fps",
          "params": [],
          "return_type": {"Primitive": "Float32"},
          "doc": "Current frames per second"
        }
      ]
    },
    {
      "name": "Camera2D",
      "doc": "2D camera",
      "fields": [
        {"name": "position", "field_type": {"Custom": "Vec2"}, "doc": "Camera position"},
        {"name": "zoom", "field_type": {"Primitive": "Float32"}, "doc": "Zoom level"}
      ],
      "constructors": [
        {"params": []}
      ],
      "methods": [
        {
          "name": "follow",
          "params": [{"name": "target", "param_type": {"Custom": "Vec2"}}],
          "return_type": "Void",
          "doc": "Follow a target position"
        }
      ]
    },
    {
      "name": "Camera3D",
      "doc": "3D camera",
      "fields": [
        {"name": "position", "field_type": {"Custom": "Vec3"}, "doc": "Camera position"},
        {"name": "target", "field_type": {"Custom": "Vec3"}, "doc": "Look-at target"},
        {"name": "fov", "field_type": {"Primitive": "Float32"}, "doc": "Field of view"}
      ],
      "constructors": [
        {"params": []}
      ],
      "methods": [
        {
          "name": "look_at",
          "params": [{"name": "target", "param_type": {"Custom": "Vec3"}}],
          "return_type": "Void",
          "doc": "Point camera at target"
        }
      ]
    },
    {
      "name": "Sprite",
      "doc": "2D sprite renderer",
      "fields": [
        {"name": "texture_path", "field_type": {"Primitive": "String"}, "doc": "Path to texture"},
        {"name": "color", "field_type": {"Custom": "Color"}, "doc": "Tint color"}
      ],
      "constructors": [
        {"params": [{"name": "texture_path", "param_type": {"Primitive": "String"}}]}
      ],
      "methods": []
    },
    {
      "name": "Mesh3D",
      "doc": "3D mesh renderer",
      "fields": [
        {"name": "mesh_path", "field_type": {"Primitive": "String"}, "doc": "Path to mesh file"}
      ],
      "constructors": [
        {"params": [{"name": "mesh_path", "param_type": {"Primitive": "String"}}]}
      ],
      "methods": []
    },
    {
      "name": "RigidBody2D",
      "doc": "2D physics body",
      "fields": [
        {"name": "body_type", "field_type": {"Custom": "RigidBodyType"}, "doc": "Body type"},
        {"name": "velocity", "field_type": {"Custom": "Vec2"}, "doc": "Linear velocity"},
        {"name": "mass", "field_type": {"Primitive": "Float32"}, "doc": "Mass"}
      ],
      "constructors": [
        {"params": [{"name": "body_type", "param_type": {"Custom": "RigidBodyType"}}]}
      ],
      "methods": [
        {
          "name": "apply_force",
          "params": [{"name": "force", "param_type": {"Custom": "Vec2"}}],
          "return_type": "Void",
          "doc": "Apply force to body"
        },
        {
          "name": "apply_impulse",
          "params": [{"name": "impulse", "param_type": {"Custom": "Vec2"}}],
          "return_type": "Void",
          "doc": "Apply impulse to body"
        }
      ]
    },
    {
      "name": "RigidBody3D",
      "doc": "3D physics body",
      "fields": [
        {"name": "body_type", "field_type": {"Custom": "RigidBodyType"}, "doc": "Body type"},
        {"name": "velocity", "field_type": {"Custom": "Vec3"}, "doc": "Linear velocity"},
        {"name": "mass", "field_type": {"Primitive": "Float32"}, "doc": "Mass"}
      ],
      "constructors": [
        {"params": [{"name": "body_type", "param_type": {"Custom": "RigidBodyType"}}]}
      ],
      "methods": [
        {
          "name": "apply_force",
          "params": [{"name": "force", "param_type": {"Custom": "Vec3"}}],
          "return_type": "Void",
          "doc": "Apply force to body"
        },
        {
          "name": "apply_torque",
          "params": [{"name": "torque", "param_type": {"Custom": "Vec3"}}],
          "return_type": "Void",
          "doc": "Apply torque to body"
        }
      ]
    },
    {
      "name": "Collider2D",
      "doc": "2D collider",
      "fields": [
        {"name": "shape", "field_type": {"Custom": "ColliderShape"}, "doc": "Collider shape"}
      ],
      "constructors": [
        {"params": [{"name": "shape", "param_type": {"Custom": "ColliderShape"}}]}
      ],
      "methods": []
    },
    {
      "name": "AudioSource",
      "doc": "Audio playback",
      "fields": [
        {"name": "audio_path", "field_type": {"Primitive": "String"}, "doc": "Path to audio file"},
        {"name": "volume", "field_type": {"Primitive": "Float32"}, "doc": "Volume (0-1)"},
        {"name": "looping", "field_type": {"Primitive": "Bool"}, "doc": "Loop audio"}
      ],
      "constructors": [
        {"params": [{"name": "audio_path", "param_type": {"Primitive": "String"}}]}
      ],
      "methods": [
        {
          "name": "play",
          "params": [],
          "return_type": "Void",
          "doc": "Play audio"
        },
        {
          "name": "stop",
          "params": [],
          "return_type": "Void",
          "doc": "Stop audio"
        },
        {
          "name": "pause",
          "params": [],
          "return_type": "Void",
          "doc": "Pause audio"
        }
      ]
    },
    {
      "name": "ParticleSystem",
      "doc": "Particle effects",
      "fields": [
        {"name": "max_particles", "field_type": {"Primitive": "Int32"}, "doc": "Maximum particles"}
      ],
      "constructors": [
        {"params": []}
      ],
      "methods": [
        {
          "name": "emit",
          "params": [{"name": "count", "param_type": {"Primitive": "Int32"}}],
          "return_type": "Void",
          "doc": "Emit particles"
        }
      ]
    },
    {
      "name": "AnimationPlayer",
      "doc": "Animation playback",
      "fields": [],
      "constructors": [
        {"params": []}
      ],
      "methods": [
        {
          "name": "play",
          "params": [{"name": "animation_name", "param_type": {"Primitive": "String"}}],
          "return_type": "Void",
          "doc": "Play animation"
        },
        {
          "name": "stop",
          "params": [],
          "return_type": "Void",
          "doc": "Stop animation"
        }
      ]
    },
    {
      "name": "UIButton",
      "doc": "UI button widget",
      "fields": [
        {"name": "text", "field_type": {"Primitive": "String"}, "doc": "Button text"},
        {"name": "rect", "field_type": {"Custom": "Rect"}, "doc": "Button rectangle"}
      ],
      "constructors": [
        {"params": [{"name": "text", "param_type": {"Primitive": "String"}}]}
      ],
      "methods": [
        {
          "name": "is_clicked",
          "params": [],
          "return_type": {"Primitive": "Bool"},
          "doc": "Check if button was clicked"
        }
      ]
    },
    {
      "name": "UILabel",
      "doc": "UI text label",
      "fields": [
        {"name": "text", "field_type": {"Primitive": "String"}, "doc": "Label text"},
        {"name": "position", "field_type": {"Custom": "Vec2"}, "doc": "Label position"}
      ],
      "constructors": [
        {"params": [{"name": "text", "param_type": {"Primitive": "String"}}]}
      ],
      "methods": []
    }
  ],
  "functions": [],
  "modules": []
}