-
Notifications
You must be signed in to change notification settings - Fork 483
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
docusaurus: plutus exe #6743
base: master
Are you sure you want to change the base?
docusaurus: plutus exe #6743
Conversation
|
||
# Running and Debugging Compiled Code | ||
|
||
You can run compiled code locally (without the need of a Cardano Node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the for most people, the most useful functionality of the executable is optimizing UPLC. This should be made clear at the beginning. Debugging, on the other hand, should be de-emphasized, since we don't really have a working debugger.
The initial examples should also focus on how to use it for UPLC optimization, before talking about anything else.
In the following example we check a program written in the PIR (Plutus Intermediate Representation) language: | ||
|
||
``` shell | ||
$ echo "(program 1.1.0 (lam x (con integer) (lam y (con integer) x)))" > const.pir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For each thing the executable can do (compiling, checking etc.), the first examples should be UPLC (unless the thing doesn't apply to UPLC). TPLC and PIR examples are optional, and if you prefer to include them, they should come after the UPLC examples.
|
||
``` shell | ||
$ echo "(program 1.1.0 (lam x (con integer) (lam y (con integer) x)))" > const.pir | ||
$ plutus const.pir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if you run plutus
without any flag, it performs static checks? That's a weird default, and isn't clear from the help message.
@@ -13,7 +13,7 @@ is hosted on the [Releases] page. Alternatively, you can build the tool specific | |||
for your platform using Nix: | |||
|
|||
``` shell | |||
nix build FIXME | |||
$ nix build .#cabalProject.x86_64-linux.hsPkgs.plutus-core.components.exes.plutus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd wrap it in double-quotes just in case there are readers with zsh shell... (# is a beginning of comment there)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to work fine from here. I just installed zsh and fired this command and it works? 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing this up! The debugger is definitely cool, but I agree with Ziyang, the docs should be uplc focused and I see that there's currently nothing about how to run just optimisations on an input uplc
program.
182449b
to
e38502d
Compare
using Nix, specifically for your platform: | ||
|
||
``` shell | ||
$ nix build .#cabalProject.$(nix eval nixpkgs#stdenv.buildPlatform.system).hsPkgs.plutus-core.components.exes.plutus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Without the
$
I can copy-paste this line easier. - With double quotes around the argument I am protected from
zsh
mis-interpreting it as a comment.
$ nix build .#cabalProject.$(nix eval nixpkgs#stdenv.buildPlatform.system).hsPkgs.plutus-core.components.exes.plutus | |
nix build ".#cabalProject.$(nix eval nixpkgs#stdenv.buildPlatform.system).hsPkgs.plutus-core.components.exes.plutus" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect that without the shell
specifier this fenced code block will also have the "Copy To Clipboard" button.
Pre-submit checklist: