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

docusaurus: plutus exe #6743

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft

docusaurus: plutus exe #6743

wants to merge 4 commits into from

Conversation

bezirg
Copy link
Contributor

@bezirg bezirg commented Dec 11, 2024

Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Changelog fragments have been written (if appropriate)
    • Relevant tickets are mentioned in commit messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Targeting master unless this is a cherry-pick backport
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested


# Running and Debugging Compiled Code

You can run compiled code locally (without the need of a Cardano Node)
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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
Copy link
Contributor

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)

Copy link
Contributor Author

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? 🤷‍♂️

Copy link
Contributor

@ana-pantilie ana-pantilie left a 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.

doc/docusaurus/docs/using-plutus-tx/running-debugging.md Outdated Show resolved Hide resolved
doc/docusaurus/docs/using-plutus-tx/running-debugging.md Outdated Show resolved Hide resolved
doc/docusaurus/docs/using-plutus-tx/running-debugging.md Outdated Show resolved Hide resolved
doc/docusaurus/docs/using-plutus-tx/running-debugging.md Outdated Show resolved Hide resolved
doc/docusaurus/docs/using-plutus-tx/running-debugging.md Outdated Show resolved Hide resolved
doc/docusaurus/docs/using-plutus-tx/running-debugging.md Outdated Show resolved Hide resolved
doc/docusaurus/docs/using-plutus-tx/running-debugging.md Outdated Show resolved Hide resolved
doc/docusaurus/docs/using-plutus-tx/running-debugging.md Outdated Show resolved Hide resolved
doc/docusaurus/docs/using-plutus-tx/running-debugging.md Outdated Show resolved Hide resolved
doc/docusaurus/docs/using-plutus-tx/running-debugging.md Outdated Show resolved Hide resolved
using Nix, specifically for your platform:

``` shell
$ nix build .#cabalProject.$(nix eval nixpkgs#stdenv.buildPlatform.system).hsPkgs.plutus-core.components.exes.plutus
Copy link
Contributor

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.
Suggested change
$ 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"

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants