FarNet "script assembly" support #35
nightroman
announced in
Announcements
Replies: 1 comment
-
FarNet 6.0.20 - modules may have fn-methods as well. They are called using the similar syntax:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
FarNet 6.0.18 in addition to FarNet modules supports FarNet scripts. In spite
of the name, scripts are usual assemblies with methods called by the command
fn:
.It's the first step. FarNet will provide tools for building from sources on the
fly. Then FarNet scripts will be closer to what "scripts" usually mean.
See README for details.
Sample scripts:
Scripts vs. modules
Pros:
Cons:
fn:
.fn:
syntax is somewhat verbose for manual typing.Scripts vs. alternatives
The known and considered alternatives are:
Roslyn would be suitable for simple REPL scenarios but not so good for complex.
But for REPL,
FarNet.PowerShellFar
is arguably easier to use and more powerful.CS-Script is more suitable for complex scripts but still has various limitations.
Multiple sources may have conflicting using statements, NuGet support is limited.
Roslyn and CS-Script do not have natural or straightforward debugging support.
Moving or sharing source files between modules and scripts is more difficult.
In contrast, FarNet scripts are technically not scripts. They have no limitations.
They may be complex, with dependencies (NuGet, projects) and usual debugging.
The price for that is script building, manual now but somehow automated eventually.
On the other hand, compiled scripts are better for performance in the long term.
Beta Was this translation helpful? Give feedback.
All reactions