Skip to content
falang.ioRU

Logic constructor

The logic constructor allows you to create the business logic of the application. Then it can be exported to one of the programming languages.

At the moment, export to the following languages is implemented: C#, C++, Rust, Go, TypeScript. Choose Project → Export Configuration… and add a target: a language and a folder, relative to the project folder, where its code goes. There can be several targets, each with its own folder. The configuration is saved in the project (falang/config/logic-export.json). Project → Export Code (Ctrl+Shift+E) generates the code for every target, with a progress bar and a Cancel button; an error in one target does not stop the others. C++, Go and C# get one source file, TypeScript and Rust one file per scheme.

The editor only offers what every target language can compile: expressions use a reduced set of built-in functions (basic Math, the length and indexing of arrays and strings), so code that would fail on export is flagged while you type.

Currently there are four types of schemes:

  • Function. Can accept parameters as input and call other functions.

  • Object structure: description of data structures. They can be used as data types in a function.

  • Enum: a named list of values, also usable as a data type.

  • External API. Description of the external API. In the code, depending on the language, objects or interfaces are generated. When calling any function, client code must pass the implementation of this API as a parameter. In the function diagram it is possible to call the API by adding the corresponding icon.