As you probably noticed, Nushell behaves quite differently from other shells and dynamic languages. In Thinking in Nu, we advise you to think of Nushell as a compiled language but we do not give much insight into why. This section hopefully fills the gap.
First, let's give a few example which you might intuitively try but which do not work in Nushell.
Sourcing a dynamic path
source $"($my_path)/common.nu"
Write to a file and source it in a single script
"def abc [] { 1 + 2 }" | save output.nu