[Question]
  [
Write the shortest program that takes one input (n) from STDIN (or equivalent) and outputs a simple incrementing function with one argument (x) that returns x + n but the function must be in a different language. Pretty simple!
**This is code-golf, normal rules apply, shortest program wins.**
Example: ><> to Python (Ungolfed)
```
!v"def i(x):"a"    return x+"ir!
 >l?!;o
```
Input:
```
3
```
Output:
```
def i(x):
    return x+3
```
EDIT: Anonymous functions and lambda expressions are allowed!
  
[Answer]
# [GS2](https://github.com/nooodl/gs2) → K, 2 bytes
```
•+
```
This prints a tacit, monadic function. The source code uses the [CP437](https://en.wikipedia.org/w/index.php?title=Code_page_437&oldid=565442465#Characters) encoding. [Try it online!](http://gs2.tryitonline.net/#code=4oCiKw&input=NDI)
## Test run
```
$ xxd -c 2 -g 1 sum-func.gs2
00000000: 07 2b  .+
$ printf 42 | gs2 sum-func.gs2
42+
$ kona
K Console - Enter \ for help
  (42+) 69
111
  f : 42+
42+
  f 69
111
```
## How it works
### GS2
* GS2 automatically reads from STDIN and pushes the input on the stack.
* `•` indicates that the next byte is a singleton string literal.
* Before exiting, GS2 prints all stack items.
### K
Left argument currying is automatic in K.
Here, `n+` turns the dyadic function `+` into a monadic function by setting its left argument to `n`.
[Answer]
# [ShapeScript](https://github.com/DennisMitchell/ShapeScript) → J, 4 bytes
```
"&+"
```
This prints a tacit, monadic verb. Try it online: [ShapeScript](http://shapescript.tryitonline.net/#code=IiYrIg==&input=NDI=), [J](https://a296a8f7c5110b2ece73921ddc2abbaaa3c90d10.googledrive.com/host/0B3cbLoy-_9Dbb0NaSk9MRGE5UEU/index.html#code=42%26%2B%2069)
## Test run
```
$ cat sum-func.shape; echo
"&+"
$ printf 42 | shapescript sum-func.shape; echo
42&+
$ j64-804/jconsole.sh 
   42&+ 69
111
   f =: 42&+
   f 69
111
```
## How it works
### ShapeScript
* ShapeScript automatically reads from STDIN and pushes the input on the stack.
* `"&+"` pushes that string on the stack.
* Before exiting, ShapeScript prints all stack items.
### J
`&` performs argument currying.
Here, `n&+` turns the dyadic verb `+` into a monadic verb by setting its left argument to `n`.
[Answer]
# GolfScript → CJam, 4 bytes
```
{+}+
```
This prints a code block (anonymous function). Try it online: [GolfScript](http://golfscript.apphb.com/?c=IjQyIiAjIFNpbXVsYXRlIGlucHV0IGZyb20gU1RESU4uCgp7K30r), [CJam](http://cjam.aditsu.net/#code=69%20%7B42%20%2B%7D%20~&input=42)
## Test run
```
$ cat sum-func.gs; echo
{+}+
$ printf 42 | golfscript sum-func.gs
{42 +}
$ cjam
> 69 {42 +} ~
111
> {42 +}:F; 69F    
111
```
## How it works
### GolfScript
* GolfScript automatically reads from STDIN and pushes the input on the stack.
* `{+}` pushes that block on the stack.
* `+` performs concatenation, which happily concatenates a string and a block.
* Before exiting, GolfScript prints all stack items.
### CJam
`{n +}` is a code block that, when executed, first pushes `n` on the stack, then executes `+`, which pops two integers from the stack and pushes their sum.
[Answer]
# BrainF\*\*\* to JavaScript ES6, 57 bytes
```
----[-->+++<]>--.[-->+<]>+.+.--[->++<]>.[--->+<]>+++.[,.]
```
(Assumes that the input is composed of numeric characters)
Say `1337` is your input. Then, this would compile to:
```
x=>x+1337
```
[Answer]
# R to Julia, 19 bytes
```
cat("x->x+",scan())
```
This reads an integer from STDIN using `scan()` and writes an unnamed Julia function to STDOUT using `cat()`. The Julia function is simply `x->x+n`, where `n` comes from the R program.
[Answer]
# Rotor to K, 2 bytes
```
'+
```
Might as well jump in on the K bandwagon.
[Answer]
# [Malbolge](http://zb3.github.io/malbolge-tools/#interpreter) to JavaScript ES6, 71 bytes
```
('&%@9]!~}43Wyxwvutsr)Mon+HGi4~fBBdR->=_]:[875t4rT}0/Pf,d*((II%GEE!Y}Az
```
It's always fun to generate Malbolge code.
[Answer]
# Minecraft 1.8.7 to K, ~~7~~ 6 + 33 + 27 + 62 = ~~129~~ 128 Bytes
This is using [this version of byte counting](http://meta.codegolf.stackexchange.com/a/7397/44713).
[![the system](https://i.stack.imgur.com/Y7fFE.png)](https://i.stack.imgur.com/Y7fFE.png)
Command blocks (going from left to right):
```
scoreboard objectives add K dummy
```
```
scoreboard players set J K <input>
```
```
tellraw @a {score:{name:"J",objective:"K"},extra:[{text:"+"}]}
```
This could probably be golfed a little more, but it's fairly simple: generate a variable `J` with the objective `K` and set its score for that objective to the input (there is no STDIN - I figured this was close enough). Then, after a tick, output the score of the variable `J` for the objective `K` followed by a `+`. Easy peasy.
[Answer]
# [O](https://github.com/phase/o) to K, 5 bytes
```
i'++o
```
Thanks to **[@kirbyfan64sos](https://codegolf.stackexchange.com/users/21009/kirbyfan64sos)**
Another version using features added after the challenge was created.
```
i'+
```
* Gets input, pushes to stack
* Pushes '+' as a string
* Outputs stack contents
[Answer]
## [Seriously](https://github.com/Mego/Seriously) to Python, 15 bytes
`,"lambda n:n+"+`
Expects input to be in string form, i.e. `"3"`
Explanation:
```
,: read value from input
"lambda n:n+": push this literal string
+: concatenate top two values on stack
```
[Try it online](http://seriouslylang.herokuapp.com/link/code=2c226c616d626461206e3a6e2b222b&input=%223%22) (you will have to manually enter the input because the permalinks don't like quotes)
[Answer]
# Pyth to APL, ~~7~~ 5 bytes
```
+z"--
```
The Pyth code simply concatenates the input (`z`) with the string `"--"`. This creates an unnamed monadic train in APL with the form `n--`, where `n` comes from Pyth. When calling it in APL, `(n--)x` for some argument `x` computes `n--x = n-(-x) = n+x`.
Try: [Pyth](https://pyth.herokuapp.com/?code=%2Bz%22--&input=3&debug=0), [APL](http://tryapl.org/?a=f%u21903--%u22C4f%202&run)
Saved 2 bytes thanks to Dennis!
[Answer]
# rs -> K, 2 bytes
```
/+
```
[Live demo.](http://kirbyfan64.github.io/rs/index.html?script=%2F%2B&input=2)
[Answer]
## [><>](https://esolangs.org/wiki/Fish) to Python, 25 + 3 = 28 bytes
```
"v+x:x adbmal
o/?(3l
;>~n
```
Takes input via the `-v` flag, e.g.
```
py -3 fish.py add.fish -v 27
```
and outputs a Python lambda, e.g. `lambda x:x+27`.
For a bonus, here's an STDIN input version for 30 bytes:
```
i:0(?v
x+"r~/"lambda x:
o;!?l<
```
[Answer]
# [Mouse](http://en.wikipedia.org/wiki/Mouse_(programming_language)) to Ruby, 19 bytes
```
?N:"->x{x+"N.!"}"$
```
Ungolfed:
```
? N:       ~ Read an integer from STDIN, store in N
"->x{x+"   ~ Write that string to STOUT
N. !       ~ Write N
"}"$       ~ Close bracket, end of program
```
This creates an unnamed Ruby function of the form `->x{x+n}` where `n` comes from Mouse.
[Answer]
# Haskell to Mathematica, 14 bytes
```
(++"+#&").show
```
[Answer]
# Mathematica to C#, 22 bytes
```
"x=>x+"<>InputString[]
```
Outputs a C# `Func<int, int>` of form
```
x=>x+n
```
[Answer]
# Pyth -> K, 4 bytes
```
+z\+
```
K is really easy to abuse here...
[Live demo.](https://pyth.herokuapp.com/?code=%2Bz%5C%2B&input=2&debug=0)
[Answer]
# Brainfuck to Java, 273
```
+[----->+++++.+++++.++++++.[---->++++.+[->++++.-[->+++-.-----[->+++.+++++.++++++.[---->++++.-[--->++-.[----->++-.[->+++.---------.-------------.[--->+---.+.---.----.-[->+++++-.-[--->++-.[----->+++.,[.,]+[--------->+++.-[--->+++.
```
Outputs a method like `int d(int i){return i+42;}` (which doesn't *look* like a Java method, but... Java!)
[Answer]
# POSIX shell to Haskell, 19 bytes
```
read n;echo "($n+)"
```
Anonymous functions being allowed, Haskell is a good output choice with the operator sections.
[Answer]
# PHP → JavaScript (ES6), 20 ~~24~~ bytes
Reading from *STDIN* is always expensive in PHP. It looks a bit strange:
```
x=>x+<?fgets(STDIN);
```
It prints `x=>x+` and waits for user input to complete the string, terminates with the complete anonymous JavaScript function, e.g. `x=>x+2`.
**First version (24 bytes**)
```
<?='x=>x+'.fgets(STDIN);
```
[Answer]
# [Retina](https://github.com/mbuettner/retina) to [Pip](https://github.com/dloscutoff/pip), 4 bytes
Uses one file for each of these lines + 1 penalty byte; or, put both lines in a single file and use the `-s` flag.
```
$
+_
```
Matches the end of the input with `$` and puts `+_` there. This results in something of the form `3+_`, which is an anonymous function in Pip.
[Answer]
# Bash → C/C++/C#/Java, 33 bytes
and maybe others
```
echo "int f(int a){return a+$1;}"
```
[Answer]
## [Tiny Lisp](https://codegolf.stackexchange.com/q/62886/2338) to [Ceylon](http://ceylon-lang.org/), ~~68~~ 61
```
(d u(q((n)(c(q(Integer x))(c(q =>)(c(c(q x+)(c n()))()))))))
```
Tiny Lisp doesn't have real input and output – it just has expression evaluation.
This code above creates a function and binds it to `u`.
You can then call `u` with the argument `n` like this: `(u 7)`, which will evaluate to this Tiny Lisp value:
```
((Integer x) => (x+ 7))
```
This is a valid Ceylon expression, for an anonymous function which adds 7 to an arbitrary integer.
*Thanks to DLosc for an improvement of 7 bytes.*
[Answer]
# JavaScript to [Lambda Calculus](http://www.ics.uci.edu/~lopes/teaching/inf212W12/readings/lambda-calculus-handout2.pdf), 39 bytes
(This uses the linked document as a basis.)
```
alert((x=>`λa(${x}(add a))`)(prompt()))
```
Say input is `5`. Then this becomes:
```
"λa(5(add a))"
```
[Answer]
# Python 2 to CJam, ~~18~~ 20 bytes
*Thanks to LegionMammal978 for correcting the functionality.*
```
print"{%f+}"%input()
```
The Python does a basic string format. `%f` is the code for a float, and since I wouldn't lose any bytes for handling floats, I went ahead and did so.
The CJam is much the same as the Golfscript->CJam answer. It looks something like this:
```
{7.4+}
```
or:
```
{23+}
```
It's a block that takes the top value off the stack, pushes the special number, then adds them.
[Answer]
# [Microscript II](http://esolangs.org/wiki/Microscript_II) to Javascript ES6, 9 bytes
```
"x=>x+"pF
```
[Answer]
# GNU sed to C, 46 bytes
```
sed -r 's/^([0-9]+)$/f(int x){return x+\1;}/'
```
[Answer]
# Vitsy to K, 5 Bytes
\o/ K will be being used very soon if it can do this.
```
N'+'Z
```
or maybe...
```
N'+'O
```
If the input is taken as a string (only for 0-9 input)...
```
i'+'Z
```
All of these, for input 2, will output:
```
2+
```
[Answer]
## [Ceylon](http://ceylon-lang.org/) to [Tiny lisp](https://codegolf.stackexchange.com/q/62886/2338), 76
```
shared void run(){print("(q((x)(s ``process.readLine()else""``(s 0 x))))");}
```
This produces (after reading a line of input) output like `(q((x)(s 5(s 0 x))))`, which evaluates in Tiny Lisp to `((x) (s 5 (s 0 x)))`, a function which takes an argument `x`, subtracts it from 0, and subtracts the result from 5. (Yeah, this is how one adds in Tiny Lisp, there is only a subtraction function build in. Of course, one could define an addition function first, but this would be longer.)
You can use it like this as an anonymous function:
```
((q((x)(s 5(s 0 x)))) 7)
```
(This will evaluate to 12.)
Or you can give it a name:
```
(d p5 (q((x)(s 5(s 0 x)))))
(p5 7)
```
*Corrections and Golfing Hints from DLosc, the author of Tiny Lisp.*
[Answer]
# [Japt](https://github.com/ETHproductions/Japt) → [TeaScript](https://github.com/vihanb/TeaScript), 5 bytes
```
U+"+x
```
This is pretty simple.
---
### Explanation
```
U+     // Input added to the string...
  "+x  // This is the string
```
]