Skip to content
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

Update example.nu to valid nu script #23

Open
AucaCoyan opened this issue Jun 10, 2023 · 7 comments
Open

Update example.nu to valid nu script #23

AucaCoyan opened this issue Jun 10, 2023 · 7 comments
Labels
benchmarks bug Something isn't working

Comments

@AucaCoyan
Copy link
Contributor

example.nu is an old file. It's nice to have something to benchmark, but the issue is that currently is not valid nushell.

@fdncred
Copy link
Collaborator

fdncred commented Jun 10, 2023

This is how I generated the example.nu file.

$nu.scope.commands |
where is_builtin and (not $it.is_extern) |
get -i examples |
each {|r| $r.example? | append (char nl)} |
flatten | save -f example.nu

As you can see, this is just a dump of all the examples in all commands. Each is valid, but it's not valid as one lump of code.

@amtoine
Copy link
Member

amtoine commented Jun 10, 2023

maybe we should just write a bunch of smaller benchmark files to measure different performance things?

@amtoine amtoine linked a pull request Jun 10, 2023 that will close this issue
5 tasks
@AucaCoyan
Copy link
Contributor Author

Yes, I believe that should be better!

@amtoine
Copy link
Member

amtoine commented Jun 10, 2023

this is the reason you closed #24, right? 😋

@amtoine
Copy link
Member

amtoine commented Jun 10, 2023

@AucaCoyan
i agree with the comment you posted in the PR 👍

@AucaCoyan
Copy link
Contributor Author

Cool. I copy to have better issue readability

It's better to make a new file I guess. Because example.nu is script-generated, we shouldn't assume it will be constant over time.
I would rather create another file. What do you think?
#24 is available to re-open 👍🏼

@fdncred
Copy link
Collaborator

fdncred commented Jun 10, 2023

Right, it's probably better to have some other smaller samples or make a big file that is fully nushell compliant. There are several files on nu_scripts that are pretty long that don't change things but maybe query github or other things like that.

example.nu was used for me to test syntax highlighting and regular expressions in the vscode-nushell-lang extension. it was never really meant to be ran by itself.

@amtoine amtoine added bug Something isn't working benchmarks labels Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
benchmarks bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants