-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
The Compiler Explorer has a REST API for compile+execution:
https://github.com/compiler-explorer/compiler-explorer/blob/main/docs/API.md#post-apicompilercompiler-idcompile---perform-a-compilation
To list Go compilers:
https://github.com/compiler-explorer/compiler-explorer/blob/main/docs/API.md#get-apicompilerslanguage-id---return-a-list-of-compilers-with-matching-language
List compilers
$ curl -s https://go.godbolt.org/api/compilers/go
$ curl -s -H 'Accept: application/json' 'https://go.godbolt.org/api/compilers/go?fields=all' | jq .
$ curl -s https://go.godbolt.org/api/compilers/go | grep '^[a-z0-9_]*gltip 'Run
$ goeval -E 'fmt.Println("Hello")' | jq -s -R '{"source":.,"options":{"compilerOptions":{"skipAsm":true},"filters":{"execute":true,}},"allowStoreCodeDebug":false,"bypassCache":2}' | curl -s -XPOST -H 'Content-Type: application/json' -H 'Accept: application/json' --data-binary '@-' https://go.godbolt.org/api/compiler/gltip/compile | jq .
$ goeval -E 'fmt.Println(time.Now())' | jq -s -R '{"source":.,"options":{"compilerOptions":{"skipAsm":true,"executorRequest":true},"filters":{"execute":true}},"allowStoreCodeDebug":false,"bypassCache":2}' | curl -s -XPOST -H 'Content-Type: application/json' -H 'Accept: application/json' --data-binary '@-' https://go.godbolt.org/api/compiler/gltip/compile | jq -r '(.stdout[],.stderr[]) | .text'
2025-06-16 09:24:30.575222479 +0000 UTC m=+0.000016946Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request