feat/lsp #2
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/lsp"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
[T]methods and make String Comparable 051b759fd6Brings in `llvm-pr`: an experimental MIR -> textual LLVM IR backend (`crates/hikic/src/llvm.rs`, driven by `--llvm`), the `tests/stdsafety` fixture corpus and its ratchet suite, the `tools/fuzz` harness, and the `std/http` + `std/net` refactor with the `std/string` bounds and `parseInt`-overflow fixes it depends on. Conflict resolution keeps the current branch's newer work wherever both sides moved: - `std/string/string.hiki` takes the checked `substring`/`sliceClamped` and non-trapping `parseInt` overflow, and keeps the `memcmp`-based `String.equals`/`Str.equals`, `String: Comparable`, the word-at-a-time `fnv1a`, and the `concat3..concat6` interpolation fast path. - `crates/hiki-lsp/src/features.rs` keeps the `PathBuf` diagnostic comparison; the incoming `.display().to_string()` was a fix for the older `String` spelling of the same line and is redundant here. - `crates/hikic/src/{mir/lower.rs,mir/mod.rs,codegen.rs}` keep their current shape and gain `extern_sigs`, its `MirModule` field, and `runtime_prelude`. - `crates/hikic/tests/e2e_http.rs` takes the incoming version outright; this branch had only reformatted it. `tools/fuzz/seeds/**` gets a `-text` gitattributes entry so git does not normalise the CRLF in the HTTP frame seeds.@lang("assume")a static inline unreachable branch in C; fix 1bdab01fb9hiki test,hiki run -, initflow zero-init analysis, and tooling 4111e61e09Phase 2's pool was Linux-only: the completion signal was an `eventfd`, which Darwin lacks, and `pthread_t` is an opaque pointer there rather than an integer. Port both, keeping the runtime in Hiki rather than a C shim: - `Wake` carries a completion descriptor as a `(readFd, writeFd)` pair -- one `eventfd` on Linux, a non-blocking `pipe` elsewhere -- so the job layout, the spare list and `jobWait` do not branch on the platform. The spare list stores pairs and the pool block grew to 704 bytes. - `pthread_t` travels as the bits of a `u64`. `thread_create` writes it through a `Ptr<u8>` (C converts any object pointer to `pthread_t *`); `thread_join` and `thread_detach` are declared once per platform behind `@cfg` -- integer on Linux, pointer on Darwin -- and the handle is converted in a Hiki helper. Both backends then reuse one runtime, and no `pthread_t` type is named. Fix a latent monomorphization bug the port's tests hit: `rewrite_calls_expr` renamed call sites at every expression except a cast's operand, an interpolation's pieces and an `unsafe` block's statements. `scan_expr` built those instances, so a generic call inside any of the three was never renamed: `newArray<i64>(n)` inside `unsafe { ... }` checked clean and then failed lowering with "unknown function or type `hk_std_collections__array_newArray`". Add the three arms; covered by a new `e2e_unsafe` test. Migrate the raw-`pthread_create` tests and examples to `std/thread`'s portable `spawnThread`/`Thread`, and raise `std/thread`'s `unsafe` ceiling to the new count with the reason. Fast suite: 126/126 on both backends; `diff-backends.sh` 35/35.A module-level `var` could only be `nil`, `false` or `0`, so a global counter or config value had nowhere to put its starting value. Extend the restricted evaluator (`consteval::evaluate_initializer`) to `var`s and carry the result to both backends: - integers, floats, `Bool` and arithmetic over `const`s evaluate at compile time, so the storage is still written before `main` with no startup code; - the implicit zero (`nil`, `false`, `0`, and any zero-valued initializer) still emits a bare declaration (`static T hkg_x;`, `internal global T zeroinitializer`); - a value that would need allocation (`String`, `[T]`, a struct holding either) and a non-constant (a call, another `var`) are refused with a diagnostic naming the user's spelling. `MirModule.globals` becomes `Vec<Global { name, ty, init }>`; codegen emits the C initializer, LLVM the constant. Tests: a positive case across `i64`, `f64`, `Bool`, `u32`, a `const` operand and `@threadLocal`, plus a negative for a call; `examples/globals.hiki` extended for the differential run. Fast suite 128/128 on both backends; `diff-backends.sh` 35/35.