Skip to main content
Commonmark migration
Source Link

#JavaScript/Haskell, 158 bytes 147 bytes

JavaScript/Haskell, 158 bytes 147 bytes

General idea: sneak each one's comment syntax into the other.

In one line:

u="This program wasn't written in ";v=", it was built for ";j="JavaScript";h="Haskell";{-console.log(u+j+v+h+"!")}//-}main=putStrLn$u++h++v++j++"!" 

What this looks like to Haskell:

-- some variable definitions u = "This program wasn't written in " v = ", it was built for " j = "JavaScript" h = "Haskell" -- a comment {-console.log(u+j+v+h+"!")}//-} -- the main method that does the dirty deed main = putStrLn $ u ++ h ++ v ++ j ++ "!" 

What this looks like to JavaScript:

/* variables can be declared without `var` */ u = "This program wasn't written in "; v = ", it was built for "; j = "JavaScript"; h = "Haskell"; /* hey look, an anonymous block! */ { /* we negate the `undefined` that comes out of console.log */ -console.log(u+j+v+h+"!") } /* there are two automatic semicolon insertions here: one before `}` and one before EOF. */ /* a one-line comment. */ //-}main=putStrLn$u++h++v++j++"!" 

#JavaScript/Haskell, 158 bytes 147 bytes

General idea: sneak each one's comment syntax into the other.

In one line:

u="This program wasn't written in ";v=", it was built for ";j="JavaScript";h="Haskell";{-console.log(u+j+v+h+"!")}//-}main=putStrLn$u++h++v++j++"!" 

What this looks like to Haskell:

-- some variable definitions u = "This program wasn't written in " v = ", it was built for " j = "JavaScript" h = "Haskell" -- a comment {-console.log(u+j+v+h+"!")}//-} -- the main method that does the dirty deed main = putStrLn $ u ++ h ++ v ++ j ++ "!" 

What this looks like to JavaScript:

/* variables can be declared without `var` */ u = "This program wasn't written in "; v = ", it was built for "; j = "JavaScript"; h = "Haskell"; /* hey look, an anonymous block! */ { /* we negate the `undefined` that comes out of console.log */ -console.log(u+j+v+h+"!") } /* there are two automatic semicolon insertions here: one before `}` and one before EOF. */ /* a one-line comment. */ //-}main=putStrLn$u++h++v++j++"!" 

JavaScript/Haskell, 158 bytes 147 bytes

General idea: sneak each one's comment syntax into the other.

In one line:

u="This program wasn't written in ";v=", it was built for ";j="JavaScript";h="Haskell";{-console.log(u+j+v+h+"!")}//-}main=putStrLn$u++h++v++j++"!" 

What this looks like to Haskell:

-- some variable definitions u = "This program wasn't written in " v = ", it was built for " j = "JavaScript" h = "Haskell" -- a comment {-console.log(u+j+v+h+"!")}//-} -- the main method that does the dirty deed main = putStrLn $ u ++ h ++ v ++ j ++ "!" 

What this looks like to JavaScript:

/* variables can be declared without `var` */ u = "This program wasn't written in "; v = ", it was built for "; j = "JavaScript"; h = "Haskell"; /* hey look, an anonymous block! */ { /* we negate the `undefined` that comes out of console.log */ -console.log(u+j+v+h+"!") } /* there are two automatic semicolon insertions here: one before `}` and one before EOF. */ /* a one-line comment. */ //-}main=putStrLn$u++h++v++j++"!" 
one more try at syntax highlighting
Source Link
CR Drost
  • 1k
  • 6
  • 10

#JavaScript/Haskell, 158158 bytes 147 bytes

General idea: sneak each one's comment syntax into the other.

In one line:

u="This program wasn't written in ";v=", it was built for ";j="JavaScript";h="Haskell";w="!";u/*v=0;";j="JavaScript";h="Haskell";{-*/;consoleconsole.log(u+j+v+h+wu+j+v+h+"!")}//-}main=putStrLn$u++h++v++j++wmain=putStrLn$u++h++v++j++"!" 

What this looks like to Haskell:

-- some variable definitions u = "This program wasn't written in " v = ", it was built for " j = "JavaScript" h = "Haskell" w = "!" -- a pointless definition of the /* operator u /* v = 0 -- the main method that does the dirty deed main = putStrLn $ u ++ h ++ v ++ j ++ w 
-- some variable definitions u = "This program wasn't written in " v = ", it was built for " j = "JavaScript" h = "Haskell" -- a comment {-console.log(u+j+v+h+"!")}//-} -- the main method that does the dirty deed main = putStrLn $ u ++ h ++ v ++ j ++ "!" 

What this looks like to JavaScript:

// variables can be declared without `var` u = "This program wasn't written in "; v = ", it was built for "; j = "JavaScript"; h = "Haskell"; w = "!"; // u is in-scope, so this is a valid statement that does nothing, // needed because we need something before the /* unless we write (/*) = ... // in Haskell somehow. u; // we do the dirty deed; the trailing semicolon is not needed. console.log(u+j+v+h+w) 
/* variables can be declared without `var` */ u = "This program wasn't written in "; v = ", it was built for "; j = "JavaScript"; h = "Haskell"; /* hey look, an anonymous block! */ { /* we negate the `undefined` that comes out of console.log */ -console.log(u+j+v+h+"!") } /* there are two automatic semicolon insertions here: one before `}` and one before EOF. */ /* a one-line comment. */ //-}main=putStrLn$u++h++v++j++"!" 

#JavaScript/Haskell, 158 bytes

In one line:

u="This program wasn't written in ";v=", it was built for ";j="JavaScript";h="Haskell";w="!";u/*v=0;{-*/;console.log(u+j+v+h+w)//-}main=putStrLn$u++h++v++j++w 

What this looks like to Haskell:

-- some variable definitions u = "This program wasn't written in " v = ", it was built for " j = "JavaScript" h = "Haskell" w = "!" -- a pointless definition of the /* operator u /* v = 0 -- the main method that does the dirty deed main = putStrLn $ u ++ h ++ v ++ j ++ w 

What this looks like to JavaScript:

// variables can be declared without `var` u = "This program wasn't written in "; v = ", it was built for "; j = "JavaScript"; h = "Haskell"; w = "!"; // u is in-scope, so this is a valid statement that does nothing, // needed because we need something before the /* unless we write (/*) = ... // in Haskell somehow. u; // we do the dirty deed; the trailing semicolon is not needed. console.log(u+j+v+h+w) 

#JavaScript/Haskell, 158 bytes 147 bytes

General idea: sneak each one's comment syntax into the other.

In one line:

u="This program wasn't written in ";v=", it was built for ";j="JavaScript";h="Haskell";{-console.log(u+j+v+h+"!")}//-}main=putStrLn$u++h++v++j++"!" 

What this looks like to Haskell:

-- some variable definitions u = "This program wasn't written in " v = ", it was built for " j = "JavaScript" h = "Haskell" -- a comment {-console.log(u+j+v+h+"!")}//-} -- the main method that does the dirty deed main = putStrLn $ u ++ h ++ v ++ j ++ "!" 

What this looks like to JavaScript:

/* variables can be declared without `var` */ u = "This program wasn't written in "; v = ", it was built for "; j = "JavaScript"; h = "Haskell"; /* hey look, an anonymous block! */ { /* we negate the `undefined` that comes out of console.log */ -console.log(u+j+v+h+"!") } /* there are two automatic semicolon insertions here: one before `}` and one before EOF. */ /* a one-line comment. */ //-}main=putStrLn$u++h++v++j++"!" 
Source Link
CR Drost
  • 1k
  • 6
  • 10

#JavaScript/Haskell, 158 bytes

In one line:

u="This program wasn't written in ";v=", it was built for ";j="JavaScript";h="Haskell";w="!";u/*v=0;{-*/;console.log(u+j+v+h+w)//-}main=putStrLn$u++h++v++j++w 

What this looks like to Haskell:

-- some variable definitions u = "This program wasn't written in " v = ", it was built for " j = "JavaScript" h = "Haskell" w = "!" -- a pointless definition of the /* operator u /* v = 0 -- the main method that does the dirty deed main = putStrLn $ u ++ h ++ v ++ j ++ w 

What this looks like to JavaScript:

// variables can be declared without `var` u = "This program wasn't written in "; v = ", it was built for "; j = "JavaScript"; h = "Haskell"; w = "!"; // u is in-scope, so this is a valid statement that does nothing, // needed because we need something before the /* unless we write (/*) = ... // in Haskell somehow. u; // we do the dirty deed; the trailing semicolon is not needed. console.log(u+j+v+h+w)