Answers.Body: <p>ChatGPT, which is based on the transformer, can already do this to some extent, so yes to your question, but I also doubt it will always be effective.</p>
  <p>OpenAI also used to provide Codex (which is or was being used in <a href="https://github.com/features/copilot" rel="nofollow noreferrer">Github's copilot</a>), but <a href="https://help.openai.com/en/articles/7438137-code-completion-deprecated" rel="nofollow noreferrer">recently OpenAI deprecated it in favour of models behind ChatGPT</a>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-06-14T11:40:36.083Z
Answers.LastActivityDate: 2023-06-14T11:40:36.083Z
Answers.UserDisplayName: nbro
Body: <p>There was a <a href="https://ai.stackexchange.com/questions/17140/can-sequence-to-sequence-models-be-used-to-convert-source-code-from-one-programm">question</a> like this in 2019. I hope things have changed since then.</p>
  <p>Concretely, I am looking for a way to train a transformer model to convert code from SAS to Python. I guess the method does not depend on the pair of programming languages requested as long as one has enough data for training.</p>
  <p>There are paid tools, e.g. <a href="https://www.codeconvert.ai/" rel="nofollow noreferrer">CodeConert</a> and <a href="https://sas2py.com/solutions.html" rel="nofollow noreferrer">sas2py</a>, that do this, but I can not find out what the are based on and how they were built.</p>
  <p>It appears that one (very bad) way could be to use interpreters that translate one programming language, e.g. Java, to English and then from English to the second programming language, e.g. Python. This must be very prone to mistakes and seems like a wrong approach.</p>
  
Tags: <python><transformer><open-ai>
Title: Can transformer models be used to convert code from one programming language to another?
UserDisplayName: Vladimir
ThreadText: # Can transformer models be used to convert code from one programming language to another?
  
  (Asked by: username_0 on 2023-06-10)
  
  There was a [question](https://ai.stackexchange.com/questions/17140/can-sequence-to-sequence-models-be-used-to-convert-source-code-from-one-programm) like this in 2019. I hope things have changed since then.
  
  Concretely, I am looking for a way to train a transformer model to convert code from SAS to Python. I guess the method does not depend on the pair of programming languages requested as long as one has enough data for training.
  
  There are paid tools, e.g. [CodeConert](https://www.codeconvert.ai/) and [sas2py](https://sas2py.com/solutions.html), that do this, but I can not find out what the are based on and how they were built.
  
  It appears that one (very bad) way could be to use interpreters that translate one programming language, e.g. Java, to English and then from English to the second programming language, e.g. Python. This must be very prone to mistakes and seems like a wrong approach.
  
  **Tags:** python, transformer, open-ai
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2023-06-14. Score: 1
  
  ChatGPT, which is based on the transformer, can already do this to some extent, so yes to your question, but I also doubt it will always be effective.
  
  OpenAI also used to provide Codex (which is or was being used in [Github's copilot](https://github.com/features/copilot)), but [recently OpenAI deprecated it in favour of models behind ChatGPT](https://help.openai.com/en/articles/7438137-code-completion-deprecated).
  
  
  ---
  
  