What Novis is for
Novis is a programming language for two kinds of program. Web applications are the main use. Command-line scripts are the second use. The syntax is close to PHP, so a PHP programmer can read most Novis code without help. Start here shows the differences.
Web applications
Section titled “Web applications”Novis is made first for web applications. nvs serve runs your application as a web server, so you
need no other server program. Each request runs on its own, with its own memory and its own limits.
The standard library has what most web applications need. Core\Router sends each request to the
right method, and Core\Db queries a database. The server checks each Post request for CSRF (a
request sent from another site) before your code runs.
A JSON API and A form handler
show a small application from start to end.
Command-line scripts
Section titled “Command-line scripts”Novis also runs programs that you start from the command line. Examples are a script, a report or a
scheduled job. nvs run starts the program. It uses the same language and the same standard library
as your web application.
A CSV report and A scheduled job show two small scripts.
Security first, as fast as possible
Section titled “Security first, as fast as possible”Security is the first priority for both kinds of program. When a design is faster but less safe, Novis takes the safer design. Within that limit, Novis is as fast as possible.
A web server reads input from people it does not know. So Novis checks the most common mistakes before your program runs:
- Text from a request is tainted. You must check or escape it before it reaches a database query, a shell command or an HTML page. Read more in Tainted input.
- Each request runs on its own. A request that crashes or loops forever stops only itself. Read more in One request cannot change another.
- Each request has limits for memory and time, which you set in
nvs.toml. Read more in Memory and CPU limits.
Fast without extra work
Section titled “Fast without extra work”Novis compiles your code to machine code before it runs. You do not need a build step and you do not need to tune anything. Read more in Compiled, never interpreted.
Everything in one binary
Section titled “Everything in one binary”nvs is one program. It runs your code, serves web requests, runs your tests and formats your
files. The standard library comes with it. It has classes for JSON, databases, HTTP, passwords,
dates and much more. Most programs need no package from outside.
