Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

196
Visualizações
How would a site, like w3schools, run many languages locally?

I'm working on a portfolio website, and I thought it would be cool to be able to run my scripts in python, java, js, rust, etc locally in the browser Here's an example of this from w3schools

I'm guessing they have a translation layer to javascript, but in the event that they're actually running C++ here, does anyone know how this might be done or generalized?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

They do not translate those languages to JavaScript and then run it on the client - that would be a herculean task to get right, especially for multiple languages. Rather, they (and the many similar sites like try it online) take the source code text from the client's browser, and run it on the server, and respond to the client with the result from the server.

To achieve something like this, you'd need

  • A backend (in any language)
  • Compilers/interpreters/etc for all languages you want to support
  • A way for the backend to programatically call them with the user's input (which is often pretty easy)

For proof that w3schools takes the result from a server, rather than running it locally, examine the network tab of your browser, and you'll see it:

enter image description here

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda