• Basic interface & usage

  • Visualizers

  • Syntax

    Notes and hints about Luna code syntax.

  • Other advanced stuff

  • 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":"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":"Luna-lang","publicUrl":"luna-lang"}}