Researching: What programming language is the Linux kernel primarily written in? {"question": "What programming language is the Linux kernel primarily written in?", "depth": "balanced", "max_iterations": null, "token_budget": null, "event": "ask_started", "logger": "marchwarden.cli", "level": "info", "timestamp": "2026-04-09T01:50:52.691750Z"} {"transport": "stdio", "server": "marchwarden-web-researcher", "event": "mcp_server_starting", "logger": "marchwarden.mcp", "level": "info", "timestamp": "2026-04-09T01:50:53.397487Z"} {"event": "Processing request of type CallToolRequest", "logger": "mcp.server.lowlevel.server", "level": "info", "timestamp": "2026-04-09T01:50:53.405825Z"} {"question": "What programming language is the Linux kernel primarily written in?", "depth": "balanced", "max_iterations": 5, "token_budget": 20000, "model_id": "claude-sonnet-4-6", "event": "research_started", "researcher": "web", "trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "logger": "marchwarden.researcher.web", "level": "info", "timestamp": "2026-04-09T01:50:53.438393Z"} {"step": 1, "decision": "Beginning research: depth=balanced", "question": "What programming language is the Linux kernel primarily written in?", "context": "", "max_iterations": 5, "token_budget": 20000, "event": "start", "researcher": "web", "trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "logger": "marchwarden.researcher.trace", "level": "info", "timestamp": "2026-04-09T01:50:53.438693Z"} {"step": 2, "decision": "Starting iteration 1/5", "tokens_so_far": 0, "event": "iteration_start", "researcher": "web", "trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "logger": "marchwarden.researcher.trace", "level": "info", "timestamp": "2026-04-09T01:50:53.438784Z"} {"step": 7, "decision": "Starting iteration 2/5", "tokens_so_far": 1096, "event": "iteration_start", "researcher": "web", "trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "logger": "marchwarden.researcher.trace", "level": "info", "timestamp": "2026-04-09T01:51:04.950078Z"} {"step": 12, "decision": "Starting iteration 3/5", "tokens_so_far": 7266, "event": "iteration_start", "researcher": "web", "trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "logger": "marchwarden.researcher.trace", "level": "info", "timestamp": "2026-04-09T01:51:15.609351Z"} {"step": 14, "decision": "Beginning synthesis of gathered evidence", "evidence_count": 16, "iterations_run": 3, "tokens_used": 18342, "event": "synthesis_start", "researcher": "web", "trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "logger": "marchwarden.researcher.trace", "level": "info", "timestamp": "2026-04-09T01:51:38.886838Z"} {"step": 15, "decision": "Parsed synthesis JSON successfully", "duration_ms": 38497, "event": "synthesis_complete", "researcher": "web", "trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "logger": "marchwarden.researcher.trace", "level": "info", "timestamp": "2026-04-09T01:52:16.247727Z"} {"step": 26, "decision": "Research complete", "confidence": 0.97, "citation_count": 6, "gap_count": 2, "discovery_count": 2, "total_duration_sec": 85.024, "event": "complete", "researcher": "web", "trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "logger": "marchwarden.researcher.trace", "level": "info", "timestamp": "2026-04-09T01:52:16.248500Z"} {"confidence": 0.97, "citations": 6, "gaps": 2, "discovery_events": 2, "tokens_used": 32922, "iterations_run": 3, "wall_time_sec": 82.80920100212097, "budget_exhausted": false, "event": "research_completed", "researcher": "web", "trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "logger": "marchwarden.researcher.web", "level": "info", "timestamp": "2026-04-09T01:52:16.248601Z"} {"error": "[Errno 13] Permission denied: '/home/micro/.marchwarden/costs.jsonl'", "event": "cost_ledger_write_failed", "researcher": "web", "trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "logger": "marchwarden.researcher.web", "level": "warning", "timestamp": "2026-04-09T01:52:16.248962Z"} {"event": "Processing request of type ListToolsRequest", "logger": "mcp.server.lowlevel.server", "level": "info", "timestamp": "2026-04-09T01:52:16.252134Z"} {"trace_id": "710b0a62-06c8-4f49-83e3-dc651c3702a9", "confidence": 0.97, "citations": 6, "tokens_used": 32922, "wall_time_sec": 82.80920100212097, "event": "ask_completed", "logger": "marchwarden.cli", "level": "info", "timestamp": "2026-04-09T01:52:16.444923Z"} ╭─────────────────────────────────── Answer ───────────────────────────────────╮ │ The Linux kernel is primarily written in the C programming language, │ │ specifically the GNU dialect of ISO C11 (compiled with GCC under -std=gnu11, │ │ or alternatively with Clang). Assembly language is also used for │ │ architecture-specific low-level code. As of late 2022, Rust became an │ │ officially supported second language in the kernel, and as of the 2025 Linux │ │ Kernel Maintainer Summit, Rust was elevated from 'experimental' to a │ │ permanent, first-class core language alongside C. According to Open Hub │ │ statistics, C accounts for approximately 95.8% of total lines in the kernel │ │ codebase, with Assembly at ~0.7% and Rust at ~0.3%. The kernel also uses │ │ small amounts of shell script, Python, Make, and Perl for tooling purposes. │ ╰──────────────────────────────────────────────────────────────────────────────╯ Citations ┏━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┓ ┃ # ┃ Title / Locator ┃ Excerpt ┃ Conf ┃ ┡━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━┩ │ 1 │ Programming Language — The │ The Linux kernel is written in │ 1.00 │ │ │ Linux Kernel documentation │ the C programming language. │ │ │ │ https://docs.kernel.org/proce │ More precisely, it is │ │ │ │ ss/programming-language.html │ typically compiled with gcc │ │ │ │ │ under -std=gnu11: the GNU │ │ │ │ │ dialect of ISO C11. clang is │ │ │ │ │ also supported. The kernel has │ │ │ │ │ support for the Rust │ │ │ │ │ programming language under │ │ │ │ │ CONFIG_RUST. │ │ ├─────┼───────────────────────────────┼────────────────────────────────┼───────┤ │ 2 │ The Linux Kernel Open Source │ C | 36,226,652 | 5,218,548 | │ 0.97 │ │ │ Project on Open Hub: │ 12.6% | 5,867,314 | 47,312,514 │ │ │ │ Languages Page │ | 95.8% ... Assembly | 266,797 │ │ │ │ https://openhub.net/p/linux/a │ | 50,339 | 15.9% | 49,347 | │ │ │ │ nalyses/latest/languages_summ │ 366,483 | 0.7% ... Rust | │ │ │ │ ary │ 90,778 | 35,328 | 28.0% | │ │ │ │ │ 11,361 | 137,467 | 0.3% │ │ ├─────┼───────────────────────────────┼────────────────────────────────┼───────┤ │ 3 │ Rust moves from experiment to │ The consensus among the │ 0.95 │ │ │ a core Linux kernel language │ assembled developers is that │ │ │ │ - Spiceworks │ Rust in the kernel is no │ │ │ │ https://www.spiceworks.com/so │ longer experimental — it is │ │ │ │ ftware/rust-moves-from-experi │ now a core part of the kernel │ │ │ │ ment-to-a-core-linux-kernel-l │ and is here to stay. So the │ │ │ │ anguage/ │ 'experimental' tag will be │ │ │ │ │ coming off. This elevates Rust │ │ │ │ │ to being the kernel's second │ │ │ │ │ core language alongside C. │ │ ├─────┼───────────────────────────────┼────────────────────────────────┼───────┤ │ 4 │ Why Linux Kernel is written │ Although the current Linux │ 0.92 │ │ │ in C-language but not in C++? │ Kernel source-code contain │ │ │ │ https://thelinuxchannel.org/2 │ certain parts of the code │ │ │ │ 024/06/why-linux-kernel-is-wr │ written in assembly code │ │ │ │ itten-in-c-language-but-not-i │ (actually native CPU assembly │ │ │ │ n-c-thelinuxchannel-kernelpro │ instructions) and recently │ │ │ │ gramming/ │ certain parts of code written │ │ │ │ │ in Rust Language, majority of │ │ │ │ │ the Linux Kernel source-code │ │ │ │ │ is only written in C Language. │ │ ├─────┼───────────────────────────────┼────────────────────────────────┼───────┤ │ 5 │ Linux Kernel Contributors And │ The Linux kernel crossed the │ 0.90 │ │ │ Lines of Code Statistics 2026 │ 40 million line threshold with │ │ │ │ https://commandlinux.com/stat │ version 6.14 rc1 in January │ │ │ │ istics/linux-kernel-contribut │ 2025, containing precisely │ │ │ │ ors-lines-of-code-statistics/ │ 40,063,856 lines. This │ │ │ │ │ represents exponential growth │ │ │ │ │ from the original 10,239 lines │ │ │ │ │ in version 0.01 released in │ │ │ │ │ 1991. │ │ ├─────┼───────────────────────────────┼────────────────────────────────┼───────┤ │ 6 │ Rust for Linux - Wikipedia │ Initial release | October 1, │ 0.93 │ │ │ https://en.wikipedia.org/wiki │ 2022; 3 years ago (2022-10-01) │ │ │ │ /Rust_for_Linux │ | Written in | Rust | │ │ │ │ │ Operating system | Linux | │ │ │ │ │ License | GPL-2.0-only with │ │ │ │ │ Linux-syscall-note. │ │ └─────┴───────────────────────────────┴────────────────────────────────┴───────┘ Gaps ┏━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Category ┃ Topic ┃ Detail ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ source_not_found │ Exact current percentage │ Open Hub statistics may │ │ │ of Rust code in the most │ not reflect the most │ │ │ recent kernel versions │ recent kernel releases │ │ │ (6.12+) │ (6.14+), so the exact │ │ │ │ current Rust percentage │ │ │ │ could be slightly higher │ │ │ │ than 0.3% given active │ │ │ │ Rust adoption. │ ├───────────────────────┼──────────────────────────┼───────────────────────────┤ │ contradictory_sources │ Whether C++ is │ Open Hub reports C++ at │ │ │ officially used in any │ 1.9% of total lines, yet │ │ │ part of the kernel │ official kernel docs and │ │ │ │ community sources say C │ │ │ │ is the language and C++ │ │ │ │ is not used. The C++ │ │ │ │ lines may be in │ │ │ │ tools/scripts not in the │ │ │ │ kernel proper. │ └───────────────────────┴──────────────────────────┴───────────────────────────┘ Discovery Events ┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━┓ ┃ ┃ Suggested ┃ ┃ ┃ ┃ Type ┃ Researcher ┃ Query ┃ Reason ┃ ┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━┩ │ related_research │ null │ Linux kernel Rust │ Rust is growing │ │ │ │ adoption rate │ quickly in the │ │ │ │ 2025 lines of │ kernel; updated │ │ │ │ code percentage │ statistics on its │ │ │ │ │ share would be │ │ │ │ │ valuable │ ├──────────────────┼───────────────────┼───────────────────┼───────────────────┤ │ related_research │ null │ Linux kernel C++ │ Open Hub shows │ │ │ │ code usage tools │ ~1.9% C++ but │ │ │ │ vs kernel proper │ official docs do │ │ │ │ │ not mention C++; │ │ │ │ │ clarifying │ │ │ │ │ whether this is │ │ │ │ │ tooling code vs │ │ │ │ │ kernel code would │ │ │ │ │ resolve the │ │ │ │ │ apparent │ │ │ │ │ discrepancy │ └──────────────────┴───────────────────┴───────────────────┴───────────────────┘ Open Questions ┏━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Priority ┃ Question ┃ Context ┃ ┡━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩ │ medium │ Will Rust eventually surpass │ Rust is at ~0.3% and Assembly │ │ │ Assembly in lines of code │ at ~0.7% per Open Hub; with │ │ │ within the Linux kernel? │ active Rust driver development, │ │ │ │ Rust may soon exceed Assembly │ │ │ │ usage. │ ├──────────┼─────────────────────────────────┼─────────────────────────────────┤ │ high │ What is the roadmap for Rust │ Rust is now a first-class │ │ │ adoption in specific kernel │ language, but the Spiceworks │ │ │ subsystems? │ article notes the focus is on │ │ │ │ 'where, how fast, and under │ │ │ │ whose terms does Rust spread │ │ │ │ inside Linux'. │ ├──────────┼─────────────────────────────────┼─────────────────────────────────┤ │ low │ Why does Open Hub report ~1.9% │ Open Hub's language breakdown │ │ │ C++ in the Linux kernel │ shows 568,053 code lines of │ │ │ codebase when official │ C++, which may belong to │ │ │ documentation does not mention │ userspace tools or build │ │ │ C++ as a supported kernel │ infrastructure bundled in the │ │ │ language? │ same repository. │ └──────────┴─────────────────────────────────┴─────────────────────────────────┘ ╭───────────────────────────────── Confidence ─────────────────────────────────╮ │ Overall: 0.97 │ │ Corroborating sources: 6 │ │ Source authority: high │ │ Contradiction detected: False │ │ Query specificity match: 1.00 │ │ Budget status: under cap │ │ Recency: current │ ╰──────────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────── Cost ────────────────────────────────────╮ │ Tokens: 32922 │ │ Iterations: 3 │ │ Wall time: 82.81s │ │ Model: claude-sonnet-4-6 │ ╰──────────────────────────────────────────────────────────────────────────────╯ trace_id: 710b0a62-06c8-4f49-83e3-dc651c3702a9