Questions tagged [code-translation]

For questions regarding the translation of code from one programming language to another. NOTE that asking to have your code translated is not suitable for Stack Overflow.

Translating code from one programming language to another can be as tricky as translating between natural languages. This is due to the fact that languages implement different sets of features and are often designed with very different goals. What comes as a built-in function in one language may have to be developed from scratch (or at least require a library) to achieve the same functionality in another.

An appropriately formed question might be "How do I translate this statement", or "What are the differences between these two statements in different languages". It is not appropriate to ask for your code to be translated.

388 questions
112
votes
1 answer

Android equivalent of NSUserDefaults in iOS

I'd like to save some simple data. On the iPhone, I can do it with NSUserDefaults in Objective-C. What is the similar command here in Android? I'm just saving a few variables, to be reused as long as the application is installed. I don't want to use…
christian Muller
  • 5,016
  • 6
  • 34
  • 44
94
votes
14 answers

Is there an effective tool to convert C# code to Java code?

Is there an effective tool to convert C# code to Java code?
joshjdevl
66
votes
14 answers

Programming languages that compile into C/C++ source?

I'm using CoffeeScript to make JavaScript development easier. It's a language with clean syntax that compiles into JavaScript. So, what are the established programming languages that compile into C/C++ source code, to simplify syntax and/or enhance…
Jeff
  • 14,365
  • 8
  • 30
  • 30
64
votes
4 answers

Tool to convert java to c# code

What is the best tool out there at the moment to convert java to c#? Apart from j2ctranslator j# I use IKVM at the moment.
sean
  • 11,164
  • 8
  • 48
  • 56
59
votes
10 answers

Does a Java to C++ converter/tool exist?

I always asked myself if it would be possible to make a Java to C++ converter. Maybe a tool that converts the Java syntax to the C++ syntax? I am aware that the languages differ, but simple things like loops where the semantics match 1 to 1. Is…
n00ki3
  • 14,529
  • 18
  • 56
  • 65
58
votes
6 answers

What is the most production-level Haskell to JavaScript compiler, to write code running in the browser?

I am not looking for a necessarily super-robust solution with a 10-year track record, but for something that can be used in a real applications, and goes beyond just being able to run an Hello World example. My preference is to run the compiler on…
avernet
  • 30,895
  • 44
  • 126
  • 163
53
votes
6 answers

How to convert C++ Code to C

I have some C++ code. In the code there are many classes defined, their member functions, constructors, destructors for those classes, few template classes and lots of C++ stuff. Now I need to convert the source to plain C code. I the have…
goldenmean
  • 18,376
  • 54
  • 154
  • 211
53
votes
8 answers

How to Cross-Compile Java Source Code to JavaScript?

Given a set of Java source code files, how can I compile them into one or more JavaScript files that can be used with hand-crafted JavaScript? GWT is one option, but every example I've seen so far is aimed at building fancy websites. The simple use…
Rich Apodaca
  • 28,316
  • 16
  • 103
  • 129
52
votes
4 answers

Conversion from JavaScript to Python code?

Is there a relatively quick program out there to accomplish at least the basics of this? Just a few regexes? I'm willing to do some manual conversion, but this is a pretty big set of scripts.
user282583
46
votes
1 answer

How to handle Translation in twig file using variables?

I have a twig file and a yml, in which I define the variables for translation e.g.: YML File - variable.for.translation: Disponible, para tí Content of Twig File -

"Hola, Follow {{ variableName }} en Twitter

I wanted to make a…
Arpit Rawat
  • 1,817
  • 2
  • 20
  • 28
34
votes
4 answers

Automated Python to Java translation

Is there a tool out there that can automatically convert Python to Java? Can Jython do this?
Victor Noagbodji
  • 553
  • 1
  • 5
  • 7
32
votes
8 answers

Is there a way to convert Groovy to Java automatically?

I have inherited significant amounts of Groovy code, and I have found it difficult to maintain for several reasons: Very often it's hard to tell what's the type of a variable. Corollary: it's easy to modify a variable with a different type, and…
luiscolorado
  • 1,525
  • 2
  • 16
  • 23
27
votes
4 answers

Java code transform at compile time

I would like to transform java source code at compile time just before passing the source code to the compiler. In other word I would like to create a preprocessor able to transform "bla bla bla" into any other code such as: new MyClass("bla", 3)…
Martin Pernollet
  • 2,285
  • 1
  • 28
  • 39
26
votes
3 answers

Is there a converter of Javascript to Dart?

Is there an automatic converter of javascript code to Dart? Or is it too soon?
ripper234
  • 222,824
  • 274
  • 634
  • 905
25
votes
4 answers

Python on Rails?

Would it be possible to translate the Ruby on Rails code base to Python? I think many people like Python more than Ruby, but find Ruby on Rails features better (as a whole) than the ones in Python web frameworks. So that, would it be possible? Or…
Juanjo Conti
  • 28,823
  • 42
  • 111
  • 133
1
2 3
25 26