Concepts
Responses
A program that ran always gets 200. What happened is in the body: an outcome, a result per form, the output and the stats.
Status
HTTP status codes describe the request, not the program. A 4xx or 5xx means the request was turned away before or instead of running (see Errors). Otherwise the outcome is in status:
status | Meaning |
|---|---|
ok | Every form ran. |
error | A form raised an error: a wrong type, an unbound variable, a call to error, and so on. |
timeout | The program ran past its wall-clock timeout and was stopped. |
limit_exceeded | The program hit a step, memory, integer size or complexity limit, or the source was too large. |
Results
Each top-level form that finished gets a result, in source order, with its 0-based index and the line and col where it starts. When a program fails partway, the forms before the failure still have results, and error says which form failed:
Values and JSON
value is the printed (write) form, exact for every type, or null when the value is unspecified, as with define. json is a typed copy you can use directly, but it can lose information:
| Scheme value | json | Notes |
|---|---|---|
| Integers and floats | numbers | JS clients lose precision past 2^53. Use value for exact bignums. |
| Strings and symbols | strings | A symbol and a string with the same text look the same. |
#t and #f | booleans | — |
'() and proper lists | arrays | Nested lists become nested arrays. |
| Improper lists, procedures, unspecified | null | Read value instead. |
Printed values longer than the per-result limit are cut short, and value_truncated is true.
Output
stdout holds everything written with display, write and newline. Past the output limit the rest is dropped and stdout_truncated is true. Output from forms before a failure is kept.
Stats
cpu_ms is the CPU time your program used, and it's what you're billed for, as max(1, ceil(cpu_ms)) milliseconds. wall_ms is the elapsed time. steps and memory_bytes are null when the process was killed, for example on a timeout.
All fields
EvalResponse
| Field | Description |
|---|---|
statusstring · required | One of ok, error, timeout, limit_exceeded. |
resultsResult[] · required | The forms that finished, in order. |
stdoutstring · required | — |
stdout_truncatedboolean · required | — |
statsStats · required | — |
errorEvalError | null · required | — |
request_idstring · required | — |
Result
| Field | Description |
|---|---|
indexinteger · required | 0-based position of the form in the source. |
lineinteger · required | — |
colinteger · required | — |
valuestring | null · required | Printed (write) form, exact for every type. null when the value is unspecified. |
value_truncatedboolean · required | — |
jsonany | null · required | Typed copy of the value: numbers, strings (strings and symbols), booleans, arrays (proper lists). null for improper lists, procedures and unspecified values. JS clients lose precision past 2^53; use value for exact bignums. |
Stats
| Field | Description |
|---|---|
wall_msnumber · required | — |
cpu_msnumber · required | CPU time used; what's billed, as max(1, ceil(cpu_ms)). |
stepsinteger | null · required | null when the process was killed. |
memory_bytesinteger | null · required | null when the process was killed. |
EvalError
| Field | Description |
|---|---|
typestring · required | Stable identifier to match on. One of syntax_error, unbound_variable, wrong_type, arity_mismatch, not_a_procedure, division_by_zero, arithmetic_error, user_error, timeout, step_limit, memory_limit, integer_too_large, too_complex, source_too_large, internal_error. |
messagestring · required | — |
indexinteger | null · required | The form that failed. |
lineinteger | null · required | — |
colinteger | null · required | — |