https://vekatze.github.io/neut/overview.html Neut Programming Language GitHub 1. 1. Overview 2. 2. Installation 3. 3. Tutorial 4. 1. 3.1. Hello External World 2. 3.2. Programming in Neut 3. 3.3. Static Memory Management 4. 3.4. Modality and Memory 5. 4. Language Reference 6. 1. 4.1. Commands 2. 4.2. Modules 3. 4.3. Statements 4. 4.4. Terms 5. 4.5. Primitives 6. 4.6. Basis 7. 5. What is Next? 8. 9. Appendix 10. 6. Manual Installation 11. 7. Development Environment 12. 1. 7.1. Lovely LSP Showcase 2. 7.2. Rapid Prototyping 3. 7.3. Editor Setup 13. 8. How to Execute Types 14. 9. Benchmarks Neut Programming Language Neut is a functional programming language with static memory management. Its key features include: * Full l-calculus support * Predictable automatic memory management * The absence of annotations to the type system when achieving both of the above Neut doesn't use GCs or regions. Instead, it takes a type-directed approach to handle resources. What Does it Look Like? Like the following: // the obligated hello world define hello(): unit { print("Hello, world!\n") } // algebraic data types data my-list(a) { | Nil | Cons(a, my-list(a)) } // a recursive function with pattern matching define noisy-length(xs: my-list(a)): int { match xs { | Nil => 0 | Cons(_, ys) => let my-message = "hey\n" in print(my-message); add-int(1, noisy-length(ys)) } } Static Memory Management -- But How? Neut translates a type into a function that can discard/copy the values of the type. By using those functions, the compiler translates programs so that every variable is used exactly once. For example, if a variable is used twice, a translation like the following will happen: // (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 How to Execute Types. You may wonder: "So we need to, for example, copy the whole list just to get its length? Isn't it the end of the world?". This topic is covered in Static Memory Management. As written there, Neut avoids such copyings by using the T-necessity operator in modal logic to achieve something like borrowing in Rust. How Fast is This? Please see the benchmarks. List of Other Basic Characteristics? * Call by value * Impure * Compiles to LLVM IR and binary * The type system [?] CoC + ADT + (T-necessity) + (fix) - (universe hierarchy) + That is, the usual one in functional programming, but a bit generalized * Built-in LSP support * Built-in rapid prototyping experience like scripting languages * Built-in formatter like Go Anything Else? You might also find Neut's module system interesting. It distinguishes modules using the digests (checksums) of tarballs and defines module identities using version information. Although this is not the main point of the language, it still might be of interest. This topic is covered in the tutorial. Also, Neut includes an LSP server, which provides things like code completion, error reporting on save, etc. See Lovely LSP Showcase to see it in action. --------------------------------------------------------------------- You can press the "-" key to go to the next page. Next Page - 1. 1. Overview 2. 2. Installation 3. 3. Tutorial 4. 1. 3.1. Hello External World 2. 3.2. Programming in Neut 3. 3.3. Static Memory Management 4. 3.4. Modality and Memory 5. 4. Language Reference 6. 1. 4.1. Commands 2. 4.2. Modules 3. 4.3. Statements 4. 4.4. Terms 5. 4.5. Primitives 6. 4.6. Basis 7. 5. What is Next? 8. 9. Appendix 10. 6. Manual Installation 11. 7. Development Environment 12. 1. 7.1. Lovely LSP Showcase 2. 7.2. Rapid Prototyping 3. 7.3. Editor Setup 13. 8. How to Execute Types 14. 9. Benchmarks