HNHacker News
TopNewBestAskShowJobs

mattgodbolt

1,194 karma · joined March 1, 2014

Master-of-none developer. Ex-games industry, ex-Google, ex-startup.

Primary hacker of Compiler Explorer - https://godbolt.org

Mucks about with Javascript emulators - https://miracle.xania.org, https://bbc.xania.org/ and in C++ too https://spectrum.xania.org

Some OSS on https://github.com/mattgodbolt/ and https://github.com/compiler-explorer

submissionscomments
mattgodbolt··on Compiler Explorer
So! The typescript compiler doesn't leave us (currently) with any asm. We can only execute what it produces: https://godbolt.org/z/YvKe8ojvT for example.

You can also use an "execute only" view instead of the default "show me the assembly": https://godbolt.org/z/cfvEvnK56

Hope that helps!

mattgodbolt··on Compiler Explorer
That said; it should resolve and still point at Compiler Explorer. If you're not getting that, ping me on email/twitter/discord and we can debug!
mattgodbolt··on Compiler Explorer
I'm delighted to say we get a decent income from Patreon supporters and GitHub sponsors, as well as a little from commercial sponsors. It covers our running costs, and leaves some left over to save for contingency, and reward some contributors (myself included!).

I don't know what an Optiver salary would be (though I can guess: I work in finance too), but no, it's absolutely not a living wage :), lucky though I am to have anything for an Open Source project.

I do it as it's something I feel strongly about; it's got my name (and reputation!) staked on it (not as I'd planned it); and it's given me enormous opportunities too!

mattgodbolt··on Compiler Explorer
Thank you for the kind words :)
mattgodbolt··on Compiler Explorer
If you click "show binary" that's pretty much what we do. Here's a link doing so, and also running `elfdump -a` on the linked output: https://godbolt.org/z/9EcxhedK4
mattgodbolt··on Compiler Explorer
Sounds like an issue - I've filed something to take a look: https://github.com/compiler-explorer/compiler-explorer/issue...
mattgodbolt··on Compiler Explorer
Why does it have to be related to C++ compilers? Compiler Explorer supports a number of languages, including C#:

  $ curl -sL https://godbolt.org/api/languages
  Id             | Name
  csharp         | C#
  fsharp         | F#
  vb             | Visual Basic
  go             | Go
  c              | C
  c++            | C++
  fortran        | Fortran
  assembly       | Assembly
  circle         | C++ (Circle)
  circt          | CIRCT
  hlsl           | HLSL
  cppx           | Cppx
  crystal        | Crystal
  dart           | Dart
  erlang         | Erlang
  carbon         | Carbon
  hook           | Hook
  cppx_blue      | Cppx-Blue
  cppx_gold      | Cppx-Gold
  mlir           | MLIR
  cuda           | CUDA C++
  analysis       | Analysis
  python         | Python
  racket         | Racket
  ruby           | Ruby
  typescript     | TypeScript Native
  d              | D
  ada            | Ada
  cpp_for_opencl | C++ for OpenCL
  openclc        | OpenCL C
  llvm           | LLVM IR
  cpp2_cppfront  | Cpp2-cppfront
  rust           | Rust
  ispc           | ispc
  java           | Java
  kotlin         | Kotlin
  nim            | Nim
  pony           | Pony
  scala          | Scala
  solidity       | Solidity
  clean          | Clean
  pascal         | Pascal
  haskell        | Haskell
  ocaml          | OCaml
  swift          | Swift
  zig            | Zig
  $
mattgodbolt··on Compiler Explorer
Hi Genbox, thanks for the kind words. I've never heard of sharplab.io - the speed of C# compilation is not very high on the priorities of CE right now (though we have some issues filed, and some (stale) PRs to help). We welcome help improving it!

If you're talking about the speed of other languages than C#, then most of the time is in the compilers itself, not the fairly limited pre- and post-processing we do. We have a pretty sophisticated setup (at least, I think it is...) for handling the 1,500 compiler/language combinations, hundreds of libraries etc (around 2TB of data), but there's always tradeoffs between fast start-up time, manageability and simplicity of adding new compilers, and the run-time performance of running the compilers etc.

mattgodbolt··on Compiler Explorer
For which we thank you very much for your help!!
mattgodbolt··on Compiler Explorer
Right...we turn up here every few months. Always grateful for the PR, of course :)
mattgodbolt··on Compiler Explorer
Wow - we're on Hacker News again! Hello all, and thanks for the link and discussion! While we're here, we recently made some stats public: https://stats.compiler-explorer.com/ (spot the Hacker News spike!)

General stuff: we're always looking for help; everything's open source on GH: https://github.com/compiler-explorer/ (the base project, our cloud setup, all our build scripts, etc). The most valuable way to help us is with issues and PRs, or hang out on our Discord (https://discord.gg/zNNgyRKh). Then spread the word, and last we welcome sponsors on GH (https://github.com/sponsors/mattgodbolt) or Patreon (https://www.patreon.com/mattgodbolt).

mattgodbolt··on Compiler Explorer
It only works for languages, not compilers. _almost_ everything *.godbolt.org resolves to Compiler Explorer (I have some other projects at this domain), but *.compiler-explorer.com and *.godbo.lt always point at CE.
mattgodbolt··on Compiler Explorer
It still surprises me too! I need to change my name to Matt Compiler-Explorer :D
mattgodbolt··on Compiler Explorer
I go to some pain in my talks to say "instruction count is not a good proxy for performance", but unfortunately folks do still use it. It's handy to say "hey, there's no loop in this output" or "this loop does 3 multiplies; the alternative does two and an add" or similar. It's a mixed blessing to have brought the compiler output to the masses, I can only hope it starts a useful learning process!
mattgodbolt··on Cppfront, Herb Sutter's proposal for a new C++ syntax
Due to a last minute change (and a rarity, we really try hard not to do this), the URL for cppfront changed: https://godbolt.org/z/jEqEqWsbW works now (as does manually selecting cpp2-cppfront as a language)
mattgodbolt··on Happy 10th Birthday Compiler Explorer
Oh my gosh. Thanks for all the lovely comments! I'll definitely be saving these up for any dark moments! Thanks all!
mattgodbolt··on BBC Basic Editor
...and it should now be fixed!
mattgodbolt··on BBC Basic Editor
thanks z2,

thz2

mattgodbolt··on BBC Basic Editor
That's definitely the hope. The Examples tab is supposed to be more of that, currently we hacked it to point at the more complex demos, but we have some ideas on making more "tutorial" like content.
mattgodbolt··on BBC Basic Editor
Thanks! I'll note the leading spaces bug!
mattgodbolt··on BBC Basic Editor
So, one of the authors here: we just announced this site on https://twitter.com/bbcmicrobot/status/1333496146400985088 after being caught a little off-guard with this HN post! We still have a bunch of things to improve on, so please let us know and file issues (https://github.com/mattgodbolt/owlet-editor/issues) and we'll try and improve things!

Thanks!

mattgodbolt··on BBC Basic Editor
It's for the BBC Micro. Which really _is_ named after the British Broadcasting Corporation. https://en.wikipedia.org/wiki/BBC_Micro
mattgodbolt··on BBC Basic Editor
Not on this site, but click the "jsbeeb" button underneath the emulator to open the code on a full emulator.
mattgodbolt··on BBC Basic Editor
We are still working on it! :) It was a placeholder, we just replaced with something else, but the hope is to have some great resources for folks learning BASIC, as well as some impressive demos.
mattgodbolt··on Compiler Explorer
> By the way, what I think could make this tool more useful for the average user is if the assembly were decompiled into another language (like C).

It's somewhere in the ideas list... https://github.com/compiler-explorer/compiler-explorer/issue...

Something similar is Andreas Fertig's awesome https://cppinsights.io/

mattgodbolt··on Compiler Explorer
There's a language dropdown on any editor window at the top right. You'll see we support quite a number of languages!

We also have a REST API:

$ curl -s https://godbolt.org/api/languages Id | Name go | Go c | C fortran | Fortran c++ | C++ cppx | Cppx assembly | Assembly cuda | CUDA python | Python llvm | LLVM IR d | D ispc | ispc analysis | Analysis nim | Nim rust | Rust clean | Clean pascal | Pascal haskell | Haskell ada | Ada ocaml | OCaml swift | Swift zig | Zig⏎

mattgodbolt··on Compiler Explorer
for fun it's also on godbo.lt
mattgodbolt··on Compiler Explorer
It's on https://compiler-explorer.com/ too. But it's too long to type, and so many weblinks point at godbolt.org that I've long since accepted that while its name is definitely "Compiler Explorer", folks will call it "godbolt" and type that into their browser. It's shorter and frankly when life gifts you a surname like mine, why not accept it? :)
mattgodbolt··on Compiler Explorer
Exactly :) Also even if it could, it would be the `/etc/shadow` of the docker container things run in :)
mattgodbolt··on How MOS 6502 Illegal Opcodes Work (2008)
Barely an hour goes without me looking at a disassembler output, usually while debugging something (using gdb), or else checking what the compiler has done to my code (often on Compiler Explorer)
← PreviousPage 2 of 5Next →