Commit Graph
142 Commits
Author SHA1 Message Date
Patrick Quist d2c7a5222e Local/Remote Execution environment (#6413) 2024-05-26 22:09:01 +02:00
Ofek 42533d8dbb Stop duplicating hasXXoutput + XXoutput (#6476)
When you need to check if `XXoutput` exists, check it directly.
+some TSification in CompilationResult
2024-05-14 20:11:09 +03:00
Patrick Quist adb8bd774a Dynamic instruction set for documentation (#6173) 2024-04-22 18:40:56 +02:00
narpfel f5efd390fa Optionally show disambiguating hashes in demangled Rust identifiers (#6265)
Demangled Rust identifiers under the `legacy` name mangling scheme rely
on a hash to disambiguate items with the same name, such as different
monomorphisations of the same function or different closures’
`call_once` methods.

In the `v0` mangling scheme, this is no longer a problem. However,
configuring the demangler to show hashes in `legacy` names will include
crate-id hashes in `v0` names, which are [mostly
unneeded](https://rust-lang.github.io/rfcs/2603-rust-symbol-name-mangling-v0.html#appendix-a---suggested-demangling).

This PR introduces a new checkbox *Options...* → *Verbose demangling*
that lets the user select if they want to include disambiguating hashes
in demangled identifiers.

This checkbox is only shown for compilers that support verbose
demangling, and deactivated when the *Demangle identifiers* checkbox is
unchecked.

Resolves #1754.
Resolves #6255.
2024-04-01 21:58:42 -05:00
Oleksandr Zarudnyi 384f5f334a Integrate zksolc (#4398) 2024-03-29 23:06:33 +01:00
narpfel 10c6074073 Add digit separators to long numbers in numeric tooltip (#6221)
Long numbers are sometimes hard to read in the numeric tooltip. To
improve readability, this PR adds language-specific digit separators to
the numeric tooltip.

Decimal numbers are grouped into chunks of three digits while
hexadecimal numbers are grouped into chunks of length four.

The digit separator is language-specific and chosen so that the number
is a valid token in the source language.

[Examples](https://godbolt.org/z/s86cMbjeK):
* for C++, hovering the number `8583909746840200552` shows this tooltip:
`8'583'909'746'840'200'552 = 0x7720'2C6F'6C6C'6568 =
6.5188685003648344e+265`
* for Python, hovering the number `-12345678` shows this tooltip:
`-123_456_789 = 0xFFFF_FFFF_F8A4_32EB = -2.66427945e+34f`

For languages that don’t have a `digitSeparator` set, the tooltip is not
changed.
2024-03-05 20:11:39 -06:00
Patrick Quist 2f0ff5aeb1 fix llvm-cov (#6211) 2024-03-02 14:08:39 +01:00
Marc Auberer 54dda76f22 New language: Spice (#6105)
Add support for the Spice programming language.

Spice (`spicelang`) is a simple, AOT compiled, LLVM-based systems
language with focus on practicality and performance.

**Key features of Spice**
- simplicity - see what you get aproach with batteries included
- performance: As Spice uses LLVM as its primary backbone, it competes
with the performance of other LLVM-based compilers
- enhanced safety: Spice implements an enhanced safety mechanism, which
includes builtin heap type with auto-free and more
- cross-compile support: Currently x86_64, AArch64 and wasm32 are
supported cross-compilation targets, but more to come
- Pretty good C and C++ interop

**Links**
- Source code: https://github.com/spicelang/spice
- Website: https://spicelang.com
- Playground (own CE instance): https://play.spicelang.com
- Infra PR: https://github.com/compiler-explorer/infra/pull/1229

**Things this PR addresses**
- General support for Spice
- Three code examples
- Spice mode (Syntax highlighting)
- Opt pipeline support
- LLVM mca and osaca support
2024-02-12 21:50:33 -06:00
Andrea Tomasi 1cacc9ce79 Add Elixir language support (#6081)
Hi, I am adding support for the Elixir language
(https://github.com/compiler-explorer/compiler-explorer/issues/3947)
I have done this so far. It is not perfect but at least is something I
can work with.
 
In Elixir you can write several modules in the same file, so I show the
different compile utins as a list.

It works locally but I don't know how to add the Elixir language to
[infra](https://github.com/compiler-explorer/infra/)

Some notes:
- I think Elixir's macro system may be a potential security issue
because I can run code during compilation.
- The decompiled code contains a reference to the file path on the
system machine.


![elixir_compiler](https://github.com/compiler-explorer/compiler-explorer/assets/11353602/59e46c98-646d-4275-9c03-e4097a4977ef)
2024-02-05 20:54:01 -06:00
Jeremy Rifkin c43e69bfdd Use CompilerInfo[] in a couple places that were previously any or never (#6029)
Depends on #6028
2024-01-22 21:47:45 -06:00
partouf 3c57dca1bd fix proxy remote for cmake calls 2024-01-01 19:42:58 +01:00
Vadim Zaliva 0781e2b1be Compilers for exectuable Cerberus CHERI C and ISO C semantics (#5864)
# Cerberus

[Cerberus](https://www.cl.cam.ac.uk/~pes20/cerberus/) offers executable
semantics for a substantial fragment of C and
CHERI-C languages. It is implemented via an elaboration into a simpler
Core language, which is displayed as the compiler
output in the Compiler Explorer. Evaluation of C programs (execution) is
also supported.

## Prerequisites

The easiest way to install both the Cerberus and Cerberus-CHERI
compilers is by using Docker:

`docker pull vzaliva/cerberus-cheri`

Then, for example, you can print the _Core_ elaboration for `test.c`
using ISO C semantics:

`docker run -v $HOME/tmp:/mnt -it vzaliva/cerberus-cheri cerberus
--pp=core --exec /mnt/test.c`

## Configuration

The file `etc/config/c.defaults.properties` defines a group of two
compilers: 'cerberus' for ISO C and 'cerberus-cheri'
for CHERI-C. It assumes that the corresponding executables are in the
path.

## Limitations and Future Improvement

Presently, only simple Core output is shown. It is not syntactically
highlighted nor linked to C source code locations.
Some potential future improvements include:

1. Error location handling in warning and error messages
2. Specifying execution flags
3. Core syntax highlighting
4. Display of AST
5. Display of other intermediate languages (Cabs, Ail)
6. Tooltips/links to the ISO C document from Core annotations

## See also:

- [Cerberus (project page)](https://www.cl.cam.ac.uk/~pes20/cerberus/)
- [Cerberus (GitHub
repository)](https://github.com/rems-project/cerberus)
- ["Formal Mechanised Semantics of CHERI C: Capabilities, Undefined
Behaviour, and Provenance" (paper,
preprint)](https://zaliva.org/cheric-asplos24.pdf)
- ["CHERI C semantics as an extension of the ISO C17 standard" (tech
report)](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-988.html)
2023-12-23 18:05:35 -06:00
J. Ryan Stinnett e7b22b41be Limit exec streams to max string length (#5898)
Some operations set `exec`'s `maxOutput` to a value larger than the max
string length. This change ensures we always cap output to the engine's
string limit (currently 512 MB in recent Node versions).

This also tweaks handling when reaching the string limit to ensure
adding the "truncated" message itself does not send us beyond the limit.
2023-12-23 17:54:46 -06:00
J. Ryan Stinnett 43bdf65d54 Customise opt pipeline language by compiler (#5880)
This allows each compiler to override the default Monaco language used
by the opt pipeline view.
2023-12-12 00:54:43 -05:00
J. Ryan StinnettandMatt Godbolt f0e1d5d264 Add Racket optimisation pipeline (#5836)
This adds a Racket optimisation pipeline view by reusing the existing
LLVM-focused optimisation pipeline UI. A Racket-specific pass parser
translates its output into passes for the UI to present.

This new Racket optimisation pipeline view is currently only enabled for
Racket nightly, as it depends on [recent
changes](https://github.com/racket/racket/pull/4842) to Racket's
compiler output to function.

This also extends the opt pipeline view to allow customising the
function selector label as well as the options and filters for each
compiler where needed.


![image](https://github.com/compiler-explorer/compiler-explorer/assets/279572/f540b41e-fd55-4375-bb2d-a0bb977530b3)

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-12-11 19:35:45 -06:00
Vicente BoleaandMatt Godbolt 20d2852138 lang: add cmakescript language (#5815)
Fixes #5502 

In this PR I make an early attempt to add the CMakeScript as a language
in compiler-explorer. I will be fantastic having this since CMake is one
of the most used build system. Having an cmake interpreter in the web
would probe truly useful for teams and individuals, it will be a
fantastic way to share snippets of cmakescript and show how they are
executed with different cmake versions.

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-12-04 21:03:50 -06:00
kevinjeon-g 7efe253f5f Add support for Android D8 (8.1.56) (#5756)
Adds D8Compiler, which applies to the Android Java and Android Kotlin
languages. D8Compiler instantiates a JavaCompiler or KotlinCompiler
using the java/kotlin dependencies' paths for D8 in the infra repo.

compiler-finder.ts has been updated to allow for duplicate compiler IDs
for 'android-java' and 'android-kotlin', as it is expected that the
compilers used for these languages is the same.
2023-12-04 19:35:56 -06:00
Jeremy RifkinandMarc Poulhiès 7680595a88 Add GIMPLE (#5817)
This PR adds GIMPLE as a language

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/42d2b423-0d87-4a41-b762-3d8b4e7cedd2)

---------

Co-authored-by: Marc Poulhiès <dkm@kataplop.net>
2023-12-03 11:34:25 -05:00
J. Ryan Stinnett c3e1b04c31 Rename opt pipeline without LLVM prefix (#5828)
This prepares for future work that will reuse the opt pipeline view
outside of the LLVM ecosystem by renaming related components to remove
the LLVM prefix.

The pass dumper keep its LLVM prefix, as it is assumed this part is
likely to be customised for each compiler ecosystem.

The historical component name has been preserved in the component list
as an alias to keep old links working.
2023-12-03 11:33:42 -05:00
Jeremy Rifkin b134451b7d Add gimple front-end syntax option for gcc tree/rtl viewer (#5816)
This PR adds an option to the gcc tree/rtl dump viewer to dump syntax
that the gimple frontend can accept


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/4a5ff503-9420-4fc3-ba6f-6b1dc196e938)
2023-11-29 09:42:38 -05:00
Patrick Quist 455d92916a Execution with heaptrack (#5644) 2023-11-07 23:59:40 +01:00
David Spickett 971889e5d7 LLVM TableGen: Add actions to Overrides menu (#5699) 2023-11-04 20:54:43 +01:00
David Spickett 5f3db78dce Add the LLVM TableGen language (#5629)
LLVM TableGen is used to generate complex output files in the llvm
project. A generic description of classes and definitions produces
"records" that can then be walked by a TableGen backend to produce
things like C++ code, configuration files, etc.

The biggest examples are LLVM's assembler and disassembler where all the
targets' instructions are defined in TableGen.

https://llvm.org/docs/TableGen/ProgRef.html

An example:
```
class Register<int _size, string _alias=""> {
    int size = _size;
    string alias = _alias;
}
def X0: Register<8> {}
def X29: Register<8, "frame pointer"> {}
```
```
------------- Classes -----------------
class Register<int Register:_size = ?, string Register:_alias = ""> {
  int size = Register:_size;
  string alias = Register:_alias;
}
------------- Defs -----------------
def X0 {        // Register
  int size = 8;
  string alias = "";
}
def X29 {       // Register
  int size = 8;
  string alias = "frame pointer";
}
```

It's often a pain point for people new to LLVM so having a quick way to
experiment would be a great benefit for the community (we have a Jupyter
kernel which is good but not as simple as Compiler Explorer).

The compiler for TableGen is `llvm-tblgen`. This comes with most release
builds of LLVM in /bin along with clang and the others. Its default is
to output a text dump of the records defined so that's what I've used
here. This is not executable code so I've disabled the features related
to that.

A user could pass options to `llvm-tblgen` to produce text in a format
other than this, C++ code or JSON for example. However this text dump is
the main use case.

I've re-used an existing clang install, since that includes
`llvm-tblgen` in `bin/`. I just added the 17.01 version for this first
change.

Syntax highlighting is a mix of the Fortran and Ada configuration,
following the language spec I linked above. Though I am very new to that
so it is likely incomplete.
2023-10-23 19:59:46 -05:00
Matt GodboltandNick DeMarco 458fa247f8 Hylo fixes; specify PATH, and fix name (#5625)
-  Add a general extraPaths for compilers and use it to let Hylo find clang++

Co-authored-by: Nick DeMarco <nickpdemarco@gmail.com>
2023-10-18 21:59:42 -05:00
Nick DeMarco 58ee2354be Add Hylo support (#5622)
This PR adds front end support for the
[Hylo](https://www.hylo-lang.org/) programming language. Back end
support has already been added with
https://github.com/compiler-explorer/misc-builder/pull/71 and
https://github.com/compiler-explorer/misc-builder/pull/72.
2023-10-18 12:07:38 -05:00
Patrick Quist 4481bd0f3a Show up to date version for trunk compilers (#5571) 2023-10-15 15:56:43 +02:00
Justin Bogner 4c613e9f70 Implement comment filtering in LlvmIrParser (#5389)
This is arguably a bit pointless, since most if not all of the comments
in LLVM IR are filtered out as part of directives or attributes, but it
comes up for things like `opt` on LLVM IR with debug info and for DXC
(which is DXIL, but that's LLVM 3.7-era IR).

In any case, this makes things less confusing in those cases by making
the comments filter actually do something, rather than be ignored.
2023-08-20 11:32:02 -04:00
SpydrandMatt Godbolt 0bf769e245 New Language: V (#5297)
V (`vlang`) is a simple, fast and safe general purpose programming
language compiling to human-readable C.

#### Key features of V:

- simplicity, "only one way to do things"
- performance as fast as C
- safety: no null, no globals, no undefined behavior, immutability
- automatic C to V translation, good C interoperability
- hot code reloading
- flexible memory management (GC by default, manual, arena allocation,
autofree)
- other compilation backends like JavaScript, `native` (wip), `wasm`
(wip) or interpreted

#### Links:

Source code: https://github.com/vlang/v
Official website: https://vlang.io
Web playground: https://play.vlang.io/

infra PR: https://github.com/compiler-explorer/infra/pull/1058

#### Things this PR adds:

- General support for V
- Code inspection for the C, Go and JavaScript backends
- Support for the v formatter `v fmt`
- Some V example code

#### Things not implemented:

- Support for binary-output backends like `native` and `wasm`
- Support for running programs

<!-- 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>
2023-08-15 22:16:36 -05:00
Marc Poulhiès 3a496913e4 fix: correct some compiler categories (#5371)
Some compilers were badly assigned the default ISA (amd64).

Also fix rv32 GCC 10.3.0 that was pointing to the rv64 toolchain.

fix #5328

Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
2023-08-09 23:16:17 +02:00
Mauro Baladés a33dd9de16 Added snowball lang (#5245)
# Language name
Snowball 🐱 

Language version
Snowball v0.0.7-beta

## Language homepage
Soon™️ 

Not the websites but some (WIP) documentation:
https://snowball-lang.gitbook.io/docs/

Compiler homepage

https://github.com/snowball-lang/snowball

Compiler version
v0.0.7-beta

Motivation

With a myriad of features to offer, Snowball boasts object-oriented
programming, memory safety, built-in functions for enhanced
productivity, and faster execution than other languages. Plus, its
garbage collector and unit testing make it a comprehensive tool for
developers.

> It's still in development but it's development is fast
2023-07-10 20:38:55 -05:00
Jeremy Rifkin ddb4ed8c05 Improve the type of ExecutionOptions.env (#5206) 2023-06-28 08:15:24 -04:00
Patrick Quist 40ae2261e0 Headers via conan (#5179) 2023-06-23 12:25:30 +02:00
Patrick Quist 76beb84b2e C64 emulation (#5198) 2023-06-23 12:21:28 +02:00
Jeremy Rifkin 72e6b34d55 Improve pane typing (#5191)
Resolves #4365
2023-06-21 21:40:35 -04:00
Jeremy Rifkin d907f34bdc Fix handling when the opt output is truncated (#5189)
Fixes #2984
2023-06-21 21:26:55 -04:00
Jeremy Rifkin e267286553 Support user site templates (#5180)
Long overdue
![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/d8a56216-d6b0-459a-8539-9f519c023b92)
![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/133da5e6-2717-464a-a5fc-5983a3f75014)
2023-06-19 22:33:40 -04:00
Jeremy Rifkin 3716cbd446 Support control flow graphs from the IR pane (#5155)
On top of #5154


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/7bf25b5b-8988-42ff-9d8c-233e6d817997)

Additionally, while I was here, added support for multiple control flow
graphs to be opened from one compiler instead of disabling the button
once one is opened. And improved the implementation for how this was
done for the llvm opt pipeline.

And did some type work along the way.
2023-06-19 21:48:20 -04:00
Guo Ci 7651874a98 add Stack Usage Viewer (#5160)
For #4834
2023-06-19 20:26:15 -05:00
Jeremy Rifkin 42ea9cc128 General work on solidifying the instruction set system (#5156)
Mainly type work
2023-06-17 19:41:26 -04:00
Jeremy Rifkin 60ce06b02f Improve cache handling on the frontend, cache executions on the backend, and improve controls on the exec pane (#5111) 2023-06-11 19:10:30 -04:00
Jeremy Rifkin 74e177dd0b Fix ordering in the compiler picker popup (#5132)
No more of this nonsense, long overdue fix

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/bf55a8bb-63a9-47dc-802e-d24df465d422)
2023-06-11 18:00:12 -04:00
Jeremy Rifkin 10851a1dda LLVM IR pane improvements (#5078)
This PR will add filtering and other output options to the LLVM IR pane


![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/ffc865ea-b3fa-441f-b501-4ec4b68e261f)

![image](https://github.com/compiler-explorer/compiler-explorer/assets/51220084/936be326-b55e-40cd-ba47-22b121c1acfb)


Closes #5062
Related to #5045
2023-06-11 17:00:53 -04:00
Guo Ci 79bba4c1d1 Add PTX and SASS docs (#5129)
For CUDA C++, add PTX and SASS docs.
2023-06-11 17:00:38 -04:00
aliaegikandRubén Rincón Blanco 91334b9d9b New Language: C3 (#5086)
Related to: https://github.com/compiler-explorer/infra/pull/1017

C3 is a system programming language based on C. It is an evolution of C
enabling the same paradigms and retaining the same syntax as far as
possible.

Design Principles:
Procedural "get things done"-type of language.
Try to stay close to C - only change what's really necessary.
C ABI compatibility and excellent C integration.
Learning C3 should be easy for a C programmer.
Data is inert.
Avoid "big ideas" & the "more is better" fallacy.
Introduce some higher level conveniences where the value is great.

You can try it out live on its tutorial website:
https://www.learn-c3.org
Source code: https://github.com/c3lang/c3c

---------

Co-authored-by: Rubén Rincón Blanco <git@rinconblanco.es>
2023-06-02 08:08:57 -05:00
Matt Godbolt 1275dca94b Merge branch 'main' into asm-docs/arm32-arm64 2023-05-30 19:38:31 -05:00
Jeremy Rifkin 0364ef87ad Use a discriminated union for the ConfiguredOverride type (#5075)
Closes #5054
2023-05-25 13:10:54 -04:00
fodinaborandMatt Godbolt e28e67d972 Add new "Debug intrinsics" filter. (#5045)
For now, this removes all `llvm.dbg.*` calls from LLVM IR. This is
useful to keep coloring the line correspondence between source and IR,
while not polluting the IR with the debug intrinsics.

Admittedly, I don't have much of a clue of what's going on here, so I
might be missing obvious adaptions (e.g. can we disable this for all
non-LLVM compilers for now somehow?).
Also, not really a Node.JS testing wizard either... 🤷🏼 

Just wanted this really bad for a workshop that's coming up soon ^^

Only tested with my system's default `clang` for now.

Fixes #5044

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2023-05-22 22:35:01 -05:00
Patrick Quist 079d495757 Compiler overrides (#5001) 2023-05-16 03:53:57 +02:00
Serval Martinot-Lagarde b904ddf48a asm-docs: Add arm64 and update arm32 documentations 2023-05-08 11:40:23 +02:00
Patrick Quist b262531cdd Offer timetrace json to view somewhere (#4967) 2023-04-23 11:29:52 +02:00