Work after the response
Your code sends an email after the browser has the page, in the same request.
You can build a business app, a website, an API or any other web service with it. The tools that a modern web application needs are built in.
HTML
<?nvs// The request has `?name=<script>alert(1)</script>`.// In a web response, `echo` escapes HTML.// The browser shows the script as text. It does not run.echo Core\Request::queryParameter('name');<script>alert(1)</script>The script is escaped. Your code calls no escaping function.
SQL
<?nvs// Text from a request is a `tainted string`. It cannot be// part of the text of a database query, so this program// does not compile. Send the value as a `?` parameter.var $db = Core\Db::connect('main');var $id = Core\Request::queryParameter('id');$db->query("select * from users where id = $id", []);error[E0401]: expected `string`, found `tainted string` --> hero-sql-error.nvs:7:12 |7 | $db->query("select * from users where id = $id", []); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is `tainted string` = help: SQL text cannot be `tainted`. Write a `?` in the SQL and pass the value as a bound parameter. A table or column name goes through `Core\Db::quoteIdentifier`
error: aborting due to 1 errorTo read what a code means and how to fix it, run `nvs agent show <code>`.The compiler stops SQL injection before the program runs.
Secrets
<?nvs// The password from a login form is `secret`.// It is also `tainted`, because it comes from the request.// `echo` cannot print a `secret` value.// So this program does not compile.secret tainted string $password = Core\Request::formField('password') ?? '';echo $password;error[E0790]: `echo` cannot print a `secret` value --> hero-secret-error.nvs:7:6 |7 | echo $password; | ^^^^^^^^^ this value is `secret` = help: Output is read by people and saved in logs. To print the value anyway, call `Core\Secret::reveal($value, "reason")` first. Joining it into a longer string does not help. The result is `secret` too.
error: aborting due to 1 errorTo read what a code means and how to fix it, run `nvs agent show <code>`.The compiler finds the password in the page before the program runs.
The same small web programs run in Novis, PHP, Bun, Go, Node.js, .NET and Python. One command measures all seven servers on one machine: speed, memory, deploys and runaway requests.
You change a source file on a running server. The next requests use the new code, and no request fails.
Each request has its own memory limit and CPU time limit. One bad request cannot stop the whole server.
Each walkthrough is a short animation of one feature. Press play to start it.
Your code sends an email after the browser has the page, in the same request.
Most sites load the slow parts of a page with a script and extra API routes. In Novis, the page and its slow parts come in one request.
nvs runs your code, serves web requests, runs your tests and formats your files.Some mistakes are common in web code. The Novis compiler finds them before any of your code runs.
A value from a request is a tainted string. It cannot become part of the text of a query. You send it as a parameter instead.
<?nvs// This program puts text from a request into the text of a database query, so it does not compile.tainted string $name = Core\Request::queryParameter('name') ?? '';var $db = Core\Db::connect('main');
var $users = $db->query("select id from users where name = '" . $name . "'", []);error[E0401]: expected `string`, found `tainted string` --> sql-error.nvs:6:25 |6 | var $users = $db->query("select id from users where name = '" . $name . "'", []); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this is `tainted string` = help: SQL text cannot be `tainted`. Write a `?` in the SQL and pass the value as a bound parameter. A table or column name goes through `Core\Db::quoteIdentifier`
error: aborting due to 1 errorTo read what a code means and how to fix it, run `nvs agent show <code>`.A password or a key is a secret string. Code that prints it or writes it to a log does not compile.
<?nvs// This program prints a secret string, so it does not compile.secret string $key = 'sk-12345';echo $key, "\n";error[E0790]: `echo` cannot print a `secret` value --> secret-values-error.nvs:4:6 |4 | echo $key, "\n"; | ^^^^ this value is `secret` = help: Output is read by people and saved in logs. To print the value anyway, call `Core\Secret::reveal($value, "reason")` first. Joining it into a longer string does not help. The result is `secret` too.
error: aborting due to 1 errorTo read what a code means and how to fix it, run `nvs agent show <code>`.Novis checks the things that often go wrong in web code. The checks are part of the language, so there is nothing extra to install.
as int throws an error when the text is not a whole number. as ?int gives null, and your code decides what happens next.
<?nvs// This program converts text from a form to whole numbers.string $age = '42';string $typo = '4x2';
// `as ?int` gives `null` when the text is not a whole number.echo ($age as ?int) ?? 'not a number', "\n";echo ($typo as ?int) ?? 'not a number', "\n";42not a numberCore\Str counts the characters a person sees. An accent or an emoji stays whole.
<?nvs// This program counts and reverses text with an accent and an emoji.string $word = 'café 👍🏽';
// `Core\Str::length` counts the characters a person sees. This prints `6`.echo Core\Str::length($word), "\n";echo Core\Str::reverse($word), "\n";6👍🏽 éfacCore\Json::encode writes a shape, a list, a string or any other value as JSON. A shape keeps its keys in the order you write them.
<?nvs// `Core\Json::encode` writes any value as JSON on one line.array<string> $lines = [ // A shape becomes a JSON object. Its keys stay in the order they are written. Core\Json::encode({ status: 'ok', version: 3 }), // A list becomes a JSON array. Core\Json::encode(['red', 'green', 'blue']), // A string gets quotes, and each quote inside it is escaped. Core\Json::encode("Say \"hi\""),];
// `Core\Response::sendText` sends the three lines exactly as they are.Core\Response::sendText(Core\Str::join($lines, "\n"));{"status":"ok","version":3}["red","green","blue"]"Say \"hi\""Core\Task::all runs several functions at the same time. Each result has its own name and its own type.
<?nvs// This program runs three jobs at the same time and reads each result by name.var $page = Core\Task::all({ rows: fn(): array<int> => [10, 20, 30], label: fn(): string => 'orders', total: fn(): int => 60,});
// Each result has the type that its function returns.echo $page->label, ': ', Core\Arr::count($page->rows), ' rows, ', $page->total, " in total\n";orders: 3 rows, 60 in totalhtml template escapes every value in it. A comment from a user is shown as text.Core\Json::decodeAs reads JSON into an object of your class and checks every property.User is never null. Only a ?User can be. The compiler checks every place that uses it before the program runs.catch after a call gives a default value when the call throws an error.A request can crash, run out of memory or loop forever. When that happens, only that request stops. The server keeps running, and every other request finishes normally.
nvs.toml. They apply to every request.It has classes for JSON, databases, HTTP, passwords, dates and much more. Most programs need no package from outside.
Every class has its own page in the reference. It lists each method and its parameters.
Open the reference<?nvs// This program uses `Core\Str`, `Core\Arr` and `Core\Response`. Each first argument is the input.array<string> $colors = Core\Str::split('red,green,blue', ',');array<string> $sorted = Core\Arr::sort($colors);
// `Core\Response::sendJson` sends the value as JSON.Core\Response::sendJson({ count: Core\Arr::count($colors), sorted: $sorted });{"count":3,"sorted":["blue","green","red"]}nvs is one program. It runs your code, serves web requests, runs your tests and formats your files.
nvs run app.nvs# Check, compile and run a programnvs serve app.nvs# Serve web requestsnvs test tests/# Run every testnvs check app.nvs# Report every error and run nothingnvs fmt# Format your filesnvs build --compile app.nvs# Write one executable file with your programnvs build --openapi app.nvs# Write the OpenAPI document of your web APInvs run --profile=speedscope app.nvs# Measure how long each function takesnvs debug# See each request your server handlednvs dap# Stop at a line in your editornvs lsp# Errors and completion in your editorA test is a method with #[Test]. nvs test runs each test on its own. You do not install a package for it.
<?nvs// This program has a class and a test for it. `nvs test` runs the test.use Core\Test;
class Cart{ public static function total(int $price, int $count): int { return $price * $count; }}
final class CartTest{ // `#[Test]` makes this method a test. You do not install a package for it. #[Test] public function multipliesPriceByCount(): void { Test::assertSame(Cart::total(250, 4), 1000); }}
// `nvs run` runs this line and not the test.echo Cart::total(250, 2), "\n";500nvs contains the full documentation of the language and its library. A coding agent looks up what it needs. The compiler checks every file the agent writes before the file runs.
nvsnvs agent find and nvs agent show print the documentation of each class, method, setting and error code. It always matches the version you installed.
nvs agent init writes an AGENTS.md file and the files your agent reads.
In Claude Code and Cursor, nvs checks each .nvs file after the agent edits it. The agent sees the errors at once.
The agent looks up a method
nvs agent find lengthCore\Str::length(string $s): uintCore\Bytes::length(bytes $b): uintIt checks the file it wrote
nvs check app.nvserror[E0401]: expected `int`, found `uint` --> app.nvs:4:14It reads what the error means
nvs agent show E0401code: E0401 A value has a type that this place does not accept.It fixes the code and checks again
nvs check app.nvsno errorsEvery number here comes from a recorded benchmark run or is counted in the repository.
The median of 5 runs, with 64 requests at the same time.
In the fastest run, 99 of 100 requests got their response within this time.
The most memory the whole server used during the test.
All 400,000 requests in 4 benchmark programs returned status 200.
Programs that try to break Novis. Each one passes only if Novis does not crash or hang.
Novis programs. Each one checks its output or its error message against the expected text.
Tests of the compiler, the runtime and the library, written in Rust.
Novis is made of 23 Rust crates (packages). In 16 of them, unsafe code does not compile.
nvs for Windows, Linux or macOS, or build it from source.Novis is free and open source. Install it, take the tour, and ask your questions on Discord. Every report and every idea helps.