You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 20, 2025. It is now read-only.
The equivalent of the .NET CLI (`dotnet`) in Rust is [Cargo] (`cargo`). Both
5
+
There is no concept of CLI in the JavaScript standard. People often use non-browser runtimes such as Node.js and Deno to act as CLIs.The equivalent of the JavaScript CLIs in Rust is [Cargo] (`cargo`). Both
6
6
tools are entry-point wrappers that simplify use of other low-level tools. For
7
-
example, although you could invoke the C# compiler directly (`csc`) or MSBuild
8
-
via `dotnet msbuild`, developers tend to use `dotnet build` to build their
7
+
example, although you could invoke the JavaScript engines, developers tend to use third-party tools such as `webpack` and `vite` to build their
9
8
solution. Similarly in Rust, while you could use the Rust compiler (`rustc`)
10
9
directly, using `cargo build` is generally far simpler.
11
10
12
11
[cargo]: https://doc.rust-lang.org/cargo/
13
12
14
13
## Building
15
14
16
-
Building an executable in .NET using [`dotnet build`][net-build-output]
17
-
restores pacakges, compiles the project sources into an [assembly]. The
18
-
assembly contain the code in Intermediate Language (IL) and can _typically_ be
19
-
run on any platform supported by .NET and provided the .NET runtime is
20
-
installed on the host. The assemblies coming from dependent packages are
15
+
When building JavaScript, the scripts coming from dependent packages are
21
16
generally co-located with the project's output assembly. [`cargo
22
-
build`][cargo-build] in Rust does the same, except the Rust compiler
17
+
build`][cargo-build] in Rust compiles the project sources, except the Rust compiler
23
18
statically links (although there exist other [linking options][linkage]) all
24
19
code into a single, platform-dependent, binary.
25
20
26
-
Developers use `dotnet publish` to prepare a .NET executable for distribution,
21
+
Developers use different ways to prepare a JavaScript executable for distribution,
27
22
either as a _framework-dependent deployment_ (FDD) or _self-contained
28
-
deployment_ (SCD). In Rust, there is no equivalent to `dotnet publish` as the
23
+
deployment_ (SCD). In Rust, there is no way to let the
29
24
build output already contains a single, platform-dependent binary for each
30
25
target.
31
26
32
-
When building a library in .NET using [`dotnet build`][net-build-output], it
33
-
will still generate an [assembly] containing the IL. In Rust, the build output
27
+
In Rust, the build output
34
28
is, again, a platform-dependent, compiled library for each library target.
In .NET, the contents of a project file define the build options and
40
+
There is no concept of dependency in the JavaScript standard. However, some JavaScript runtimes, such as Node.js and Deno, have the concept of dependencies. In Node.js and Deno, the contents of a project file (`package.json`) define the build options and
49
41
dependencies. In Rust, when using Cargo, a `Cargo.toml` declares the
50
42
dependencies for a package. A typical project file will look like:
0 commit comments