-
Notifications
You must be signed in to change notification settings - Fork 478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation: A "Coming from Perl" section #1843
Comments
I think that's a great idea - I've moved this over to our Doc repo where the PR will need to be as well. I also think that you have the right idea - this would be better as a page of its own rather than adding it to the rather unwieldy monolithic mapping table. Our docs are all user contributions, so hopefully someone can chime in who has the expertise in both Perl and Nushell to help out. If you'd like to start a page and ask in Discord (or possibly Stack Exchange) about specific items, perhaps we can collectively create something. For the items you asked about ... Well, I was answering them but had a reboot and lost it :-/ I'll try to fill something in in a bit. |
I found a couple of answers in the responses (quite possibly yours?) to nushell/nushell#4564
I would be happy to initiate a documentation page, but i'll need to work out the process. |
|
Really, really short version (the stuff I had to figure out my first time):
|
Thanks for the helpful comments, a good chunk of the answers are right there. A couple of thoughts or questions-
Does this imply the user is using Nushell as their default login shell, and then invoking custom commands in a kind of "personal DSL shell" environment? For me at this point I see Nushell more as a potential replacement for Perl than a replacement for bash. I never used Perl as an interactive shell, but instead as a tool to write utility scripts and small tools in something with all the capability of a shell, but also more of the approach of a "real" programming language with, in the case of Perl, access to an enormous module library (CPAN) covering just about any need you could think of. Similarly on Windows, I wouldn't bother with PowerShell just to open a terminal and list a few files. But CMD is a truly horrible thing to write scripts in, and then the verbosity of PowerShell is worth it because of the power of the language, and the deep (although sadly not complete) access to the Windows system.
👍
Yes, fair enough. Perl is very "Unix native". As Nushell is aimed at being cross-platform from the outset it seems reasonable to reply on external tools to access platform-specific stuff like this.
Interesting, so there will be some things you can do in Perl that just aren't possible in Nushell unless there happens to be a specific command built into the language. Presumably Nushell allows for library modules written in a lower-level language (e.g. Rust) in the same way that Perl has "native" modules written in C, so low-level interfaces (system calls, or something like a graphics library interface) could be implemented FOR nushell, but not IN nushell.
Thanks. That does sound rather nicer, although I know there's a lot of controversy around error handling models in languages, and try/catch is not immune. |
Perhaps not as their default/login shell to start. For instance, I used Fish for about 4 years before I discovered Nushell, and I kept Fish as my default shell for around a year before switching over "fully". During that transition, I would run Fish for navigation/external commands (e.g., I get the feeling that's the normal route for most users. The biggest reason for this is that scripts cannot output structured data, at least not today, and probably never when running inside another shell. A "personal DSL shell" is a great way of describing it -- A custom command can output structured data, so you can further refine the output on the command-line. Then, often, turn around and update the custom command. And, at some point for many users (obviously myself included), it just becomes natural to switch to Nushell entirely. It typically comes when you discover you just start up your existing shell and immediately type
Yes, plugins in Nushell (also, the developer doc) can be written in any language (but typically Rust) and can both make lower-level calls as well as participate in Nushell as first-class commands, including structured data, error handling, types, etc.
Agreed - It's not perfect, and I was personally somewhat skeptical when we first implemented the ability to handle external errors in |
Related problem
The "Coming from " sections of the Nushell book are a great idea, but there is an obvious "other language" missing- Perl.
As a solution that aims to bridge the gap between shells and programming languages the Pathologically Eclectic Rubbish Lister (PERL) seems to me the natural ancestor/competitor of Nushell. Perl may be long in the tooth but it is still a very widely used tool on Linux / Unix based systems, and has a lot of features designed specifically to make it work well as a "glue" language.
It's not obvious (at least to me as a user new to Nushell) how some of the things Perl can do can be accomplished in Nushell, some specific "getting started" help would be useful.
Describe the solution you'd like
A documentation section on "Coming from Perl" could help open up Nushell to areas where Perl has been the "swiss army knife" of system automation for years.
As an example, it would be particularly helpful to have idiomatic Nushell alternatives for the Perl "special variables" including-
Describe alternatives you've considered
No response
Additional context and details
No response
The text was updated successfully, but these errors were encountered: