Sign up for free to use this document yourself.
  • ENSO

  • Basics

  • Nightly builds

  • Various random notes

  • OLD LUNA - TODO: DELETE THIS

  • Basic interface & usage

  • Visualizers

  • Syntax

    Notes and hints about Luna code syntax.

  • Other advanced stuff

  • keyboard shortcuts!

    • ctrl-` — show code editor
    • ctrl-s — save
    • ctrl-click/ctrl-enter — edit node
    • ctrl-g — group nodes
    • space — toggle visualization
  • logs are in %LocalAppData%/enso/log on Windows

  • …of the language engine (enso):

    First, download GraalVM 20.02 and make sure it’s in PATH. Set env variables as described in the GraalVM guide for Windows. Check version with:

    $ java -version
    openjdk version "11.0.8" 2020-07-14
    OpenJDK Runtime Environment GraalVM CE 20.2.0 (build 11.0.8+10-jvmci-20.2-b03)
    OpenJDK 64-Bit Server VM GraalVM CE 20.2.0 (build 11.0.8+10-jvmci-20.2-b03, mixed mode, sharing)

    then:

    1. Go to enso’s Actions tab on GitHub
    2. Go to Engine CI workflow and click a commit
    3. Scroll down to Artifacts section
    4. Download an enso-project-manager and start it in background
    5. Start IDE with --no-engine flag, to disable the builtin/integrated engine
  • …of the GUI (ide):

    1. Go to ide’s Actions tab on GitHub
    2. Go to Build (…) workflow and click a commit
    3. Try downloading an installer or something from the Artifacts section, then installing it
  • From @manyone on Discord:

    1. because there are no error messages, i can tell an error is present when the block i’m working on is not multi colored so no amount of clicking on the eye will show a visualization. the cause of the error is usually wrong syntax in the current block (or from another block elsewhere).
    2. you can’t have an incomplete block floating around. for example , if there is an “a + b” block with one or both parameters missing, any new block you create will not compile clean even if you have correct syntax in the block. in short, no loose ends.
    3. once a block is clean , sometimes, you get a visualization that is locked - ie. when you edit the block to change a parameter, the visual does not change. you have to disconnect and reconnect to resolve this. (i think i know why this happens - there is an unresolved block somewhere so nothing else can be changed - the error block has to be fixed first)
    4. the block editor isn’t really intuitive and inconsistent - sometimes a backspace works - or reverts the command back to the original template thus deleting all changes you’ve made so far. it takes me several trials to make the “[x]+a” in the code where i’m trying to prepend 4 to [3,5,7] (see upper right corner of image)
    5. there is a slight coloring problem for that task above . for example in “[x]+a” , the x is colorless!
    6. the IDE insists on saving the last thing you’re working on as ‘unnamed’. renaming works inside the IDE but the file is not saved under the new name, it is still saved as unnamed.
    7. use cons for lists, use concatenate for vectors - dont mix - enso will allow you to cons something into a vector but the result is not displayable and you can’t write any clean code after that.
  • OLD LUNA - TODO: DELETE STUFF BELOW THIS LINE

  • After successful installation, to run Luna Studio:

    • a) on Windows: find it in the Windows Start Menu
    • b) on Linux: run ~/.luna/bin/luna-studio/current/luna-studio
  • By default, a new project is created in a temporary directory. To save it in a different path, press Ctrl-S, or go to menu FileSave, and enter a new path of the project directory.

  • Tab is super important in Luna Studio, it’s used to create a new node (explained in the docs — http://docs.luna-lang.org)

  • You can browse full standard library at: https://github.com/luna/luna-studio/tree/master/env/Std/src

  • To see a “visualization“ of a result of a node, hover over the node, then click the “eye icon” top-right of the node. A small white triangle will show bottom-left of the node; you can use it to choose visualization format. Anyway, you must wait a bit (as usually) for the visualization to show.

  • To add node working on a result of other node, you must select the first node, then hit Tab. It will not work if the source node is not selected (orange circle around it), even if you click the “output arc” to build a “wire”, and hit Tab when building the wire.

  • To convert a block of nodes into a new function, select the nodes, then press F. (via)

  • “You [can] expand a (selected) node with the Enter to access the sliders and detailed view of the ports”

    (source: discord chat)

  • Quick info about adding visualizers

    @akavel visualizers for text and jsons are in place: the json visualizer is actually available for any type and is named base: json. The text one appears on Text objects and is called base: text. Adding the visualizers is now possible but hacky – you’d need too add them inside the package. We’re working on plugging that into the Atom plugins system – it’s as important as a package manager, the visualizers will be easily shareable, like libraries. For now you can see how the stock visualizers are handled here: https://github.com/luna/luna-studio/tree/master/luna-studio/atom/lib/visualizers

    Each of these has a config.js file that defines a predicate taking a representation of type and returning paths to HTML files to display for given type. Each of the visualizers then communicates with Luna Studio using iframe messsages to receive data (both for visualizers handling static data and streaming sources)

  • Choosing a visualizer

    you can click a small triangle that should appear to the left and down from a node and choose one of available visualizations

  • if — 2-way conditional

    if condition then result1 else result2

    Examples:

    if char == "<" then Prepend "<" acc else acc

    (source: #125)

  • case — pattern matching / multi-way conditional

    case expression of
    pattern1 : result1

    patternN : resultN

    Examples:

    class JSON:
        ...
        def asText: case self of:
            JSONString t: t
            other: throw "JSON.asText: not a text"

    (source: Std.JSON)

  • Logs of the Luna apps are in:

    • a) on Windows: %userprofile%\.luna\logs
    • b) on Linux: ~/.luna/logs
  • Adding Haskell modules to Luna

    Currently doable in a hacky, non-shareable way:

    https://discuss.luna-lang.org/t/how-to-connect-to-hs-code-without-ffi/78/3

  • Deleting old versions of Luna

    • a) on Windows: see in C:\Program Files\LunaStudio\
    • b) on Linux: see in ~/.luna/bin/luna-studio/
{"cards":[{"_id":"3f59ca0b8da9440064000031","treeId":"78448db2088790713e000064","seq":22111374,"position":0.125,"parentId":null,"content":"# ENSO\n"},{"_id":"3f59c9ac8da9440064000032","treeId":"78448db2088790713e000064","seq":22111375,"position":0.1875,"parentId":null,"content":"## Basics"},{"_id":"3f59c9798da9440064000033","treeId":"78448db2088790713e000064","seq":22123185,"position":1,"parentId":"3f59c9ac8da9440064000032","content":"[keyboard shortcuts!](https://github.com/enso-org/ide/blob/main/docs/product/shortcuts.md)\n - <kbd>ctrl-`</kbd> &mdash; show code editor\n - <kbd>ctrl-s</kbd> &mdash; save\n - <kbd>ctrl-click</kbd>/<kbd>ctrl-enter</kbd> &mdash; edit node\n - <kbd>ctrl-g</kbd> &mdash; group nodes\n - <kbd>space</kbd> &mdash; toggle visualization"},{"_id":"3f4db8e084613e64d7000026","treeId":"78448db2088790713e000064","seq":22123300,"position":1.5,"parentId":"3f59c9ac8da9440064000032","content":"[language docs](https://dev.enso.org/docs/)"},{"_id":"3f4e4ca184613e64d7000025","treeId":"78448db2088790713e000064","seq":22123175,"position":2,"parentId":"3f59c9ac8da9440064000032","content":"logs are in `%LocalAppData%/enso/log` on Windows"},{"_id":"3ee4fe2284613e64d7000027","treeId":"78448db2088790713e000064","seq":22171825,"position":0.21875,"parentId":null,"content":"## Nightly builds\n"},{"_id":"3ee4fdc684613e64d7000028","treeId":"78448db2088790713e000064","seq":22172070,"position":1,"parentId":"3ee4fe2284613e64d7000027","content":"...of the language engine (enso):\n\nFirst, download **[GraalVM](https://github.com/graalvm/graalvm-ce-builds/releases) 20.02** and make sure it's **in PATH**. Set env variables as described in the [GraalVM guide for Windows](https://www.graalvm.org/docs/getting-started/windows/). Check version with:\n\n $ java -version\n openjdk version \"11.0.8\" 2020-07-14\n OpenJDK Runtime Environment GraalVM CE 20.2.0 (build 11.0.8+10-jvmci-20.2-b03)\n OpenJDK 64-Bit Server VM GraalVM CE 20.2.0 (build 11.0.8+10-jvmci-20.2-b03, mixed mode, sharing)\n\nthen:\n\n 1. Go to [enso's](https://github.com/enso-org/enso) *Actions* tab on GitHub\n 2. Go to [*Engine CI*](https://github.com/enso-org/enso/actions?query=workflow%3A%22Engine+CI%22) workflow and click a commit\n 3. Scroll down to *Artifacts* section\n 4. Download an `enso-project-manager` and start it in background\n 5. Start IDE with `--no-engine` flag, to disable the builtin/integrated engine\n\n"},{"_id":"3ee4cc6d84613e64d7000029","treeId":"78448db2088790713e000064","seq":22172032,"position":2,"parentId":"3ee4fe2284613e64d7000027","content":"...of the GUI (ide):\n\n 1. Go to [ide's *Actions* tab](https://github.com/enso-org/ide/actions) on GitHub\n 2. Go to [*Build (...)*](https://github.com/enso-org/ide/actions?query=workflow%3A%22Build+%28MacOS%2C+Linux%2C+Windows%29%22) workflow and click a commit\n 3. Try downloading an installer or something from the *Artifacts* section, then installing it"},{"_id":"3ea8c46f891b66e0a500002d","treeId":"78448db2088790713e000064","seq":22206426,"position":0.234375,"parentId":null,"content":"## Various random notes"},{"_id":"3ea8c3ca891b66e0a500002e","treeId":"78448db2088790713e000064","seq":22206427,"position":1,"parentId":"3ea8c46f891b66e0a500002d","content":"From *@manyone* on Discord:\n\n1. because there are no error messages, i can tell an error is present when the block i'm working on is not multi colored so no amount of clicking on the eye will show a visualization. the cause of the error is usually wrong syntax in the current block (or from another block elsewhere).\n2. you can't have an incomplete block floating around. for example , if there is an \"a + b\" block with one or both parameters missing, any new block you create will not compile clean even if you have correct syntax in the block. in short, no loose ends.\n3. once a block is clean , sometimes, you get a visualization that is locked - ie. when you edit the block to change a parameter, the visual does not change. you have to disconnect and reconnect to resolve this. (i think i know why this happens - there is an unresolved block somewhere so nothing else can be changed - the error block has to be fixed first)\n4. the block editor isn't really intuitive and inconsistent - sometimes a backspace works - or reverts the command back to the original template thus deleting all changes you've made so far. it takes me several trials to make the \"[x]+a\" in the code where i'm trying to prepend 4 to [3,5,7] (see upper right corner of image)\n5. there is a slight coloring problem for that task above . for example in \"[x]+a\" , the x is colorless!\n6. the IDE insists on saving the last thing you're working on as 'unnamed'. renaming works inside the IDE but the file is not saved under the new name, it is still saved as unnamed.\n7. use cons for lists, use concatenate for vectors - dont mix - enso will allow you to cons something into a vector but the result is not displayable and you can't write any clean code after that.\n"},{"_id":"3f59ca608da9440064000030","treeId":"78448db2088790713e000064","seq":22206430,"position":0.25,"parentId":null,"content":"# OLD LUNA - TODO: DELETE THIS\n"},{"_id":"3ea8c048891b66e0a500002f","treeId":"78448db2088790713e000064","seq":22206435,"position":1,"parentId":"3f59ca608da9440064000030","content":"# OLD LUNA - TODO: DELETE STUFF BELOW THIS LINE"},{"_id":"783940cd05b530963900000f","treeId":"78448db2088790713e000064","seq":12375978,"position":0.5,"parentId":null,"content":"## Basic interface & usage"},{"_id":"7839266905b5309639000025","treeId":"78448db2088790713e000064","seq":12376003,"position":0.5,"parentId":"783940cd05b530963900000f","content":"After successful installation, to run Luna Studio:\n\n- a) **on Windows:** find it in the Windows *Start Menu*\n- b) **on Linux:** run `~/.luna/bin/luna-studio/current/luna-studio`"},{"_id":"6ddbd2d9fbf4d85a5400001f","treeId":"78448db2088790713e000064","seq":14526218,"position":0.75,"parentId":"783940cd05b530963900000f","content":"By default, a new project is created in a temporary directory. To **save it in a different path**, press `Ctrl-S`, or go to menu *File* &rarr; *Save*, and enter a new path of the project directory."},{"_id":"783940a205b5309639000010","treeId":"78448db2088790713e000064","seq":14526250,"position":1,"parentId":"783940cd05b530963900000f","content":"`Tab` is super important in Luna Studio, it's used to **create a new node** (explained [in the docs — http://docs.luna-lang.org](https://luna-lang.gitbooks.io/docs/content/explorer.html#accessing-the-luna-explorer))\n"},{"_id":"78393fba05b5309639000011","treeId":"78448db2088790713e000064","seq":14526271,"position":2,"parentId":"783940cd05b530963900000f","content":"You can browse full **standard library** at: https://github.com/luna/luna-studio/tree/master/env/Std/src"},{"_id":"78391f6605b5309639000026","treeId":"78448db2088790713e000064","seq":12376021,"position":3,"parentId":"783940cd05b530963900000f","content":"To see a \"**visualization**\" of a result of a node, hover over the node, then click the \"eye icon\" top-right of the node. A small white triangle will show bottom-left of the node; you can use it to choose visualization format. Anyway, you must wait a bit (as usually) for the visualization to show."},{"_id":"78391bfe05b5309639000027","treeId":"78448db2088790713e000064","seq":12376047,"position":4,"parentId":"783940cd05b530963900000f","content":"To add node working on a **result of other node**, you must select the first node, then hit `Tab`. It will *not* work if the source node is not selected (orange circle around it), even if you click the \"output arc\" to build a \"wire\", and hit `Tab` when building the wire."},{"_id":"77d93c1b3ba5aa0913000078","treeId":"78448db2088790713e000064","seq":12424570,"position":5,"parentId":"783940cd05b530963900000f","content":"To convert a block of nodes into a **new function**, select the nodes, then press `F`. ([via](https://discuss.luna-lang.org/t/recursion-syntax/171/2))"},{"_id":"76cfb15fe50983049700001a","treeId":"78448db2088790713e000064","seq":12613872,"position":6,"parentId":"783940cd05b530963900000f","content":"> \"You [can] expand a (selected) node with the `Enter` to access the sliders and detailed view of the ports\"\n\n*(source: discord chat)*"},{"_id":"78448b6b05b530963900000c","treeId":"78448db2088790713e000064","seq":12369146,"position":1,"parentId":null,"content":"## Visualizers\n"},{"_id":"78448b1405b530963900000d","treeId":"78448db2088790713e000064","seq":12375953,"position":1,"parentId":"78448b6b05b530963900000c","content":"### Quick info about adding visualizers\n\n> @akavel visualizers for text and jsons are in place: the json visualizer is actually available for any type and is named `base: json`. The text one appears on `Text` objects and is called `base: text`. Adding the visualizers is now possible but hacky – you'd need too add them inside the package. We're working on plugging that into the Atom plugins system – it's as important as a package manager, the visualizers will be easily shareable, like libraries. For now you can see how the stock visualizers are handled here: https://github.com/luna/luna-studio/tree/master/luna-studio/atom/lib/visualizers \n\n> Each of these has a config.js file that defines a predicate taking a representation of type and returning paths to HTML files to display for given type. Each of the visualizers then communicates with Luna Studio using iframe messsages to receive data (both for visualizers handling static data and streaming sources)\n"},{"_id":"7839559505b530963900000e","treeId":"78448db2088790713e000064","seq":12375951,"position":2,"parentId":"78448b6b05b530963900000c","content":"### Choosing a visualizer\n\n> you can click a small triangle that should appear to the left and down from a node and choose one of available visualizations\n"},{"_id":"76ca6854d7c66f68da00007b","treeId":"78448db2088790713e000064","seq":12616179,"position":1.5,"parentId":null,"content":"## Syntax\n\nNotes and hints about Luna code syntax."},{"_id":"76ca66d7d7c66f68da00007c","treeId":"78448db2088790713e000064","seq":12616187,"position":1,"parentId":"76ca6854d7c66f68da00007b","content":"### **if** — 2-way conditional\n\n> `if` *condition* `then` *result1* `else` *result2*\n\n#### Examples:\n\n if char == \"<\" then Prepend \"<\" acc else acc\n\n*(source: [#125](https://github.com/luna/luna/issues/125#issuecomment-365683922))*"},{"_id":"76ca5eb5d7c66f68da00007d","treeId":"78448db2088790713e000064","seq":12616200,"position":2,"parentId":"76ca6854d7c66f68da00007b","content":"### **case** — pattern matching / multi-way conditional\n\n> `case` *expression* `of` \n> *pattern1* `:` *result1* \n> *...* \n> *patternN* `:` *resultN*\n\n#### Examples:\n\n class JSON:\n ...\n def asText: case self of:\n JSONString t: t\n other: throw \"JSON.asText: not a text\"\n\n*(source: [Std.JSON](https://github.com/luna/luna/blob/77b1d974cb07528e9f195dd47e177dd497560da1/stdlib/Std/src/Base.luna#L1047-L1050))*"},{"_id":"78378277467987f8c6000016","treeId":"78448db2088790713e000064","seq":12377048,"position":2,"parentId":null,"content":"## Other advanced stuff"},{"_id":"6ddbc1f8fbf4d85a54000022","treeId":"78448db2088790713e000064","seq":14526318,"position":0.5,"parentId":"78378277467987f8c6000016","content":"**Logs** of the Luna apps are in:\n\n - a) **on Windows:** `%userprofile%\\.luna\\logs`\n - b) **on Linux:** `~/.luna/logs`"},{"_id":"78378210467987f8c6000017","treeId":"78448db2088790713e000064","seq":12377052,"position":1,"parentId":"78378277467987f8c6000016","content":"### Adding Haskell modules to Luna\n\nCurrently doable in a hacky, non-shareable way:\n\nhttps://discuss.luna-lang.org/t/how-to-connect-to-hs-code-without-ffi/78/3"},{"_id":"7795962924d6a8c9ca000019","treeId":"78448db2088790713e000064","seq":12457995,"position":2,"parentId":"78378277467987f8c6000016","content":"## Deleting old versions of Luna\n\n* a) **on Windows:** see in `C:\\Program Files\\LunaStudio\\`\n* b) **on Linux:** see in `~/.luna/bin/luna-studio/`"}],"tree":{"_id":"78448db2088790713e000064","name":"Enso working notes","publicUrl":"enso"}}