sbt Build Commands:
- clean: flushes all the stuff and can be useful when getting new code.
- runtime/clean: flushes just the engine libs bits (so quicker).
- buildProjectManagerDistribution: builds the project manager server executable.
- buildEngineDistribution: builds the engine server and libraries distribution executable.
- buildStdLib...: builds the standard library can be
All
or a specific one. Tends to leave the index in a mess so often lose the dropdowns or CB.
Running Enso IDE:
- Just run the executable it will launch a GUI and a Project Manager. Opening a project opens a Language Server.
IDE Dashboard <---> Project Manager --launches-> Language Server <---> IDE Graph Editor
- Execution happens in the language server.
- IDE and L/S have parsers reading and parsing the code.
- Can separate the IDE and Project Manager:
--engine false
will stop IDE running the P/M. Either on the installed (%AppData%\Local\Programs\enso\enso.exe
) or the built one in dist (.\dist\ide\win-unpacked\Enso.exe
). (./run ide build ends up here). - Project Manager is in
.\built-distribution\enso-project-manager-0.0.0-dev-windows-amd64\enso\bin\project-manager.exe
if built by sbt. - THe libraries used by the L/S are read from
%AppData%\Local\enso\dist
so if you sym link0.0.0-dev
to.\built-distribution\enso-engine-0.0.0-dev-windows-amd64\enso-0.0.0-dev\
within the repo will use the output ofbuildEngineDistribution
. - You also need a
0.0.0-dev.yaml
file in the%AppData%\Local\enso\editions
. - The edition is set within the
package.yaml
of all projects.edition: 0.0.0-dev
andprefer-local-libraries: true
ENSO_JVM_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
- sets up the connection to allow Java debugging of the Language Server (connect up IntelliJ to it).
Running Enso CLI:
- If you run
.\built-distribution\enso-engine-0.0.0-dev-windows-amd64\enso-0.0.0-dev\bin\enso
it will run Enso in CLI mode. - Command line args and environment variables to control it.
--run <Path>
runs a project or an enso script (something with amain
function).--in-project <Path>
specifies the project the script runs in (really useful for our unit tests).--ir-caches
just use it - basically speeds up Enso compilation by using intermediate representation which is saved in a cache.--inspect
runs Enso CLI in debug mode and gives a URL to connect a Chrome debugger to.ENSO_TEST_JUNIT_DIR
specifies where to write the JUnit XML files to if running tests.JAVA_OPTS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005"
- sets up the connection to allow Java debugging (connect up IntelliJ to it).- Utility
enso.ps1
script to run CLI.
Project Structure:
- app: IDE. Visualisation code is
app/gui/view/graph-editor/src/builtin/visualization/java_script/
- app/gui2: New TS Vue GUI.
- distribution/lib: The Enso code of the standard libs.
- engine: The built-in types and runtime. Java code for built-ins are here.
- std-bits: The Java code of the standard libs.
- test: The unit tests for the Enso standard libs.
- tools: The only thing that comes up in here is the legal review. Only matters if you update or change a third party library.
- Want to exclude
dist
,built-distribution
andtarget
from the IDE.
Enso Project Structure:
package.yaml
: has the edition and can have lots of meta data stuff.src
: has the Enso code.src\Main.enso
: entry point for the project.data
: has the data files. (optional).enso
: internal stuff but basically a localised git repo containing all changes.
Enso Script Structure:
- Imports at the top.
import Standard.Base.Data.List.List
imports theList
type from theList
module in theData.List
folder in theStandard.Base
library.import Standard.Base.Data.List
imports theList
module in theData.List
folder in theStandard.Base
library. Use bits of it asList.<...>
- Can alias
as
for exampleimport Standard.Base.Data.List as List_Module
then useList_Module.<...>
from Standard.Base.Data.List import all
imports all the types and functions in module to the names space (not prefixed).from Standard.Base.Data.List import List, List_Error
imports specifics.polyglot java import <JavaFullClassName>
imports a Java class (supportsas
as well).- "Best practice" is to sort the imports alphabetically within each library.
project
imports within the same project. Within a library should be used don't use the full name.Main.enso
in a library is where we choose what we to export (export
similar toimport
).from Standard.Base import all
brings in whatever is exported fromMain.enso
inStandard.Base
.
main =
is the entry point for the script.- No
return
statement, last value from a block is returned. Makes early exit harder. - Variables are immutable. I.e.
a=123; a=456
is not allowed. <|
folds the block into the line above.if <cond> then <true block> else <false block>
have to have theif/then/else
on one line.case <cond> of\n True-> <true block>\n False-> <false block>
.- Instance vs static functions. First argument is
self
then an instance function. - Extension function:
Text.substring self start end =
is an extension function onText
type.