Commit Graph

1050 Commits

Author SHA1 Message Date
Macsen Casaus
1eacae7d5b Add TI C29 Clang compiler support (#8911)
Closes #8910 

Depends on https://github.com/compiler-explorer/infra/pull/2225

<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->

Co-authored-by: Macsen Casaus <m-casaus@ti.com>
Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-07-21 15:34:47 -05:00
Jim McKeeth
d1aff27080 FPC: recognize AArch64 '// [n]' source-line comments (#8933) 2026-07-19 14:13:20 +02:00
Sirui Mu
7a6af91bc9 Enable AST output for Python (#8858)
This patch adds support for viewing the abstract syntax tree (AST) of
Python source code in Compiler Explorer, matching the existing AST
viewer feature for C/C++ (Clang AST).

- This patch adds a helper script `ast_dump.py` that parses and dumps
the AST for a Python source code file. `python -m ast` should also work,
but it's not available in old versions of Python.
- This patch adds an AST parser for Python which mimics the structure of
the C/C++ AST parser. It also updates the Python compiler to enable AST
output.
- All existing and new tests pass.

Assisted-by: GitHub Copilot / DeepSeek v4 Flash
Assisted-by: GitHub Copilot / DeepSeek v4 Pro

<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2026-07-14 08:46:10 +01:00
moletteremi
ef9a1ce7c3 [CUDA] add scale's nvcc compiler (nvidia & amd backends) (#8849)
Hi !

This PR adds the [scale nvcc
compiler](https://docs.scale-lang.com/stable/) to the CE live site for
both AMD and Nvidia backends

It works locally and shows host asm, device LLVMIR and:

 - PTX ans SASS for Nvidia backend,
 - AMDGPU code for AMD backend.
 
There is a bug in scale 1.7.1 that prevents the compilation with both
`-S, -o` flags. As a result I had to make some temp workarounds.

For Nvidia backend, PTX is written in the device `.s` file. I run it
through `ptax` and `nvidasm` to get the SASS. To get the LLVMIR, I
decode the device `.bc` file with `llvm-dis`.

For AMD backend, the `.s` file is the AMDGPU code, and the LLVMIR is
obtained the same way.

I plan to make the `.ts` script closer to say `nvcc.ts` once the flag
bugs are fixed in scale.

Let me know if there is anything I missed for the live site integration.

infra PR: https://github.com/compiler-explorer/infra/pull/2191
Issue:
https://github.com/compiler-explorer/compiler-explorer/issues/8865

I acknowledge the use of generative AI to help drafting the code of this
PR.

---------

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 22:14:19 +01:00
Matt Godbolt (bot acct)
3d5a62fe6b Re-add CI check enforcing license header banners (#8883)
## What & why

We used to enforce the BSD-2-Clause license banner on every source file
via `eslint-plugin-header`. That check was lost when we migrated from
ESLint to Biome (#7033), which has no equivalent rule. This PR
reinstates it as a standalone node script, modelled on the existing
`etc/scripts/check-frontend-imports.js`.

### Why a script rather than a Biome rule
Biome 2.x has no built-in license/header rule and no plugin equivalent
to `eslint-plugin-header`; its experimental GritQL plugins aren't suited
to whole-file-prefix matching. A script needs zero new dependencies and
gives full control over scope and exemptions.

## The check (`etc/scripts/check-license-headers.js`)

A file "has an appropriate banner" if, ignoring an optional shebang, it
opens with a `// Copyright (c) …` line **and** contains the BSD-2-Clause
disclaimer body. The year and copyright holder are intentionally **not**
constrained — the tree legitimately has many holders (Compiler Explorer
Authors, Arm, Microsoft, HRT, individuals). The `(c)`/`(C)` marker is
matched case-insensitively.

**Scope:** `.ts/.js/.mjs/.cjs` under `lib/ static/ shared/ types/ test/
cypress/`.

**Exempt:** generated files (`lib/asm-docs/generated`), vendored
(`docenizer/vendor`), `.d.ts`, and three third-party ports that carry
their own upstream license — `static/ansi-to-html.ts` (MIT),
`lib/node-graceful.ts` (MIT), `shared/rison.ts` (Nanonid/rison port).

**Wired into:** CI (`test-and-deploy.yml`), `npm run check`, the `make
pre-commit` target, the husky pre-commit hook, and `lint-staged` (per
staged file).

Usage:
```
node ./etc/scripts/check-license-headers.js            # scan the tracked tree
node ./etc/scripts/check-license-headers.js <files...> # scan specific files (lint-staged)
```

## Backfill

The check surfaced **42 CE-authored files** missing the banner. This PR
backfills them all with the standard `Copyright (c) <year>, Compiler
Explorer Authors` banner, using each file's **git creation year**
(added-at-this-path, so no `--follow` rename artifacts).

## Verification

- `check-license-headers` → clean (was 42 failures)
- `biome check` on all source → no fixes needed (banner format matches
existing convention)
- `tsc` backend + frontend + tests → clean
- pre-commit gauntlet (lint, ts-check, related tests: 528 passed) ran on
commit

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-02 19:13:21 +01:00
hkalbasi
9b47e07d14 Add co2 language (#8842)
This PR adds [CO2](https://github.com/hkalbasi/co2) which is a language
backward compatible with C, with some Rust interop features that
compiles to Rust's MIR.

I added two compiler `co2rustc` and `co2cc`, and a tool `co2miri` which
is Miri for CO2. I added `co2cc` under C compilers, to make it possible
to view diff of assembly for a C code compiled with CO2 and clang or
gcc. `co2cc` is a CO2 frontend which accepts gcc-like flags, and can (or
at least should) compile almost every ISO compatible C23 code.
`co2rustc` accepts Rust like flags, and added under a new `CO2`
language.

Tested locally and it seems to work.

I need some help in setting up artifacts (which, if I understand
correctly, needs to happen in `infra` or `compiler-workflows`). I make
an artifact `co2-multicall` in my CI, which needs to get symlinked in
`co2cc`, `co2rustc` and `co2miri`, and it needs to run a simple project
with miri to create the miri sysroot. If you show me a similar project,
I will do the job.

Disclaimer: Written partially by LLM.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2026-07-02 18:26:35 +01:00
mert-kurttutan
1545df84e8 Tenstorrent support (#8803)
SFPI C++ is Tenstorrent’s C++ environment for writing custom SFPU/Tensix
kernel code with the `riscv-tt-elf-g++` toolchain.

  infra PRs: 
-
[compiler-explorer/infra#2164](https://github.com/compiler-explorer/infra/pull/2164)
-
[compiler-explorer/infra#2183](https://github.com/compiler-explorer/infra/pull/2183)

  Things this PR adds:
  - General support for SFPI C++
  - A dedicated SFPI compiler implementation
- SFPI config for local and Amazon-style `/opt/compiler-explorer`
installs
  - An SFPI example
  - Ability to compile for specific machines with mcpu flag

  Things not implemented:
  - Program execution
  - Binary output support

  Links:
  - Source code: https://github.com/tenstorrent/sfpi
  - Tenstorrent: https://tenstorrent.com/
2026-06-19 11:31:32 -04:00
Lumi
938d42ae3f Add RazorForge language support (#8825)
This adds support for
[RazorForge](https://github.com/dj-lumiere/razorforge-suflae),
a precision-focused, ahead-of-time compiled language that lowers to LLVM
IR. It follows
  `docs/AddingALanguage.md`.

  ### What's included
- `lib/languages.ts` — language definition (`.rf`, Monaco mode
`razorforge`, disassembly `llvm-ir`)
  - `types/languages.interfaces.ts` — `razorforge` language key
- `lib/compilers/razorforge.ts` + `lib/compilers/_all.ts` — compiler
driver
- `static/modes/razorforge-mode.ts` + `static/modes/_all.ts` — Monarch
syntax highlighting
- `etc/config/razorforge.{defaults,amazon}.properties` — compiler config
  - `examples/razorforge/default.rf` — default example
  - `.github/labeler.yml` — `lang-razorforge` label

  ### Compiler behavior
RazorForge's CLI takes verbs + positional arguments only (all build
config lives in
`razorforge.toml`, not flags). The driver invokes the `build` verb,
which runs semantic
analysis and code generation and writes LLVM IR next to the source
(`example.rf` →
`example.ll`) without invoking `opt`/`clang`. The primary output is the
emitted LLVM IR,
  so `supportsIrView` is on and `supportsExecute` is off for now.

  ### Notes
  - Install recipe: compiler-explorer/infra#2177
  - No logo yet (`logoFilename: null`); happy to add one in a follow-up.
- Verified locally: `make`, `biome check`, `tsc`, and `vitest related`
all pass; the example
    compiles to valid LLVM IR with the released `v0.0.3-alpha` build.
2026-06-17 09:47:31 +01:00
Matt Godbolt (bot acct)
6774d762ce Construct builtin examples source explicitly at startup (#8828)
Follow-up to #8779 (which fixed #8601, `builtin.sourcePath` being
ignored). Two related changes:

### 1. Construct the builtin source explicitly at startup (restore
fail-fast)

#8779 made the builtin "Examples" source read its config lazily, on the
first `list()`/`load()`. That fixed correctness but moved the failure
mode: a misconfigured `sourcePath` (missing/unreadable dir) no longer
fails at startup. The server boots, passes healthchecks, takes traffic,
and then throws on the first request that opens Examples.

This restores fail-fast by constructing the source explicitly once
configuration is loaded:

- Replace the `builtin` module-level singleton with a `BuiltinSource`
class whose constructor scans the examples directory, plus a
`createBuiltinSource()` factory that reads `builtin.sourcePath`.
- `lib/sources/index.ts` exposes `createSources()` instead of a
top-level `sources` array (a top-level array would re-run config reads
at import time, reintroducing #8601).
- `initialiseApplication` constructs the sources after config load and
passes the `Source[]` to `ClientOptionsHandler` and
`setupControllersAndHandlers` (both already accept injected sources).

A bad `sourcePath` now throws during startup, before the instance
reports healthy. The lazy fix's correctness (config read after
`initialize()`) is preserved.

### 2. Single source of truth for the examples path

`GolangParser` independently re-read `('builtin', 'sourcePath',
'./examples/')` to locate `go/default.go`, duplicating where the
examples directory is defined. Export `getExamplesRoot()` from
`lib/sources/builtin.ts` and use it in both `createBuiltinSource()` and
`GolangParser`, so the config key and default live in one place.
Behaviour is unchanged (same value resolved); it removes the drift risk
if the key or default ever changes.

### Tests
Tests construct `BuiltinSource` directly with a fixture directory (no
import-order/`resetModules` dance), cover the unknown-example path,
assert fail-fast on a non-existent dir, and verify
`createBuiltinSource()` reads the configured path.

- `npx vitest --run test/sources/builtin-tests.ts
test/compilers/argument-parsers-tests.ts`
- `npm run ts-check`
- `npm run lint-check`

---------

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 22:38:23 +01:00
Nerixyz
33bbd5792a clang-cl: Remove unused /Fm argument (#8792)
clang-cl doesn't write mapfiles like MSVC, so it doesn't support `/Fm`
and it used to report a warning:
```
clang-cl: warning: argument unused during compilation: '/FmC:\Windows\TEMP\compiler-explorer-compiler6Pv4en\output.s.exe.map' [-Wunused-command-line-argument]
```

To still get the function labels, we should use `llvm-objdump`. However,
that doesn't read the generated debug info file right now. I've opened
https://github.com/llvm/llvm-project/pull/201150 to fix this.
2026-06-14 21:53:04 +01:00
Nerixyz
13043fa989 clang-cl: fix IR/AST arguments (#8790)
When the user specified `/link` in the options or enabled "Link to
binary", clang-cl wouldn't generate IR or an AST.
Two changes fix this:
- Strip `/link` and all options after it. These are unused for IR and
AST generation anyway.
- Always specify `-c` for IR generation. For the AST, `-fsyntax-only` is
already specified in the base class.
2026-06-14 21:51:04 +01:00
Francisco Giordano
99275f0f33 Fix Lean CFG parsing (#8783) 2026-06-04 23:41:19 +02:00
Patrick Quist
bbfffd064b Add FXC (D3DCompiler) compilers to HLSL (#8781) 2026-06-04 16:04:00 +02:00
leftibot
532b6c2b57 Fix #8695: [LANGUAGE REQUEST]: Add lua as a supported language (#8696)
Automated fix by @leftibot.

### What changed

> Fix #8695: add Lua as a supported language
> Add support for Lua via the reference PUC-Rio interpreter. Disassembly
is
> produced by `luac -l -l -p`, which writes a verbose bytecode listing
to
> stdout that the LuaCompiler captures and writes to the output file.
The
> class exposes overridable hooks (`resolveLuacExe`,
`getDisassemblyArgs`)
> so alternative implementations such as LuaJIT can plug in a different
> bytecode dumper without rewriting the compiler. Production config
ships
> five Lua releases (5.1.5, 5.2.4, 5.3.6, 5.4.7, 5.5.0) covering the
> actively used minor versions.

### Files
```
 etc/config/lua.amazon.properties   |  27 ++++++
 etc/config/lua.defaults.properties |   5 +
 examples/lua/default.lua           |   5 +
 lib/compilers/_all.ts              |   1 +
 lib/compilers/lua.ts               | 182 +++++++++++++++++++++++++++++++++++++
 lib/languages.ts                   |  11 +++
 test/lua-tests.ts                  | 138 ++++++++++++++++++++++++++++
 types/languages.interfaces.ts      |   1 +
 8 files changed, 370 insertions(+)
```

Closes #8695

_Triggered by @lefticus._

---------

Co-authored-by: leftibot <leftibot@users.noreply.github.com>
Co-authored-by: Matt Godbolt <matt@godbolt.org>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 22:45:23 -05:00
Markus Hoehnerbach
1e820f0511 Add CuTe DSL language support (#8715)
Add [CuTe
DSL](https://docs.nvidia.com/cutlass/latest/media/docs/pythonDSL/overview.html)
support to compiler-explorer. Tried to follow the existing Triton code,
wrapper has similar flags.

<img width="2289" height="894" alt="image"
src="https://github.com/user-attachments/assets/f4e89fcb-ca66-4d67-aace-e905693f0889"
/>

Infra: https://github.com/compiler-explorer/infra/pull/2123

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-03 22:16:57 -05:00
Francisco Giordano
a6cdc6a66d Add Lean (#8737)
Fixes
https://github.com/compiler-explorer/compiler-explorer/issues/5634.

Adds the Lean 4 language and compiler. 

> Lean is an open-source programming language and proof assistant that
enables correct, maintainable, and formally verified code

Since it was first requested in
https://github.com/compiler-explorer/compiler-explorer/issues/5634, it
has become increasingly relevant due to interest in AI-assisted theorem
proving, formalized mathematics, and verified software.

---

Lean compiles in two steps: first to C source code using the `lean`
executable, and then to assembly using the `leanc` compiler distributed
with Lean (I believe it's Clang).

The PR also includes a pane to visualize the emitted C source code that
was modelled after the panes for Rust and Haskell IRs and after the C
preprocessor pane for clang-format integration. Lean outputs mostly
unindented C code, so I enabled the formatter by default.

See companion infrastructure PR at
https://github.com/compiler-explorer/infra/pull/2130.



<img width="3024" height="1720" alt="image"
src="https://github.com/user-attachments/assets/5e7a1e91-e748-4599-8190-d3cb09fca503"
/>

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2026-06-02 12:19:29 -05:00
NoNaeAbC
e285d55130 Add glsl & slang asm compilation (#8573)
Adds the ability to compile glsl & slang to asm. Depends on
https://github.com/compiler-explorer/infra/pull/2038.

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2026-06-01 21:46:34 -05:00
Ofek
1b2bb4706e Fix #8740: Remove outdated security check (#8752) 2026-05-28 20:45:19 +03:00
Ofek
41a59c0abb Fix optional-chain lint errors (#8735)
Biome started emitting 18 warnings like:
```
  ℹ Unsafe fix: Change to an optional chain.
  
    218 218 │   
    219 219 │       updateButtons() {
    220     │ - ········if·(!this.compiler·||·!this.compiler.optPipeline)·return;
        220 │ + ········if·(!this.compiler?.optPipeline)·return;
    221 221 │   
    222 222 │           const {supportedOptions, supportedFilters, initialOptionsState, initialFiltersState} =
```
This fixes them. Although the suggested fixes are labeled 'unsafe', in
these particular cases they in fact are.

Co-authored-by: Ofek Shilon <oshilon@speedata.io>
2026-05-23 14:47:16 +03:00
Steve
156f4b3542 Implement source mapping for .NET compilers (#8666)
This PR implements the source mapping for .NET compilers (C#, F#, VB.NET
and IL), supports CoreCLR, Crossgen2 and NativeAOT compilers.

- Add a parser that walks ECMA-335 metadata and Portable PDB sequence
points to build IL-offset-to-source mappings for .NET methods
- Load PDBs emitted by the .NET compiler after building the dll, and
then save the source mapping in the result
- Extend the .NET asm parser to match disassembly method signatures,
including generic types, generic methods, and inline root offsets, so
emitted asm lines inherit the correct source locations
- Use debug info emitted by the JIT `INLRT @ 0x##` as anchors to match
the offset

Showcase:


![image1](https://github.com/user-attachments/assets/5309fe70-be87-4f94-b70c-21bb91f745be)


![image2](https://github.com/user-attachments/assets/9d15741e-08ff-4f20-8a32-efa0d8307dea)
2026-05-10 09:15:36 -05:00
Steve
75a5b68b06 .NET: Improve NativeAOT compilation and unsupported execution error mode (#8637)
We only support running .NET code on CoreCLR and Mono, so we should reject execution on other compilers otherwise this can confuse users a lot.

In addition, removing the --notrimwarn and --noaotwarn so that users can see warnings during NativeAOT compilations, and adding missing arguments to ilc.
2026-05-02 08:05:38 -05:00
Frank Leon Rose
1efb2a209f Further fixes to Clojure compiler execution in CE infra (#8300)
- [x] Ensure `CLJ_CACHE` environment variable is set to a writable
directory
- [x] Remove unnecessary `CLJ_CONFIG` environment variable
- [x] ~~Configure location of `clojure_wrapper.clj` (not necessary)~~
- [x] Remove logging of namespace injection - text output causes UI to
show compiler error flag
2026-05-02 08:03:08 -05:00
Patrick Quist
7d2bdc4f33 Add Norcroft C and C++ compiler support (#8641) 2026-04-22 20:28:10 +02:00
narpfel
6e35eda1d1 Switch rustc-cg-gcc to use rustup component (#8630)
Infra PR: https://github.com/compiler-explorer/infra/pull/2069
2026-04-16 17:47:17 -04:00
narpfel
d81e69dc87 Add Cranelift backend option for Rust (#8624)
Resolves #5716.

Cranelift currently does not support `--emit=asm`, so this PR mimics the
behaviour of the wasmtime WASM compiler (which also uses Cranelift as
its backend): It unconditionally checks “Compile to binary object”. (See
also
https://github.com/compiler-explorer/compiler-explorer/issues/5716#issuecomment-2671167020.)
2026-04-14 20:42:40 -05:00
kevinjeon-g
9074d09d69 Keep InlineInfo lines for dex2oat (#8614)
We currently retain only StackMap, but InlineInfo is also useful.

<!-- THIS COMMENT IS INVISIBLE IN THE FINAL PR, BUT FEEL FREE TO REMOVE
IT
Thanks for taking the time to improve CE. We really appreciate it.
Before opening the PR, please make sure that the tests & linter pass
their checks,
  by running `make check`.
In the best case scenario, you are also adding tests to back up your
changes,
  but don't sweat it if you don't. We can discuss them at a later date.
Feel free to append your name to the CONTRIBUTORS.md file
Thanks again, we really appreciate this!
-->
2026-04-09 17:25:38 +03:00
Patrick Quist
6b1ff666f2 cmake support for asm (#8575) 2026-03-21 21:21:40 +01:00
Matt Godbolt (bot acct)
b35398e471 Fix nasm default output format to elf64 (#8502)
Fixes #8273

The default NASM output format was `elf` (32-bit ELF), causing a
spurious `64-bit unsigned relocation zero-extended from 32 bits
[-w+zext-reloc]` warning when using 64-bit addressing (which is the
common case on CE's x86-64 infrastructure).

Changed the default to `elf64`. Users who explicitly need 32-bit ELF
output can still pass `-felf` to override.

*(I'm Molty, an AI assistant acting on behalf of @mattgodbolt)*

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-02-23 07:17:25 -06:00
Partouf
9ae16f889f go fix on large asm output 2026-02-23 14:02:44 +01:00
Matt Godbolt (bot acct)
20505fba5a Filter NVCC fatbinData label from assembly output (#8506)
*(I'm Molty, an AI assistant acting on behalf of @mattgodbolt)*

Closes #5178

## Problem

NVCC embeds the CUDA fat binary blob in the host-side x86 assembly
inside a `#APP`/`#NO_APP` inline-assembly block, under a label called
`fatbinData`. In a realistic kernel this can be 100+ lines of `.quad`
hex values — a wall of noise before any user-readable code.

Example: https://godbolt.org/z/W3YMcq8oY

## Fix

Per-compiler pre-processing step in `NvccCompiler.processAsm()`: before
the host assembly reaches the ASM parser, any `#APP`/`#NO_APP` block
containing a `.nv_fatbin` section is stripped out entirely.

- Only `.nv_fatbin` blocks are removed; genuine user inline-assembly
blocks (which also use `#APP`/`#NO_APP` but without `.nv_fatbin`) are
left intact.
- Intentionally NVCC-specific — no changes to the base `AsmParser`, no
false-positive risk for other compilers.
- Stripping happens before `findUsedLabels` runs, so `fatbinData`
naturally disappears as unreferenced without any special-casing in the
parser's label-filtering logic.
- Gated on the existing Labels filter: with no filters active everything
remains visible; with Labels on the blob disappears.

## Testing

**New compiler unit tests** (`test/compilers/nvcc-tests.ts`):
- Strips `#APP`/`#NO_APP` blocks containing `.nv_fatbin`
- Preserves `#APP`/`#NO_APP` blocks without `.nv_fatbin` (user inline
asm)
- Handles multiple mixed blocks correctly
- No-op when no `#APP` blocks present
- Gracefully handles malformed unclosed blocks

**New parser filter-case**
(`test/filters-cases/nvcc-x86-host-example.asm`): representative NVCC
12.0 host assembly (real 15-line fat binary, boilerplate functions,
`.nvFatBinSegment` section) with nine filter-combination snapshots
documenting parser behaviour in isolation. These correctly show that the
**base parser itself does not filter `fatbinData`** — that's the
compiler pre-processor's job.

All 767 tests pass.

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-02-22 19:46:36 -06:00
Steve
17d1898b3a Add support for additional compiler options in .NET compilers (#8497)
Today we only support passing options to the codegen backend, but not
the compiler that produces IL.

This change adds a new pseudo-option `-compopt`/`--compiler-options` so
that options follow after this pseudo-option can be passed to the
compiler that produces IL.
2026-02-22 17:09:28 -06:00
Erik Hemming
97233932f1 Add m68k asm parser to handle | comment character (#8469)
m68k GAS uses `|` as the comment character instead of `#`.
The base asm parser doesn't recognise this, so inline asm source
location markers (e.g. `| 2 "file.c" 1`) leak through into the output
instead of being filtered.

Repro on godbolt.org: https://godbolt.org/z/vYneWc8Tf

---------

Co-authored-by: Patrick Quist <partouf@gmail.com>
2026-02-16 14:01:37 -06:00
jiakaiz-g
ac56744927 Add compiler overrides for dex2oat (#8435) 2026-02-09 19:27:57 +01:00
Matt Godbolt (bot acct)
164d33bb42 Add TinyGo compiler support (#8456)
Adds support for [TinyGo](https://tinygo.org/), an LLVM-based Go
compiler targeting microcontrollers and WebAssembly.

## Changes

- **New `TinyGoCompiler` class** (`lib/compilers/tinygo.ts`): Extends
BaseCompiler with TinyGo-specific handling:
- Forces binary mode (TinyGo has no `-gcflags=-S` equivalent — it's
LLVM-based, not gc)
  - Sets up `TINYGOROOT`, `GOROOT`, and `PATH` environment variables
  - Uses `tinygo build -o <output>` as the compilation command
- User arguments (e.g. `-opt=2`, `-gc=none`, `-scheduler=none`) pass
through directly
- **Config**: Adds TinyGo 0.37.0 to `go.amazon.properties`
- **Registration**: Exports `TinyGoCompiler` from `_all.ts`

## Why TinyGo?

TinyGo produces significantly smaller binaries than standard Go (445KB
vs 1.5MB for a hello world). It targets a different niche —
microcontrollers, WASM, and resource-constrained environments — making
it an interesting comparison alongside the existing gc and gccgo
compilers.

## Testing

Tested locally with CE running on a non-default port:
-  Compiler detected and version parsed correctly
-  Compilation produces x86 assembly via objdump (5000+ lines for a
simple program)
-  Execution works (`println` output captured correctly)
-  User arguments like `-opt=2` pass through correctly
-  All pre-commit checks pass (ts-check, lint, properties validation,
related tests)

## Infra

TinyGo 0.37.0 is already configured in the infra repo
(`bin/yaml/go.yaml`) — installation is just a tarball download from
GitHub releases.

The config references `/opt/compiler-explorer/golang-1.24.2/go` as
GOROOT — TinyGo needs a standard Go installation for the stdlib.

Closes #3969

🤖 Generated by LLM (Claude, via OpenClaw)

---------

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-02-08 15:02:47 -06:00
Matt Godbolt (bot acct)
4229733210 feat(asm): add ca65 assembler (cc65 toolchain) for 6502 (#8455)
Add ca65 as a standalone assembler under the Assembly language, reusing
the existing cc65 toolchain installations (2.17, 2.18, 2.19, trunk).

ca65 generates a listing file with full macro expansion (`-x -x`) so
users can debug macro output — the primary use case from the feature
request.

**What's included:**
- `Ca65Compiler` class — runs ca65, captures the listing output
- `AsmParserCa65` — parses the ca65 listing format (address, hex bytes,
source)
- Config for all 4 existing cc65 versions as ca65 assemblers
- Include paths set to each version's `asminc` directory

**How it works:**
Since ca65 produces object files in cc65's custom format (not ELF), we
can't objdump them. Instead, we use ca65's `-l` (listing) flag with `-x
-x` (full macro expansion) and `--list-bytes 0` (unlimited hex bytes per
line). The listing shows addresses, generated bytes, and expanded source
— exactly what users need for macro debugging.

Closes #7118

Co-authored-by: mattgodbolt-molty <mattgodbolt-molty@users.noreply.github.com>
2026-02-08 14:23:56 -06:00
Partouf
35b0a663cf hotfix go 2026-02-08 12:50:20 +01:00
Patrick Quist
eecaef4ef3 Add library support for Go compiler (#8397) 2026-02-08 01:18:43 +01:00
Matt Godbolt
53c7dd328b Configure Biome import organiser with grouped imports (#8431)
Enable Biome's `organizeImports` with groups matching the original
ESLint `import/order` configuration:

1. **Node builtins** (`node:fs`, `path`, etc.)
2. *(blank line)*
3. **Third-party packages** (`express`, `@sentry/node`, etc.)
4. *(blank line)*
5. **Local/relative imports** (`../foo.js`, `./bar.js`, aliases)

This resolves the inconsistency where Biome wasn't enforcing import
grouping, meaning new files would lose the blank-line separation that
the old ESLint config enforced.

### Impact
- **354 files** updated out of 738 checked (~48%)
- **+188 / -240 lines** (net -52) — almost entirely single blank line
additions/removals between import groups
- No import reordering; purely group separator consistency

Fixes #7373

🤖 Generated by LLM (Claude, via OpenClaw)
2026-02-01 20:50:46 -06:00
Tony Cook
3d4fc27de0 Add the perl language (#8351)
Based on
https://github.com/KaceCottam/compiler-explorer/commits/language-perl/
rebased, modernized and captures the generated perl op codes.

<img width="1569" height="878" alt="image"
src="https://github.com/user-attachments/assets/4d131097-d258-419b-86c9-1a56c16f9ce2"
/>

---------

Co-authored-by: Kace Cottam <kaceac1@hotmail.com>
2026-01-25 16:50:12 -05:00
Steve
9a8f2b4ecf Add .NET 10 (#8314)
Add .NET 10 compilers.

Depends on https://github.com/compiler-explorer/infra/pull/1913
2026-01-25 16:28:56 -05:00
Dana Jansens
edf9bd889e Use prebuilt runtimes when linking with the Carbon toolchain (#8384)
This depends on https://github.com/compiler-explorer/infra/pull/1936
which builds the runtimes when installing the Carbon toolchain. Then
this PR passes `--prebuilt-runtimes` to the `carbon link` step in order
to use them. The result is that compiler explorer no longer times out
when trying to link a binary with the Carbon toolchain.

The carbon.ts file is refactored a little in an attempt to improve
clarity about what is going on, and some comments are added throughout.

Fixes https://github.com/carbon-language/carbon-lang/issues/6603.
2026-01-20 21:02:38 -06:00
Alastair Murray
8e6a58f16f Suppress crash reporting in Mojo compiler (#8382) 2026-01-18 12:31:33 +01:00
Anson Mansfield
8a0fbf826b Add MicroPython Support (#8256) 2025-12-29 10:39:35 +01:00
Hayden Gray
aeaffd6755 [odin] accommodate changes made in dev-2025-02 (#8328)
in `dev-2025-02`, odin changed from single-module debug builds to
multi-module and prevents it from spitting out a single `.s` file. this
adds version checking to make sure that any odin version after
`dev-2025-02` uses `-use-single-module`. additionally, changes were made
around name canonicalization that required changing the matching for
label names to avoid clogging the assembly output (both standard and
binary)
2025-12-15 19:53:32 -06:00
Frank Leon Rose
e35662fbb5 Fix Clojure dependencies (#8249) 2025-11-27 17:29:43 +01:00
Partouf
5b39ab8f42 gocache limit stat on construct and also support cache for trunk 2025-11-25 18:13:01 +01:00
Patrick Quist
194a6c8df6 Add GOCACHE support for Go compiler with writeable cache directory (#8283) 2025-11-25 00:55:45 +01:00
narpfel
b5c0045556 Adapt isOutputLikelyLlvmIr for Rust (#8253)
The existing heuristics don’t reliably recognise LLVM IR produced by
`rustc` (e. g. when the generated code does not use any LLVM
intrinsics), so this adds LLVM IR detection based on the
`--emit=llvm-ir` and `--emit llvm-ir` command line flags.
2025-11-15 17:16:35 +01:00
Ofek
b76ebf9cf7 Fix #8023: Cleanup msvc version text. (#8264) 2025-11-09 15:21:09 +02:00
Oguz Ulgen
f7bc52a923 Add Helion language support (#8206)
Helion is a Python-embedded domain-specific language (DSL) for authoring
machine learning kernels, designed to compile down to Triton.

https://github.com/pytorch/helion

I mostly followed the Triton example, please let me know if there's more
I need to do or anything I missed.

infra PR: https://github.com/compiler-explorer/infra/pull/1875
2025-11-04 12:08:20 -06:00