PersonViews – Neut Programming language
Neut is a programming language with static memory management.
The important features of it include:
- Full λ-calculus support
- Respectful Automatic Memory Management
- The loss of system annotations in type when reaching both above
Neut is not used in GCS or regions. However, a Type-Direct Method to handle resources.
As follows:
// the obligated hello world
define hello(): unit Cons(a, my-list(a))
// algebraic data types
data my-list(a) Cons(_, ys) =>
let my-message = "hey\n" in
print(my-message);
add-int(1, noisy-length(ys))
// a recursive function with pattern matching
define noisy-length(xs: my-list(a)): int {
match xs
}
Nee, translates a type of a function to escape / copy the values of type. By using the tasks, the compiler translates programs so each variable is used at once.
For example, if a variable is used twice, an interpretation as follows occurs:
// (before)
let xs: list(a) = (value-1, value-2) in
some-func(xs, xs) // `xs` is used twice
// ↓
// (after)
let xs: list(a) = (value-1, value-2) in
let (xs1, xs2) = copy-list-a(xs) in // `xs` is used once
some-func(xs1, xs2)
If you need more, see you How to impose types.
You may think: “So we need, for example, copy the entire list to get its length? Isn’t the end of the world?”. This subject is covered Static Memorial Management. As written there, neut avoided such collections by using the T-required operator In modal logic to achieve something like borrowing at stake.
- Call by value
- bleed
- Gathered together Llvm ir and binary
- The type system ≒ COC + ADT + (T-Must) + (Repair) – (universe hierarchy)
- That is, the usual one of functional programming, but a bit
- Was built-in LSP support
- Was built-in fast-faced prototyping experience Like scripting languages
- The built-in formatter is like going
You can also find the Neut module system. It introduces modules using digests (checks) in tarballs and describes IDYYDONE identities using version information. Although it is not the main point of language, it can still be interested. This subject is covered with tutorial.
Also, Neut includes a LSP server, which gives things such as completing the code, reporting the error of schooling, etc. See Happy lsp show to see this in action.
You can keep “→” key to go to the next page.
2025-02-24 04:12:00