Skip to content

v0.37.0

Choose a tag to compare

@emil14 emil14 released this 16 May 07:54
· 274 commits to main since this release
6bc9695

The Last Mile Begins

Compared to v0.36.1, this release starts the final language-completion track: runtime tracing first, then visual tooling, then debugger stack.

Summary

  • Added runtime tracing for panic termination paths.
  • Standardized real-time trace file output to JSONL.
  • Added pkg/view foundation primitives for upcoming visual tooling.

Why this matters

In control-flow languages, production failures are explained by stack traces.
In Neva, execution is dataflow, so failure context is a causality graph of messages. This release makes that graph observable in runtime output.

Runtime Tracing

When panic happens, Neva now prints a panic cause dataflow trace to stderr.

Example A — minimal panic flow

import {
	fmt
	runtime
}

def Main(start any) (stop any) {
	panic runtime.Panic
	printf fmt.Printf
	---
	:start -> [
		'value=$1' -> printf:tpl,
		10 -> printf:args[0]
	]
	printf:err -> panic
	printf:sig -> :stop
}

Pretty trace view (target format):

panic:data <- printf:err
├─ printf:args[0] <- __newv2__2
│  └─ __newv2__2 <- :start
└─ printf:tpl <- __newv2__1
   └─ __newv2__1 <- :start

Example B — branched causes converging into one panic

import {
	fmt
	runtime
	strconv
}

def Main(start any) (stop any) {
	panic runtime.Panic
	printf fmt.Printf
	left_atoi strconv.Atoi
	right_atoi strconv.Atoi
	---
	:start -> [
		'left=$0 right=$1 extra=$2' -> printf:tpl,
		'10' -> left_atoi,
		'20' -> right_atoi
	]
	[left_atoi:err, right_atoi:err, printf:err] -> panic
	left_atoi:res -> printf:args[0]
	right_atoi:res -> printf:args[1]
	printf:sig -> :stop
}

Pretty trace view (target format):

panic:data <- __fan_in__2
└─ __fan_in__2:data[2] <- printf:err
   ├─ printf:tpl <- __newv2__7
   │  └─ __newv2__7 <- :start
   ├─ printf:args[0] <- left_atoi:res
   │  └─ left_atoi:data <- __newv2__8
   │     └─ __newv2__8 <- :start
   └─ printf:args[1] <- right_atoi:res
      └─ right_atoi:data <- __newv2__9
         └─ __newv2__9 <- :start

Note:
Current runtime output still exposes internal synthetic node names (for example __newv2__*) and may stop short of :start for some runtime funcs. The next tracing patch will align runtime output with the target view above.

JSONL Trace Files

Trace events written to file are standardized as JSONL (v=2, one event per line).

Real sample from trace.log:

{"message":{},"port":{"Path":"","Port":"start"},"event":"sent","causeIndexes":null,"v":2,"index":1}
{"message":"value=$1","port":{"Path":"__newv2__1","Port":"res"},"event":"sent","causeIndexes":null,"v":2,"index":4}
{"message":"value=$1","port":{"Path":"printf","Port":"tpl"},"event":"recv","v":2,"index":4}
{"message":10,"port":{"Path":"printf","Port":"args","Index":0},"event":"recv","v":2,"index":5}

Visual Tooling Foundation

This release also includes initial pkg/view projection primitives used by the read-only visual tooling track.

Related work

  • Tracing + visual tooling tracker: #1118
  • Visual editor track: #1050
  • View foundation PR: #1123

Support the project