Update `example.nu` to valid nu script
example.nu is an old file. It's nice to have something to benchmark, but the issue is that currently is not valid nushell.
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.
maybe we should just write a bunch of smaller benchmark files to measure different performance things?
Yes, I believe that should be better!
this is the reason you closed #24, right? :yum:
@AucaCoyan i agree with the comment you posted in the PR :+1:
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 👍🏼
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.