Home Explore Blog CI



nushell

1st chunk of `book/nushell_map_imperative.md`
1be324d36317c000929b238811502ed8f955d7370dbbff7b0000000100001090
# Nu Map from Imperative Languages

The idea behind this table is to help you understand how Nu built-ins and plugins relate to imperative languages. We've tried to produce a map of programming-relevant Nu commands and what their equivalents are in other languages. Contributions are welcome.

Note: this table assumes Nu 0.94 or later.

| Nushell                                                                                                                                | Python                               | Kotlin (Java)                                               | C++                         | Rust                                                 |
| -------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | ----------------------------------------------------------- | --------------------------- | ---------------------------------------------------- |
| [`append`](/commands/docs/append.md)                                                                                                   | `list.append`, `set.add`             | `add`                                                       | `push_back`, `emplace_back` | `push`, `push_back`                                  |
| [`math avg`](/commands/docs/math_avg.md)                                                                                               | `statistics.mean`                    |                                                             |                             |                                                      |
| [`math`](/commands/docs/math.md), [Math Operators](nushell_operator_map.md)                                                            | Math operators                       | Math operators                                              | Math operators              | Math operators                                       |
| [`cp`](/commands/docs/cp.md)                                                                                                           | `shutil.copy`                        |                                                             |                             | `fs::copy`                                           |
| [`date`](/commands/docs/date.md)                                                                                                       | `datetime.date.today`                | `java.time.LocalDate.now`                                   |                             |                                                      |
| [`drop`](/commands/docs/drop.md)                                                                                                       | `list[:-3]`                          |                                                             |                             |                                                      |
| [`du`](/commands/docs/du.md), [`ls --du`](/commands/docs/ls.md)                                                                        | `shutil.disk_usage`                  |                                                             |                             |                                                      |
| [`each`](/commands/docs/each.md)<br />[`for`](/commands/docs/for.md)                                                                   | `for`                                | `for`                                                       | `for`                       | `for`                                                |
| [`exit`](/commands/docs/exit.md)                                                                                                       | `exit()`                             | `System.exit`, `kotlin.system.exitProcess`                  | `exit`                      | `exit`                                               |
| [`http get`](/commands/docs/http_get.md)                                                                                               | `urllib.request.urlopen`             |                                                             |                             |                                                      |

Title: Nu Commands Mapped to Imperative Languages
Summary
This section provides a table mapping Nu commands to their equivalents in Python, Kotlin (Java), C++, and Rust. It covers commands related to list manipulation, mathematical operations, file system operations, date handling, iteration, and program exit, among others. The table aims to help users familiar with imperative languages understand Nu's built-ins and plugins.