Files
compiler-explorer/examples
Tim Hutt d1d0883a86 Add support for the Sail language (#7304)
This adds support for the [Sail
language](https://github.com/rems-project/sail) - a DSL for defining
ISAs.

It's not quite ready but I need some help. These are the main remaining
issues:

1. When you "link to binary" it does disassemble the binary properly,
but the syntax highlighting and line numbers are broken.


![image](https://github.com/user-attachments/assets/2f4fe12c-49b4-4b26-9cb0-7e1666a7b3a2)

2. If you try to execute the code without a `function main() -> unit =
...` then it gives this error in the compiler output:

```
Internal Compiler Explorer error: Error: spawn /tmp/compiler-explorer-compiler2025025-31052-c8gern.pf8t/model.c EACCES
    at ChildProcess._handle.onexit (node:internal/child_process:285:19)
    at onErrorNT (node:internal/child_process:483:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Compiler returned: -1
```

This is weird - it should give a linker with an undefined reference to
`zmain`.

3. Sail compiles to C, and then I added extra steps to compile that to
binary (if you select `Execute the code`), but as you can see I had to
move the binary back over the C file, so in this case `model.c` is
actually an ELF file. It works but that seems very weird. There is a
`getExecutableFilename()` method I could override, but doing that seems
to make it even more confused.

4. I also had to have a fake flag for `binary` because the `filters`
don't seem to get set correctly when passed to `runCompiler()`. E.g.
`buildExecutable()` doesn't pass them at all. Not sure what is going on
there. Seems to work though.

Any help appreciated!

PS: Sail is a cool language. It has lightweight dependent type for
integers and bit vectors, which I haven't demonstrated in the examples
yet, but they're neat.

---------

Co-authored-by: Matt Godbolt <matt@godbolt.org>
2025-04-17 17:22:18 -05:00
..
2022-06-20 12:24:31 +01:00
2023-06-02 08:08:57 -05:00
2025-02-12 13:41:08 -06:00
2018-10-14 01:30:35 +02:00
2021-08-26 21:57:07 +02:00
2023-03-01 06:17:26 +08:00
2022-09-20 07:42:41 -05:00
2020-09-17 21:59:34 -05:00
2022-11-27 10:39:05 -06:00
2022-05-19 13:27:23 +02:00
2022-02-11 16:19:16 +01:00
2023-12-03 11:34:25 -05:00
2024-09-30 22:19:55 -05:00
2022-08-09 07:32:19 -05:00
2023-10-11 15:01:45 -04:00
2025-01-22 00:09:35 +01:00
2019-05-26 19:45:20 +02:00
2023-01-14 15:44:14 +01:00
2021-06-02 22:58:41 +02:00
2023-03-30 18:20:56 +02:00
2020-10-08 23:58:33 +02:00
2025-02-19 10:41:42 -06:00
2018-12-15 21:31:15 +03:00
2024-12-06 17:28:47 +01:00
2021-07-06 08:32:22 -05:00
2022-07-18 20:18:36 +02:00
2022-10-05 09:32:45 +02:00
2021-07-30 16:29:37 -04:00
2021-06-29 09:39:06 +02:00
2022-04-14 02:33:13 +02:00
2024-02-12 21:50:33 -06:00
2025-02-24 09:38:13 -06:00
2020-09-20 01:18:54 +02:00
2022-06-24 22:07:40 +02:00
2023-08-15 22:16:36 -05:00
2023-04-10 22:49:15 -05:00
2024-11-26 16:38:40 -06:00
2024-06-10 21:29:03 -05:00
2024-10-22 06:37:40 -05:00
2018-09-09 23:36:17 +12:00