Execution engine for Legend. It provides:
- A Pure parser and compiler.
- An execution engine, generating and/or executing execution plans when provided with a Pure function, a Mapping and a Runtime.
- Access point for model transformers written using the Pure language (soon to come).
- This application uses Maven 3.6+ and JDK 11. Run
mvn install
to compile. - To start the server, please use the
Main
classorg.finos.legend.engine.server.Server
with the parameters:server legend-engine-config/legend-engine-server/legend-engine-server-http-server/src/test/resources/org/finos/legend/engine/server/test/userTestConfig.json
. - You can test by trying http://127.0.0.1:6300 on a web browser. The swagger page can be accessed at http://127.0.0.1:6300/api/swagger
Given the size of the project, developers should consider using parallelism to speed up build times, given enough RAM is provided. In IntelliJ IDEA, this can be done by setting
Thread Count
(inPreferences > Build, Execution, Deployment > Build Tools > Maven
) andShared build process heap size (Mbytes)
(inPreferences > Build, Execution, Deployment > Compiler > Java Compiler
). For example, settingThread Count
to4
andShared build process heap size (Mbytes)
to30000
can significantly reduce build times, you need to fine-tune this to match your machine's specs.
⚠️ It's also important to disable theClear output directory on rebuild
inPreferences > Build, Execution, Deployment > Complier
as this removes generated resources needed to run the servers from the IDE.
If you're making changes to the Pure
codebase, it's highly recommended that you also spin up our Pure IDE
application:
- To start the server, please use the
Main
classorg.finos.legend.engine.ide.PureIDELight
with the parameters:server legend-engine-pure/legend-engine-pure-ide/legend-engine-pure-ide-light-http-server/src/main/resources/ideLightConfig.json
. - You can now access the IDE at http://127.0.0.1:9200/ide in a web browser.
To debug your Pure
code, you need to use the meta::pure::ide::debug()
function to create breakpoints.
When you execute the go
function using F9, the execution will be paused at the breakpoint, and a summary will be printed.
This summary include the current stack (for easy navigation to the current breakpoint point) and the variables accessible on such breakpoint.
Once in a breakpoint, using the Pure IDE terminal, you can take certain debugging actions:
debug
ordebug summary
: print the aforementioned summary.debug <pure expression>
: evaluate the given expression. All variables on the current breakpoint are available.- ie.
debug $f->map(x | $x->type())
: introspect variablef
and apply some functions to it.
- ie.
debug abort
: stop the current execution. Pressing F9 after an abort command will start the execution from the beginning (ie. from thego
function)
To resume the execution to next breakpoint or to completion, just press F9 again.
Caveats:
- Editing the code while on a breakpoint will lead to evaluation errors. You need to complete or abort current execution to pick new changes.
- Print commands within the debug expressions won't show on console. Avoid the print and evaluate to a string value instead.
Visit our roadmap to know more about the upcoming features.
Visit Legend Contribution Guide to learn how to contribute to Legend.
Copyright 2020 Goldman Sachs
Distributed under the Apache License, Version 2.0.
SPDX-License-Identifier: Apache-2.0