Skip to content

Implement std/os package for env/process/fs primitives#1041

Merged
emil14 merged 10 commits into
mainfrom
codex/fresh-main-worktree
Jun 28, 2026
Merged

Implement std/os package for env/process/fs primitives#1041
emil14 merged 10 commits into
mainfrom
codex/fresh-main-worktree

Conversation

@emil14

@emil14 emil14 commented Feb 24, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • expand std/os from Args/Environ to a practical typed surface for environment, process, filesystem, and temp-path operations
  • add runtime function implementations for new #extern bindings and register them in internal/runtime/funcs/registry.go
  • fix args runtime function list construction bug (pre-sized slice + append)
  • add targeted unit tests for new runtime helpers and a focused e2e package for std/os

Design notes

  • kept this iteration value-oriented and dataflow-friendly (path/key/value/perm inputs + typed outputs)
  • intentionally avoided introducing stateful file-handle API in this PR to keep semantics explicit and composable in static dataflow
  • query-style components without natural data input are signal-triggered (sig) to avoid autonomous senders

Validation

  • golangci-lint run ./internal/runtime/funcs/... ./e2e/os_package/...
  • go test ./internal/runtime/funcs/... ./e2e/os_package
  • golangci-lint run ./...
  • go test ./... (broad run started and progressed through many e2e packages; targeted changed-package suites fully passed)

Part of #1033
Closes #586

@emil14 emil14 force-pushed the codex/fresh-main-worktree branch from 50d9b69 to 9812697 Compare February 24, 2026 19:27
@emil14 emil14 force-pushed the codex/fresh-main-worktree branch from 9812697 to 012321c Compare February 25, 2026 07:34
Comment thread e2e/os_package/main/main.neva

@emil14 emil14 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Critical Issues (Blocking)

  • internal/runtime/funcs/os_helpers.go:191: runBinaryLoop receives from firstIn before it starts waiting on secondIn. That changes the dataflow/backpressure semantics for every new two-input std/os component using this helper (Setenv, Mkdir, MkdirAll, Rename, Truncate, MkdirTemp, CreateTemp): if the second input is produced first, or if producing the first input depends on the second branch being drained, the component can deadlock even though both inputs would eventually be available. Existing binary runtime funcs use receive2(ctx, firstIn, secondIn) to arm both receives concurrently. Please switch runBinaryLoop to receive2 and add a regression test that proves the second input can arrive before the first without blocking.

Comment thread e2e/os_args/main/main.neva Outdated
Comment thread std/os/os.neva
Comment thread e2e/os_fs/main/main.neva Outdated
Comment thread e2e/os_process/main/main.neva Outdated
Comment thread internal/runtime/funcs/args_test.go
Comment thread internal/runtime/funcs/utils_os.go
Comment thread internal/runtime/funcs/utils_os.go
Comment thread internal/runtime/funcs/utils_os.go
Comment thread internal/runtime/funcs/utils_os.go
@emil14 emil14 merged commit b13c590 into main Jun 28, 2026
5 checks passed
@emil14 emil14 deleted the codex/fresh-main-worktree branch June 28, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement os package for stdlib

1 participant