Skip to content

Commit 54340d0

Browse files
authored
Merge pull request lf-lang#200 from axmmisaka/fix-intro-links
Link to Introduction markdown, not URL
2 parents d4c9068 + a295e89 commit 54340d0

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

docs/reference/target-language-details.mdx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ To have Lingua Franca generate C code, start your `.lf` file with one of the fol
199199

200200
Note that for all LF statements, a final semicolon is optional. If you are writing your code in C, you may want to include the final semicolon for uniformity.
201201

202-
For options to the target specification, see [detailed documentation of the target options](../introduction).
202+
For options to the target specification, see [detailed documentation of the target options](../introduction.md).
203203

204204
The second form, `CCpp`, is used when you wish to use a C++ compiler to compile
205205
the generated code, thereby allowing your C reactors to call C++ code.
@@ -238,7 +238,7 @@ To have Lingua Franca generate C++ code, start your `.lf` file with the followin
238238

239239
Note that for all LF statements, a final semicolon is optional. If you are writing your code in C++, you may want to include the final semicolon for uniformity.
240240

241-
For options to the target specification, see [detailed documentation of the target options](../introduction).
241+
For options to the target specification, see [detailed documentation of the target options](../introduction.md).
242242

243243
</ShowIf>
244244
<ShowIf py>
@@ -251,7 +251,7 @@ To have Lingua Franca generate Python code, start your `.lf` file with the follo
251251

252252
Note that for all LF statements, a final semicolon is optional.
253253

254-
For options to the target specification, see [detailed documentation of the target options](../introduction).
254+
For options to the target specification, see [detailed documentation of the target options](../introduction.md).
255255

256256
</ShowIf>
257257
<ShowIf ts>
@@ -264,7 +264,7 @@ To have Lingua Franca generate TypeScript code, start your `.lf` file with the f
264264

265265
Note that for all LF statements, a final semicolon is optional.
266266

267-
The supported target parameters and command-line options are documented in the [Target Declaration](../introduction) documentation.
267+
The supported target parameters and command-line options are documented in the [Target Declaration](../introduction.md) documentation.
268268

269269
</ShowIf>
270270
<ShowIf rs>
@@ -2730,15 +2730,15 @@ FIXME: Details needed here.
27302730

27312731
A suite of useful functions is provided in [util.h](https://www.lf-lang.org/reactor-c/d8/d3c/util_8h.html) for producing messages to be made visible when the generated program is run. Of course, you can always use `printf`, but this is not a good choice for logging or debug information, and it is not a good choice when output needs to be redirected to a window or some other user interface (see for example the [sensor simulator](https://github.com/lf-lang/reactor-c/blob/main/util/sensor_simulator.h)). Also, in federated execution, these functions identify which federate is producing the message. The functions are listed below. The arguments for all of these are identical to `printf` with the exception that a trailing newline is automatically added and therefore need not be included in the format string.
27322732

2733-
- `LF_PRINT_DEBUG(format, ...)`: Use this for verbose messages that are only needed during debugging. Nothing is printed unless the [target](<../introduction#logging>) parameter `logging` is set to `debug`. THe overhead is minimized when nothing is to be printed.
2733+
- `LF_PRINT_DEBUG(format, ...)`: Use this for verbose messages that are only needed during debugging. Nothing is printed unless the [target](<../introduction.md#logging>) parameter `logging` is set to `debug`. THe overhead is minimized when nothing is to be printed.
27342734

2735-
- `LF_PRINT_LOG(format, ...)`: Use this for messages that are useful logs of the execution. Nothing is printed unless the [target parameter `logging`](<../introduction#logging>) is set to `log` or `debug`. This is a macro so that overhead is minimized when nothing is to be printed.
2735+
- `LF_PRINT_LOG(format, ...)`: Use this for messages that are useful logs of the execution. Nothing is printed unless the [target parameter `logging`](<../introduction.md#logging>) is set to `log` or `debug`. This is a macro so that overhead is minimized when nothing is to be printed.
27362736

2737-
- `lf_print(format, ...)`: Use this for messages that should normally be printed but may need to be redirected to a user interface such as a window or terminal (see `register_print_function` below). These messages can be suppressed by setting the [logging target property](<../introduction#logging>) to `warn` or `error`.
2737+
- `lf_print(format, ...)`: Use this for messages that should normally be printed but may need to be redirected to a user interface such as a window or terminal (see `register_print_function` below). These messages can be suppressed by setting the [logging target property](<../introduction.md#logging>) to `warn` or `error`.
27382738

2739-
- `lf_print_warning(format, ...)`: Use this for warning messages. These messages can be suppressed by setting the [logging target property](<../introduction#logging>) to `error`.
2739+
- `lf_print_warning(format, ...)`: Use this for warning messages. These messages can be suppressed by setting the [logging target property](<../introduction.md#logging>) to `error`.
27402740

2741-
- `lf_print_error(format, ...)`: Use this for error messages. These messages are not suppressed by any [logging target property](<../introduction#logging>).
2741+
- `lf_print_error(format, ...)`: Use this for error messages. These messages are not suppressed by any [logging target property](<../introduction.md#logging>).
27422742

27432743
- `lf_print_error_and_exit(format, ...)`: Use this for catastrophic errors.
27442744

@@ -2771,7 +2771,7 @@ Which type of messages are actually produced by the compiled program can be cont
27712771
</ShowIf>
27722772
<ShowIf py>
27732773

2774-
The Python supports the [logging](<../introduction#logging>) target specification. This will cause the runtime to produce more or less information about the execution. However, user-facing functions for different logging levels are not yet implemented (see issue [#619](https://github.com/lf-lang/lingua-franca/issues/619)).
2774+
The Python supports the [logging](<../introduction.md#logging>) target specification. This will cause the runtime to produce more or less information about the execution. However, user-facing functions for different logging levels are not yet implemented (see issue [#619](https://github.com/lf-lang/lingua-franca/issues/619)).
27752775

27762776
</ShowIf>
27772777
<ShowIf ts>
@@ -2788,7 +2788,7 @@ The executable reacts to the environment variable `RUST_LOG`, which sets the log
27882788

27892789
Error and warning logs are on by default. Enabling a level enables all greater levels (i.e., `RUST_LOG=info` also enables `warn` and `error`, but not `trace` or `debug`).
27902790

2791-
Logging can also be turned on with the `--log-level` CLI option, if the application features a [CLI](<../introduction#command-line-arguments>).
2791+
Logging can also be turned on with the `--log-level` CLI option, if the application features a [CLI](<../introduction.md#command-line-arguments>).
27922792

27932793
Note that the `logging` target property is ignored, as its levels do not match the Rust standard levels we use (those of the [`log` crate](https://docs.rs/log/)).
27942794

@@ -2962,7 +2962,7 @@ primitives and sleep functions.
29622962

29632963
### Multithreaded Implementation
29642964

2965-
By default, the C runtime system uses multiple worker threads in order to take advantage of multicore execution. The number of worker threads will match the number of cores on the machine unless the `workers` argument is given in the [target](<../introduction#threading>) statement or the `--workers` [command-line argument](<../introduction#command-line-arguments>) is given.
2965+
By default, the C runtime system uses multiple worker threads in order to take advantage of multicore execution. The number of worker threads will match the number of cores on the machine unless the `workers` argument is given in the [target](<../introduction.md#threading>) statement or the `--workers` [command-line argument](<../introduction.md#command-line-arguments>) is given.
29662966

29672967
Upon initialization, the main thread will create the specified number of worker threads.
29682968
Execution proceeds in a manner similar to the [single threaded implementation](#single-threaded-implementation)
@@ -2971,17 +2971,17 @@ The execution algorithm ensures that no reaction executes until all reactions th
29712971

29722972
### Single Threaded Implementation
29732973

2974-
By giving the `single-threaded` [target option](<../introduction#single-threaded>) or the `--single-threaded` [command-line argument](<../introduction#command-line-arguments>), the generated program will execute the program using only a single thread. This option is most useful for creating programs to run on bare-metal microprocessors that have no threading support. On such platforms, mutual exclusion is typically realized by disabling interrupts.
2974+
By giving the `single-threaded` [target option](<../introduction.md#single-threaded>) or the `--single-threaded` [command-line argument](<../introduction.md#command-line-arguments>), the generated program will execute the program using only a single thread. This option is most useful for creating programs to run on bare-metal microprocessors that have no threading support. On such platforms, mutual exclusion is typically realized by disabling interrupts.
29752975

29762976
The execution strategy is to have two queues of pending accessor invocations, one that is sorted by
29772977
tag (the **event queue**) and one that is sorted by priority (the **reaction queue**).
29782978
Execution proceeds as follows:
29792979

29802980
1. At initialization, an event for each timer is put on the event queue and logical time is initialized to the current time, represented as the number of nanoseconds elapsed since January 1, 1970.
29812981

2982-
2. At each logical time, pull all events from event queue that have the same earliest tag, find the reactions that these events trigger, and put them on the reaction queue. If there are no events on the event queue, then exit the program (unless the `--keepalive true` [command-line argument](<../introduction#command-line-arguments>) is given).
2982+
2. At each logical time, pull all events from event queue that have the same earliest tag, find the reactions that these events trigger, and put them on the reaction queue. If there are no events on the event queue, then exit the program (unless the `--keepalive true` [command-line argument](<../introduction.md#command-line-arguments>) is given).
29832983

2984-
3. Wait until physical time matches or exceeds that earliest timestamp (unless the `--fast true` [command-line argument](<../introduction#command-line-arguments>) is given). Then advance logical time to match that earliest timestamp.
2984+
3. Wait until physical time matches or exceeds that earliest timestamp (unless the `--fast true` [command-line argument](<../introduction.md#command-line-arguments>) is given). Then advance logical time to match that earliest timestamp.
29852985

29862986
4. Execute reactions in order of priority from the reaction queue. These reactions may produce outputs, which results in more events getting put on the reaction queue. Those reactions are assured of having lower priority than the reaction that is executing. If a reaction calls `lf_schedule()`, an event will be put on the event queue, not the reaction queue.
29872987

@@ -2995,7 +2995,7 @@ Unlike the C target, the Cpp target implements more of the analysis and setup of
29952995
</ShowIf>
29962996
<ShowIf py>
29972997

2998-
The Python target is built on top of the C runtime to enable maximum efficiency where possible. It uses the single-threaded C runtime by default but will switch to the multi-threaded C runtime if a physical action is detected. The [threading](<../introduction#threading>) target property can be used to override this behavior.
2998+
The Python target is built on top of the C runtime to enable maximum efficiency where possible. It uses the single-threaded C runtime by default but will switch to the multi-threaded C runtime if a physical action is detected. The [threading](<../introduction.md#threading>) target property can be used to override this behavior.
29992999

30003000
Running [lfc](../tools/command-line-tools.mdx) on a `XXX.lf` program that uses the Python target specification on a
30013001
Linux machine will create the following files (other operating systems will have
@@ -3347,11 +3347,11 @@ target Rust {
33473347
}
33483348
```
33493349

3350-
See [Target Declaration](../introduction) for the full list of supported target properties.
3350+
See [Target Declaration](../introduction.md) for the full list of supported target properties.
33513351

33523352
### The Executable
33533353

3354-
The executable name is the name of the main reactor _transformed to snake_case_: `main reactor RustProgram` will generate `rust_program`. See [Command-Line Arguments](<../introduction#command-line-arguments>) for details.
3354+
The executable name is the name of the main reactor _transformed to snake_case_: `main reactor RustProgram` will generate `rust_program`. See [Command-Line Arguments](<../introduction.md#command-line-arguments>) for details.
33553355

33563356
### File layout
33573357

docs/reference/tracing.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313

1414
Tracing is a powerful tool when it comes to analysis and debugging of applications. Unfortunately, most tracing tools that are readily available are designed specifically for analyzing processes, threads and system calls. Specialized tools are required to enable analysis that is tailored to an alternative model of computation such as Reactors. The tools should be capable of understanding the fundamental concepts of the model, such as the distinction between logical and physical time, as well as structural units such as reactors and reactions. This page gives an overview of the currently supported trace mechanism, as well as an outline of alternative tools that could be useful in the future.
1515

16-
Tracing is different from [logging](<../introduction#logging>). Logging produces human-readable output in textual form and incurs significant overhead. Tracing produces binary data that must be further processed to be useful and is designed to have minimal impact on the execution time of a program.
16+
Tracing is different from [logging](<../introduction.md#logging>). Logging produces human-readable output in textual form and incurs significant overhead. Tracing produces binary data that must be further processed to be useful and is designed to have minimal impact on the execution time of a program.
1717

1818
Tracing is currently supported in the C, Python, and C++ targets. The mechanism used in C and Python is different from that used in C++. Tracing in C++ requires third-party tools that may only be available in Linux. Tracing in C and Python does not require any third-party tools.
1919

docs/writing-reactors/a-first-reactor.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import TS_HelloWorld from '../assets/code/ts/src/HelloWorld.lf';
2323

2424
<NoSelectorTargetCodeBlock c={C_HelloWorld} cpp={Cpp_HelloWorld} py={Py_HelloWorld} rs={Rs_HelloWorld} ts={TS_HelloWorld} lf />
2525

26-
Every Lingua Franca program begins with a [target declaration](../introduction) that specifies the language in which reactions are written. This is also the language of the program(s) generated by the Lingua Franca code generator.
26+
Every Lingua Franca program begins with a [target declaration](../introduction.md) that specifies the language in which reactions are written. This is also the language of the program(s) generated by the Lingua Franca code generator.
2727

2828
Every LF program also has a `main` or `federated` (depending on the target support) reactor, which is the top level of a hierarchy of contained and interconnected reactors. The above simple example has no contained reactors.
2929

docs/writing-reactors/actions.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Action triggered at logical time 603669000 nsec after start.
133133
...
134134
```
135135

136-
Here, logical time is lagging physical time by a few milliseconds. Note that, unless the [fast option](<../introduction#fast>) is given, logical time _t_ chases physical time _T_, so _t_ < _T_. Hence, the event being scheduled in the reaction to input `x` is assured of being in the future in logical time.
136+
Here, logical time is lagging physical time by a few milliseconds. Note that, unless the [fast option](<../introduction.md#fast>) is given, logical time _t_ chases physical time _T_, so _t_ < _T_. Hence, the event being scheduled in the reaction to input `x` is assured of being in the future in logical time.
137137

138138
Whereas logical actions are required to be scheduled within a reaction of the reactor that declares the action, physical actions can be scheduled by code that is outside the Lingua Franca system. For example, some other thread or a callback function may call `schedule()`, passing it a physical action. For example:
139139

docs/writing-reactors/termination.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ We address each of these in turn.
2929

3030
## Timeout
3131

32-
The [target property `timeout`](<../introduction#timeout>) specifies the last logical time at which reactions should be triggered. The last invocation of reactions will be at tag (`timeout`, 0).
32+
The [target property `timeout`](<../introduction.md#timeout>) specifies the last logical time at which reactions should be triggered. The last invocation of reactions will be at tag (`timeout`, 0).
3333

3434
There is a significant subtlety when using [physical connections](<../writing-reactors/composing-reactors.mdx#physical-connections>), which are connections using the syntax `~>`. Such connections specify that the tag at the receiving end will be based on the physical time at which the message is received. If the tag assigned at the receiving end is greater than the final tag, then the message is lost. Hence, **messages sent near the `timeout` time are likely to be lost!**
3535

docs/writing-reactors/time-and-timers.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515

1616
A key property of Lingua Franca is **logical time**. All events occur at an instant in logical time. By default, the runtime system does its best to align logical time with **physical time**, which is some measurement of time on the execution platform. The **lag** is defined to be physical time minus logical time, and the goal of the runtime system is maintain a small non-negative lag.
1717

18-
The **lag** is allowed to go negative only if the [`fast` target property](<../introduction#fast>) or the [`--fast`](<../introduction#command-line-arguments>) command-line argument is set to `true`. In that case, the program will execute as fast as possible with no regard to physical time.
18+
The **lag** is allowed to go negative only if the [`fast` target property](<../introduction.md#fast>) or the [`--fast`](<../introduction.md#command-line-arguments>) command-line argument is set to `true`. In that case, the program will execute as fast as possible with no regard to physical time.
1919

2020
<ShowOnly c cpp rs>
2121

@@ -165,7 +165,7 @@ A reaction is always invoked at a well-defined logical time, and logical time do
165165

166166
## Timeout
167167

168-
By default, a Lingua Franca program will terminate when there are no more events to process. If there is a timer with a non-zero period, then there will always be more events to process, so the default execution will be unbounded. To specify a finite execution horizon, you can either specify a [`timeout` target property](<../introduction#timeout>) or a [`--timeout` command-line option](<../introduction#command-line-arguments>). For example, the following `timeout` property will cause the above timer with a period of one second to terminate after 11 events:
168+
By default, a Lingua Franca program will terminate when there are no more events to process. If there is a timer with a non-zero period, then there will always be more events to process, so the default execution will be unbounded. To specify a finite execution horizon, you can either specify a [`timeout` target property](<../introduction.md#timeout>) or a [`--timeout` command-line option](<../introduction.md#command-line-arguments>). For example, the following `timeout` property will cause the above timer with a period of one second to terminate after 11 events:
169169

170170
<NoSelectorTargetCodeBlock lf
171171
c={`target C {

0 commit comments

Comments
 (0)