Skip to content

Add Micro-LF to the handbook documents#338

Merged
tanneberger merged 15 commits into
mainfrom
micro-lf
Jun 11, 2026
Merged

Add Micro-LF to the handbook documents#338
tanneberger merged 15 commits into
mainfrom
micro-lf

Conversation

@edwardalee

@edwardalee edwardalee commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

This PR adds micro-LF as a first-class target in the handbook documentation.
It also makes various corrections, including updating the Distributed Execution to reflect the new default for maxwait of forever.

@edwardalee edwardalee requested a review from tanneberger June 6, 2026 16:12
@tanneberger

Copy link
Copy Markdown
Member

@edwardalee I think it's better if we name the "target" uLF instead of uC - Makes it a bit clearer that its not just another target but actually also a slightly different langauge.

@edwardalee

Copy link
Copy Markdown
Contributor Author

@edwardalee I think it's better if we name the "target" uLF instead of uC - Makes it a bit clearer that its not just another target but actually also a slightly different langauge.

This is a good idea. But it needs to be changed in lingua-franca master, in reactor-uc, and in all the examples and tests. But I think we should do it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Docusaurus handbook to treat Micro-LF (uC / uc) as a first-class target alongside the existing C/C++/Python/Rust/TypeScript targets, including new uC-specific examples, selectors, and build tooling.

Changes:

  • Add uc (“micro-LF”) as a selectable target across handbook pages, with consistent ordering and an additional static build target.
  • Introduce a remark plugin + MDX component to replace legacy $target-language$ placeholders with an inline <TargetLanguage /> element.
  • Extend LF syntax highlighting and add a substantial set of new uC example .lf sources referenced by docs.

Reviewed changes

Copilot reviewed 127 out of 132 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
util/set-default-language.js Add uc support for post-build default tab selection.
src/theme/MDXComponents/index.tsx Register <TargetLanguage /> as an MDX component.
src/remark/ReplaceTargetLanguagePlaceholder.ts New remark plugin to replace $target-language$ with <TargetLanguage />.
src/components/ShikiLFHighlighter/shikiloader.ts Adjust Shiki loader language registrations for LF highlighting.
src/components/ShikiLFHighlighter/lflang.tmLanguage.json Extend LF TextMate grammar to recognize target uC.
src/components/LinguaFrancaMultiTargetUtils/TargetLanguage.tsx New component to render selected target language name inline.
src/components/LinguaFrancaMultiTargetUtils/ShowIf.tsx Extend inline ShowIf typing to include uc.
src/components/LinguaFrancaMultiTargetUtils/LanguageSelector.tsx Use compareTargets for stable target ordering (incl. uc).
src/components/LinguaFrancaMultiTargetUtils/LangSpecific.tsx Sort tabs via compareTargets and fix label lookup.
src/components/LinguaFrancaMultiTargetUtils/index.tsx Add uc target, name/order maps, and compareTargets; export TargetLanguage.
package.json Add build:static:uc script.
docusaurus.config.ts Add docs excludes and enable $target-language$ placeholder replacement plugin.
docs/writing-reactors/time-and-timers.mdx Add uC variants and uC-specific time APIs/notes.
docs/writing-reactors/termination.mdx Add uC timeout docs and update selector to include uc.
docs/writing-reactors/superdense-time.mdx Add uC examples and uC-specific tag access notes.
docs/writing-reactors/reactions.mdx Add uC examples and replace placeholder usage for target-specific text.
docs/writing-reactors/preambles.mdx Add uc target visibility and update a code snippet for uC.
docs/writing-reactors/parameters-and-state-variables.mdx Add uC examples and uC-specific type notes.
docs/writing-reactors/multiports-and-banks.mdx Add uC examples/snippets and misc fixes/clarifications.
docs/writing-reactors/methods.mdx Add uC methods example.
docs/writing-reactors/inputs-and-outputs.mdx Add uC examples and uC-specific mutable input guidance.
docs/writing-reactors/extending-reactors.mdx Add uC extends example.
docs/writing-reactors/distributed-execution.mdx Add extensive uC federated/decentralized coordination documentation and examples.
docs/writing-reactors/deadlines.mdx Add uC deadline examples and notes.
docs/writing-reactors/composing-reactors.mdx Add uC examples and minor diagram size tweak.
docs/writing-reactors/causality-loops.mdx Add uC causality loop examples.
docs/writing-reactors/actions.mdx Add uC action-memory annotation docs and uC examples/snippets.
docs/writing-reactors/a-first-reactor.mdx Add uC HelloWorld example and uC toolchain info.
docs/tools/command-line-tools.mdx Add selector + uC tooling instructions (ulfg/ulfc).
docs/reference/target-language-details.mdx Add uc to selector and point uC readers to micro-lf.org throughout.
docs/reference/target-declaration.mdx Add uC target declaration section and (attempted) uC parameter listing.
docs/reference/security.mdx Narrow selector to C/Python and add note about other targets.
docs/reference/expressions.mdx Add uc to selector.
docs/introduction.md Add uC toolchain mention (ulfg/ulfc).
docs/installation.md Add Micro-LF installation note and link.
docs/embedded/zephyr.mdx Clarify page is for C target; point uC users to micro-lf.org.
docs/embedded/rp2040.mdx Clarify page is for C target; point uC users to micro-lf.org.
docs/embedded/patmos.mdx Clarify page is for C target; point uC users to micro-lf.org.
docs/embedded/nRF52.mdx Clarify page is for C target; point uC users to micro-lf.org.
docs/embedded/flexpret.mdx Clarify page is for C target; point uC users to micro-lf.org.
docs/embedded/arduino.mdx Clarify page is for C target; point uC users to micro-lf.org.
docs/developer/website-development.mdx Update developer docs/examples to include uc.
docs/assets/code/uc/.gitignore Ignore uC build artifacts under docs assets.
docs/assets/code/uc/src/Triggering.lf Add uC Triggering example source.
docs/assets/code/uc/src/Timer.lf Add uC Timer example source.
docs/assets/code/uc/src/TimeLag.lf Add uC TimeLag example source.
docs/assets/code/uc/src/TimeElapsed.lf Add uC TimeElapsed example source.
docs/assets/code/uc/src/TestCount.lf Add uC TestCount utility reactor.
docs/assets/code/uc/src/Sparse.lf Add uC Sparse multiport iterator example source.
docs/assets/code/uc/src/SlowingClock.lf Add uC SlowingClock example source.
docs/assets/code/uc/src/Simultaneous.lf Add uC Simultaneous microstep example source.
docs/assets/code/uc/src/Schedule.lf Add uC Schedule action example source.
docs/assets/code/uc/src/Scale.lf Add uC Scale example source.
docs/assets/code/uc/src/RegressionTest.lf Add uC RegressionTest example source.
docs/assets/code/uc/src/Physical.lf Add uC Physical-action example source.
docs/assets/code/uc/src/Overwriting.lf Add uC Overwriting example source.
docs/assets/code/uc/src/MultiportToBank.lf Add uC Multiport-to-bank example source.
docs/assets/code/uc/src/MultiportSource.lf Add uC banked source example source.
docs/assets/code/uc/src/Multiport.lf Add uC multiport example source.
docs/assets/code/uc/src/Microsteps.lf Add uC microsteps example source.
docs/assets/code/uc/src/Methods.lf Add uC methods example source.
docs/assets/code/uc/src/MainReactor.lf Add uC diagram/example scaffold source.
docs/assets/code/uc/src/lib/Cos.lf Add uC Cos library example source.
docs/assets/code/uc/src/Interleaved.lf Add uC interleaved connection example source.
docs/assets/code/uc/src/Hierarchy.lf Add uC hierarchy example source.
docs/assets/code/uc/src/HelloWorld.lf Add uC HelloWorld example source.
docs/assets/code/uc/src/GenericString.lf Add uC generic string example source.
docs/assets/code/uc/src/GenericDelay.lf Add uC generic delay example source.
docs/assets/code/uc/src/FederatedFeeback.lf Add uC federated feedback example source.
docs/assets/code/uc/src/Federated.lf Add uC federated minimal example source.
docs/assets/code/uc/src/Extends.lf Add uC extends example source.
docs/assets/code/uc/src/Double.lf Add uC Double example source.
docs/assets/code/uc/src/Destination.lf Add uC Destination example source.
docs/assets/code/uc/src/DecentralizedZeroDelayLoopWithChecker.lf Add uC decentralized loop-with-checker example source.
docs/assets/code/uc/src/DecentralizedZeroDelayLoop.lf Add uC decentralized zero-delay loop example source.
docs/assets/code/uc/src/DecentralizedTimerSTPHandler.lf Add uC STP handler example source.
docs/assets/code/uc/src/DecentralizedTimerSTPDeadline.lf Add uC deadline-on-timer example source.
docs/assets/code/uc/src/DecentralizedTimerSTA.lf Add uC decentralized STA/maxwait example source.
docs/assets/code/uc/src/DecentralizedTimerHandler.lf Add uC decentralized tardy-handler example source.
docs/assets/code/uc/src/DecentralizedTimerAfter.lf Add uC decentralized after example source.
docs/assets/code/uc/src/DecentralizedTimer.lf Add uC decentralized baseline example source.
docs/assets/code/uc/src/DecentralizedFeebackWithAfter.lf Add uC decentralized feedback with after example source.
docs/assets/code/uc/src/DecentralizedFeebackSTA.lf Add uC decentralized feedback STA/maxwait example source.
docs/assets/code/uc/src/DecentralizedFeebackSplit.lf Add uC decentralized feedback split example source.
docs/assets/code/uc/src/DecentralizedFeeback.lf Add uC decentralized feedback example source.
docs/assets/code/uc/src/Decentralized.lf Add uC decentralized coordination example source.
docs/assets/code/uc/src/DeadlineTest.lf Add uC deadline test example source.
docs/assets/code/uc/src/Deadline.lf Add uC deadline example source.
docs/assets/code/uc/src/CycleWithDelay.lf Add uC cycle-with-delay example source.
docs/assets/code/uc/src/CycleReordered.lf Add uC cycle-reordered example source.
docs/assets/code/uc/src/Cycle.lf Add uC cycle example source.
docs/assets/code/uc/src/Count.lf Add uC Count example source.
docs/assets/code/uc/src/Contained.lf Add uC contained reactor example source.
docs/assets/code/uc/src/ChildParentBank2.lf Add uC child/parent bank example source.
docs/assets/code/uc/src/ChildParentBank.lf Add uC child/parent bank example source.
docs/assets/code/uc/src/ChildBank.lf Add uC child bank example source.
docs/assets/code/uc/src/CheckDeadline.lf Add uC deadline-check example source.
docs/assets/code/uc/src/BankIndex.lf Add uC bank-index parameter example source.
docs/assets/code/uc/src/Asynchronous.lf Add uC asynchronous physical action example source.
docs/assets/code/uc/src/Alignment.lf Add uC alignment example source.
docs/assets/code/uc/src/test/StructParameter.lf Add uC struct-parameter test example source.
docs/assets/code/uc/src/test/SparseTest.lf Add uC sparse multiport test example source.
docs/assets/code/uc/src/test/SlowingClockTest.lf Add uC slowing-clock test example source.
docs/assets/code/uc/src/test/ScheduleTest.lf Add uC schedule test example source.
docs/assets/code/uc/src/test/PreambleTest7.lf Add uC preamble test example source.
docs/assets/code/uc/src/test/PreambleTest6.lf Add uC preamble test example source.
docs/assets/code/uc/src/test/PreambleTest5.lf Add uC preamble test example source.
docs/assets/code/uc/src/test/PreambleTest4.lf Add uC preamble test example source.
docs/assets/code/uc/src/test/PreambleTest3.lf Add uC preamble test example source.
docs/assets/code/uc/src/test/PreambleTest2.lf Add uC preamble test example source.
docs/assets/code/uc/src/test/PreambleTest1.lf Add uC preamble test example source.
docs/assets/code/uc/src/test/PhysicalTest.lf Add uC physical-action test example source.
docs/assets/code/uc/src/test/MultiportSourceTest.lf Add uC multiport/bank test example source.
docs/assets/code/uc/src/test/HierarchyTest.lf Add uC hierarchy test example source.
docs/assets/code/uc/src/test/ExtendsTest.lf Add uC extends test example source.
docs/assets/code/uc/src/test/DoubleTest.lf Add uC double test example source.
docs/assets/code/uc/src/test/DestinationTest.lf Add uC destination test example source.
docs/assets/code/uc/src/test/CountScale.lf Add uC count+scale test example source.
docs/assets/code/uc/src/test/CountDoubleDestination.lf Add uC integrated test example source.
docs/assets/code/uc/src/test/ContainedOverwriting.lf Add uC overwriting containment test example source.
docs/assets/code/uc/src/test/AlignmentTest.lf Add uC alignment test example source.
docs/assets/code/py/src/DecentralizedZeroDelayLoopWithChecker.lf Add @maxwait(0) to Python example federation.
docs/assets/code/py/src/DecentralizedZeroDelayLoop.lf Add @maxwait(0) to Python example federation.
docs/assets/code/py/src/DecentralizedTimerAfter.lf Add @maxwait(0) to Python example federation.
docs/assets/code/c/src/DecentralizedZeroDelayLoopWithChecker.lf Add @maxwait(0) to C example federation.
docs/assets/code/c/src/DecentralizedZeroDelayLoop.lf Add @maxwait(0) to C example federation.
docs/assets/code/c/src/DecentralizedTimerAfter.lf Add @maxwait(0) to C example federation.
Comments suppressed due to low confidence (1)

docs/reference/security.mdx:257

  • This note is wrapped in <ShowOnly uc cpp ts rs>, but the page’s <LanguageSelector> only includes c and py, so readers can’t select uc/cpp/ts/rs and this note will never be shown. Consider making this note unconditional (or expanding the selector tabs).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 60 to 66
content = content.replace(tabListPattern, (match, openTag, tabContent, closeTag) => {
// Check if this is a language selector tab list (either short codes or full names)
const hasShortCodes = tabContent.match(/>\s*(c|cpp|py|rs|ts)\s*</i);
const hasFullNames = tabContent.match(/>\s*(C|C\+\+|Python|Rust|TypeScript)\s*</);
const hasShortCodes = tabContent.match(/>\s*(c|uc|cpp|py|rs|ts)\s*</i);
const hasFullNames = tabContent.match(/>\s*(C|micro-LF|C\+\+|Python|Rust|TypeScript)\s*</);

if (!hasShortCodes && !hasFullNames) {
return match; // Not a language tab list
Comment on lines +20 to +22
printf("Logical time since start: \%lld nsec.\n",
elapsed_logical_time
);
Comment on lines +24 to +26
printf("ERROR: Expected time to be: \%lld nsec.\n",
self->expected_time
);
reaction(shutdown) {=
if (self->expected_time != MSEC(1500)) {
printf("ERROR: Expected the next expected time to be: 1500000000 nsec.\n");
printf("It was: \%lld nsec.\n", self->expected_time);
Comment on lines 12 to 13
<LanguageSelector c cpp py rs ts />

Comment on lines +23 to +25
Unlike the other targets, the `uC` target does not use target parameters.
Instead, it uses annotations, as described in [https://micro-lf.org/documentation/annotations/](https://micro-lf.org/documentation/annotations/).

@tanneberger tanneberger merged commit 6ae03b7 into main Jun 11, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants