You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -203,6 +210,7 @@ make test-rewatch # Rewatch tests
203
210
```
204
211
205
212
### Code Quality
213
+
206
214
```bash
207
215
# Format code
208
216
make format
@@ -218,7 +226,6 @@ npm run check:all
218
226
npm run typecheck
219
227
```
220
228
221
-
222
229
## Performance Considerations
223
230
224
231
The compiler is designed for fast feedback loops and scales to large codebases:
@@ -232,15 +239,18 @@ The compiler is designed for fast feedback loops and scales to large codebases:
232
239
## Coding Conventions
233
240
234
241
### Naming
242
+
235
243
-**OCaml code**: snake_case (e.g., `to_string`)
236
244
-**ReScript code**: camelCase (e.g., `toString`)
237
245
238
246
### Commit Standards
247
+
239
248
- Use DCO sign-off: `Signed-Off-By: Your Name <email>`
240
249
- Include appropriate tests with all changes
241
250
- Build must pass before committing
242
251
243
252
### Code Quality
253
+
244
254
- Follow existing patterns in the codebase
245
255
- Prefer existing utility functions over reinventing
246
256
- Comment complex algorithms and non-obvious logic
@@ -256,6 +266,7 @@ The compiler is designed for fast feedback loops and scales to large codebases:
256
266
## Common Tasks
257
267
258
268
### Adding New Language Features
269
+
259
270
1. Update parser in `compiler/syntax/`
260
271
2. Update AST definitions in `compiler/ml/`
261
272
3. Implement type checking in `compiler/ml/`
@@ -264,13 +275,15 @@ The compiler is designed for fast feedback loops and scales to large codebases:
264
275
6. Add comprehensive tests
265
276
266
277
### Debugging Compilation Issues
278
+
267
279
1. Identify which compilation phase has the issue
268
280
2. Use appropriate debugging flags (`-dparsetree`, `-dtypedtree`)
269
281
3. Check intermediate representations
270
282
4. Add debug output in relevant compiler modules
271
283
5. Verify with minimal test cases
272
284
273
285
### Working with Lambda IR
286
+
274
287
- Remember Lambda IR is the core optimization layer
275
288
- All `lam_*.ml` files process this representation
276
289
- Use `lam_print.ml` for debugging lambda expressions
@@ -383,6 +396,23 @@ make test-rewatch # Run integration tests
383
396
-**Dependencies**: Inspect module dependency graph in `deps.rs`
384
397
-**File Watching**: Monitor file change events in `watcher.rs`
385
398
399
+
#### Running Rewatch Directly
400
+
401
+
When running the rewatch binary directly (via `cargo run` or the compiled binary) during development, you need to set environment variables to point to the local compiler and runtime. Otherwise, rewatch will try to use the installed versions:
0 commit comments