Notes and hints about Luna code syntax.
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:
…of the GUI (ide):
From @manyone on Discord:
After successful installation, to run Luna Studio:
~/.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 File → Save, 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)
@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 onText
objects and is calledbase: 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/visualizersEach 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)
you can click a small triangle that should appear to the left and down from a node and choose one of available visualizations
if
conditionthen
result1else
result2
if char == "<" then Prepend "<" acc else acc
(source: #125)
case
expressionof
pattern1:
result1
…
patternN:
resultN
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:
%userprofile%\.luna\logs
~/.luna/logs
Currently doable in a hacky, non-shareable way:
https://discuss.luna-lang.org/t/how-to-connect-to-hs-code-without-ffi/78/3
C:\Program Files\LunaStudio\
~/.luna/bin/luna-studio/