Last year at Code BEAM Hayleigh requested proper Gleam support in CodeSandbox, and today is finally the day we have an official Gleam Template.
https://codesandbox.io/p/devbox/github/codesandbox/sandbox-templates/tree/main/gleam
You can fork this template and immediately have a running Gleam setup (with Erlang). Or you can find it in the "Code playgrounds" section when creating a new Devbox from the dashboard.
Note 1 - Because this runs on our VMs and not in the browser, you need to be signed in to CSB to fork and edit it. Running it will count against the credits included with your free plan, but as far as I can tell it runs fine on the lower specs, so you can play around with it for at least 20 h/month before you'd run out of credits.
Note 2 - The VSCode Extension support is still behind a feature flag. Once you're signed in, you can activate it in the editor by clicking the CSB logo in the top left, selecting "Settings > Experiments" and toggling on all 3 of the VSCode related toggles.