Skip to content

v0.33.0

Choose a tag to compare

@emil14 emil14 released this 07 Dec 19:44
· 761 commits to main since this release
8d3de0c

This release brings a major milestone: Go interop — you can now call Neva code from Go. This opens the door for gradual adoption and integration with the Go ecosystem. Along with that, we've added developer productivity features like watch mode and stdlib search, plus important improvements to streams, tracing, and the type system.

🧠 Language Changes

Go Interop

Neva can now be compiled as a Go library and called from Go code. This is the biggest change in this release.

The compiler identifies all public components with exactly one inport and one outport as interopable exports. Under the hood, it generates Go code that can be imported and used like any other Go package.

Compiling Neva to Go library

# Build Neva package as Go library
neva build --target go --target-go-mode pkg path/to/package

# Specify custom runtime path if needed
neva build --target go --target-go-mode pkg --target-go-runtime-path ./runtime path/to/package

The compiler will:

  1. Analyze your package for public components with single inport/outport
  2. Generate Go code for each interopable component
  3. Create a Go package that can be imported

Using Neva from Go

package main

import (
    "fmt"
    "your-module/generated"
)

func main() {
    // Call Neva components from Go
    result := generated.YourNevaComponent(input)
    fmt.Println(result)
}

Each exported Neva component becomes a Go function. The runtime handles message passing and dataflow execution transparently.

The compiler itself uses this feature: Part of the Neva compiler is now written in Neva! For example, ParseEntityRef is implemented in Neva and called from Go

See PRs #916 and #949 for implementation details.

⚙️ Compiler & Tooling

IR Visualizers

Experimental Three.js-powered 3D visualization of intermediete program representation (IR). Helps understand how your Neva code is transformed and executed.

# Generate 3D visualization
neva build --target ir --target-ir-format threejs main

# Open ir.threejs.html in your browser
image

Also mermaid IR visualizer added and can be used like this

neva build --target ir --target-ir-format mermaid main
image

Other IR formats are also available: json, yaml and dot.

neva doc - Standard Library Search

Search the Neva standard library using regular expressions. Quickly find components, types, and functions without leaving your terminal.

# Search entire stdlib
neva doc "ZipMany"

# Search specific package
neva doc streams "Zip"

# Search with context lines
neva doc -C 5 "LoadEnv"

Example output:

std/streams/streams.neva:32
     26 | // === ZipMany ===
     27 | 
     28 | // Produces a stream of lists where each list contains items from the
     29 | // corresponding positions of the input streams. Stops when any stream is
     30 | // exhausted.
     31 | #extern(stream_zip_many)
>    32 | pub def ZipMany<T>([data] stream<T>) (res stream<list<T>>)
     33 | 
     34 | // === Product ===

The command supports:

  • Regex patterns for flexible searching
  • Package-scoped search with neva doc package/path pattern
  • Configurable context lines with -C flag
  • Sorted output by file and line number

See PR #927.

Watch Mode

Automatically rebuild and rerun your Neva programs when source files change.

# Run with watch mode
neva run --watch main

# Watch mode with trace enabled
neva run --watch --emit-trace main

The watcher:

  • Monitors .neva files and neva.yaml/neva.yml manifests
  • Uses intelligent debouncing (200ms) to avoid excessive rebuilds
  • Automatically watches new directories created during development
  • Prints clear status messages

See PR #931.

Trace Metadata Headers

Generated trace logs now include metadata headers with debugging information. When using --emit-trace, you'll get richer context about program execution.

# Build with trace
neva build --emit-trace main

# Run with trace
neva run --emit-trace main

See PRs #920 and #928.

Type System Improvements

  • Operator validation: Implemented checkOperatorOperandTypesWithTypeSystem for stricter compile-time checks of operator operand types
  • Grammar update: Improved language grammar definitions for better parsing and error messages
  • flowast & typesystem refactoring: Major internal cleanup for improved maintainability and correctness

Better error messages throughout the compiler pipeline, especially for:

  • Type mismatches in operators
  • Invalid stream operations
  • Missing interopable exports

See PRs #938, #941, #944.

📦 Standard Library

Streams

streams.ZipMany - Zip Multiple Streams

Combine multiple streams into a single stream of lists. Perfect for processing parallel data sources.

pub def ZipMany<T>([data] stream<T>) (res stream<list<T>>)

Example:

import { streams, fmt, runtime }

const first list<int> = [1, 2, 3]
const second list<int> = [10, 20, 30]
const third list<int> = [100, 200, 300]

def Main(start any) (stop any) {
    l2s1 ListToStream<int>
    l2s2 ListToStream<int>
    l2s3 ListToStream<int>
    zip_many streams.ZipMany<int>
    for For<list<int>>{fmt.Println<list<int>>}
    wait streams.Wait
    panic runtime.Panic
    ---
    :start -> [
        $first -> l2s1 -> zip_many:data[0],
        $second -> l2s2 -> zip_many:data[1],
        $third -> l2s3 -> zip_many:data[2]
    ]
    
    zip_many:res -> for
    for:res -> wait -> :stop
    for:err -> panic
}

Output:

[1, 10, 100]
[2, 20, 200]
[3, 30, 300]

Stops when any input stream is exhausted. See PR #919.

streams.Wait Relocation

The Wait helper moved to the streams package for better organization and discoverability.

See PR #923.

Stream Product Updates

Enhanced type checking for stream product operations with proper validation of operand types. Updated e2e tests to cover edge cases. See PR #947.

Strings

strings.Join Stream Support

The strings.Join component now has an overloaded version that consumes streams.

// Original - join from list
pub def Join(data list<string>, sep string) (res string)

// New - join from stream
pub def Join(data stream<string>, sep string) (res string)

See PR #918.

OS

Dotenv Loader

Load environment variables from .env files with the new LoadEnv component.

import { os }

def Main(start any) (stop any) {
    load os.LoadEnv
    ---
    :start -> '.env' -> load:filename
    load:values -> // dict<string> with parsed values
    load:err -> // handle errors
}

Features:

  • Defaults to .env in current directory if filename is empty
  • Already defined environment variables are left untouched
  • Returns parsed values as dict<string>
  • Proper error handling

See PR #932.

🧪 Testing & Quality

CLI Template E2E Coverage

Added comprehensive end-to-end test coverage for CLI templates created with neva new. See PR #934.

# Create and test new project
neva new my-project
cd my-project
neva run .

E2E Test Infrastructure

Refactored e2e tests to use e2e.Run for consistent output handling. This removes direct exec.Command usage and provides better error messages.

func Test(t *testing.T) {
    out := e2e.Run(t, "run", "main")
    require.Equal(t, "expected output\n", out)
}

See PR #948.

🧩 Misc Fixes & Refactors

  • Build system improvements: Better cross-platform support, GOOS/GOARCH handling, output file management
  • Examples: All new features come with working examples in examples/ and/or e2e/ directories

🙏 Thanks

This release represents a major step forward for Neva — especially with Go interop enabling real-world hybrid applications. Thanks to everyone experimenting with Neva and providing feedback.

Contributors: @emil14, @k1ngmang

Pull requests: #916, #918, #919, #920, #923, #927, #928, #931, #932, #934, #938, #939, #941, #943, #944, #947, #948, #949

Full Changelog: previous...current

New Contributors