# Declaring protos

## Import statements

Protos are usually created when importing libraries or external code.&#x20;

## Instantiable protos

Classes and structs are imported as protos. The constructor of a class or struct is therefore an instantiable proto.

## Non-instantiable protos

Every other proto (fixed classes, libraries) are not instantiable. You can call methods and instantiate classes on non-instantiable protos.

```javascript
with math from std:math

var res = math.sqrt(16) //call a function on the proto

var velocity = math.Function("10x²+5x+3") //instantiate an object from the proto
var position = fn.integrate()
```

## Manually declaring protos

### Protos as variables

One can declare variables with the datatype `proto`. This is useful to create aliases for protos or pass protos to functions.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hadeslang.gitbook.io/doc/language-spec/classes-and-variables/declaring-protos.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
