index.html 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Language &hArr; Language Matrix</title>
  5. <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
  6. <style>
  7. td { font-size: 0.8em; }
  8. td.yay { padding: 0; background: #8f8 !important; }
  9. td.yay a { display: block; padding: 8px; font-weight: bold; background: #8f8; }
  10. td.yay a.runtime { background: #bf8; }
  11. td.yay a.sourcesource { background: #8fb; }
  12. td.na { background: #ddd !important; }
  13. td.no { text-align: center; }
  14. .desc { margin-right: 100px; font-size: 1.2em; margin-top: 16px; }
  15. .hover { background: #def; }
  16. #myideaoffun { font-size: 20px; padding: 8px 0; line-height: 1.4; height: 100px; }
  17. </style>
  18. </head>
  19. <body>
  20. <a href="https://github.com/tcr/langlangmatrix"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png" alt="Fork me on GitHub"></a>
  21. <div class="container-fluid">
  22. <h1>The Language &hArr; Language Matrix</h1>
  23. <p class="desc"><b>Languages running in other languages!</b> Source-to-source compilers, interpreters, and bytecode compilers. None of these projects are vetted/assured to be complete. <a href="https://github.com/tcr/langlangmatrix/pulls">Submit your own link or add corrections.</a> Maintained by <a href="https://github.com/tcr">Tim Cameron Ryan</a>.</p>
  24. <p id="myideaoffun"></p>
  25. <table class="table table-bordered" id="matrix">
  26. <tr class="heading first-heading">
  27. <th rowspan="15">Source</th>
  28. <th colspan="15" style="text-align: center">Target</th>
  29. </tr>
  30. <tr class="heading">
  31. <th>&nbsp;</th>
  32. <th>JavaScript<sup><a href="https://github.com/jashkenas/coffee-script/wiki/List-of-languages-that-compile-to-JS">[1]</a></sup></th>
  33. <th>C/C++</th>
  34. <th>Java</th>
  35. <th>Ruby</th>
  36. <th>PHP</th>
  37. <th>Scala</th>
  38. <th>C#</th>
  39. <th>Clojure</th>
  40. <th>Python</th>
  41. <th>Lua</th>
  42. <th>Haskell</th>
  43. <th>OCaml</th>
  44. </tr>
  45. <tr>
  46. <th>JavaScript</th>
  47. <td class="yay">
  48. <a href="http://benvie.github.com/continuum">Continuum</a>
  49. <a href="https://github.com/mozilla/narcissus">Narcissus</a>
  50. <a href="http://wthimbleby.github.io/tailspin">Tailspin</a>
  51. </td>
  52. <td class="yay"><a href="http://github.com/tcr/gum">Gum</a></td>
  53. <td class="yay">
  54. <a href="https://developer.mozilla.org/en-US/docs/Rhino" class="runtime">Rhino</a>
  55. <a href="http://dynjs.org/">dynjs</a>
  56. <a href="http://github.com/tcr/mug">Mug</a>
  57. </td>
  58. <td class="yay">
  59. <a href="http://web.archive.org/web/20100201180650/http://tenderlovemaking.com/2007/04/15/converting-javascript-to-ruby-with-rkelly/">RKelly</a>
  60. </td>
  61. <td class="yay">
  62. <a href="http://include-once.org/p/phpjs/">phpjs</a>
  63. </td>
  64. <td class="yay"><a href="https://github.com/js-scala/js-scala">js.scala</a></td>
  65. <td class="no">N/A</td> <!--Javascript via C#-->
  66. <td class="no">N/A</td> <!--Javascript via Clojure-->
  67. <td class="no">N/A</td> <!--Javascript via Python-->
  68. <td class="no">N/A</td> <!--Javascript via Lua-->
  69. <td class="no">N/A</td> <!--Javascript via Haskell-->
  70. <td class="no">N/A</td> <!--Javascript via OCaml-->
  71. </tr>
  72. <tr>
  73. <th>C/C++</th>
  74. <td class="yay"><a href="http://emscripten.org/">Emscripten</a></td>
  75. <td class="no">N/A</td> <!--C/C++ via C/C++-->
  76. <td class="no">N/A</td> <!--C/C++ via Java-->
  77. <td class="no">N/A</td> <!--C/C++ via Ruby-->
  78. <td class="no">N/A</td> <!--C/C++ via PHP-->
  79. <td class="no">N/A</td> <!--C/C++ via Scala-->
  80. <td class="no">N/A</td> <!--C/C++ via C#-->
  81. <td class="no">N/A</td> <!--C/C++ via Clojure-->
  82. <td class="no">N/A</td> <!--C/C++ via Python-->
  83. <td class="no">N/A</td> <!--C/C++ via Lua-->
  84. <td class="no">N/A</td> <!--C/C++ via Haskell-->
  85. <td class="no">N/A</td> <!--C/C++ via OCaml-->
  86. </tr>
  87. <tr>
  88. <th>Java</th>
  89. <td class="yay">
  90. <a href="http://int3.github.io/doppio/about.html">Doppio</a>
  91. <a href="http://code.google.com/webtoolkit/">Google Web Toolkit (GWT)</a>
  92. <a href="http://j2s.sourceforge.net/">Java2Script</a>
  93. <a href="http://www.j2js.com/">j2js</a>
  94. <a href="http://st-js.sourceforge.net/">Strongly-Typed JavaScript (STJS)</a>
  95. </td>
  96. <td class="yay">
  97. <a href="http://code.google.com/p/cibyl/">Cibyl (J2ME)</a>
  98. <a href="http://nestedvm.ibex.org/">NestedVM</a>
  99. </td>
  100. <td class="yay">
  101. <a href="http://www.beanshell.org/home.html">beanshell</a>
  102. </td>
  103. <td class="no">N/A</td> <!--Java via Ruby-->
  104. <td class="no">N/A</td> <!--Java via PHP-->
  105. <td class="no">N/A</td> <!--Java via Scala-->
  106. <td class="no">N/A</td> <!--Java via C#-->
  107. <td class="no">N/A</td> <!--Java via Clojure-->
  108. <td class="yay">
  109. <a href="http://jpype.sourceforge.net/">JPype</a>
  110. <a href="http://py4j.sourceforge.net/">Py4J</a>
  111. </td>
  112. <td class="no">N/A</td> <!--Java via Lua-->
  113. <td class="no">N/A</td> <!--Java via Haskell-->
  114. <td class="no">N/A</td> <!--Java via OCaml-->
  115. </tr>
  116. <tr>
  117. <th>Ruby</th>
  118. <td class="yay">
  119. <a href="http://opalrb.org">Opal</a>
  120. <a href="http://hotruby.yukoba.jp/">HotRuby</a>
  121. <a href="https://github.com/whitequark/coldruby">ColdRuby</a>
  122. <a href="http://rb2js.rubyforge.org/">rb2js</a>
  123. <a href="https://github.com/jessesielaff/red">Red</a>
  124. <a href="https://github.com/mattknox/8ball">8ball</a>
  125. </td>
  126. <td class="yay"><a href="http://rubyforge.org/projects/ruby2c/">ruby2c</a></td>
  127. <td class="yay">
  128. <a href="http://www.jruby.org" class="runtime">JRuby</a>
  129. <a href="https://github.com/headius/rubyflux">RubyFlux</a>
  130. </td> <!--Ruby via Java-->
  131. <td class="yay">
  132. <a href="http://rubini.us/">Rubinius</a>
  133. </td> <!--Ruby via Ruby-->
  134. <td class="yay"><a href="http://php.rubyforge.org/">PHP.rb</a></td>
  135. <td class="no">N/A</td> <!--Ruby via Scala-->
  136. <td class="yay">
  137. <a href="http://ironruby.net/">IronRuby</a>
  138. </td> <!--Ruby via C#-->
  139. <td class="no">N/A</td> <!--Ruby via Clojure-->
  140. <td class="yay">
  141. <a href="https://github.com/whymirror/unholy.git">UNHOLY</a>
  142. </td>
  143. <td class="no">N/A</td> <!--Ruby via Lua-->
  144. <td class="no">N/A</td> <!--Ruby via Haskell-->
  145. <td class="no">N/A</td> <!--Ruby via OCaml-->
  146. </tr>
  147. <tr>
  148. <th>PHP</th>
  149. <td class="yay">
  150. <a href="http://phpjs.hertzen.com/">php.js</a>
  151. </td>
  152. <td class="yay">
  153. <a href="https://github.com/facebook/hiphop-php">HipHop Compiler</a>
  154. </td>
  155. <td class="yay"><a href="http://www.caucho.com/resin-3.1/doc/quercus.xtp">Quercus</a></td>
  156. <td class="no">N/A</td> <!--PHP via Ruby-->
  157. <td class="yay"><a href="https://github.com/ircmaxell/PHPPHP">PHPPHP</a></td>
  158. <td class="no">N/A</td> <!--PHP via Scala-->
  159. <td class="no">N/A</td> <!--PHP via C#-->
  160. <td class="no">N/A</td> <!--PHP via Clojure-->
  161. <td class="yay"><a href="http://code.google.com/p/phppython/">phppython</a></td>
  162. <td class="no">N/A</td> <!--PHP via Lua-->
  163. <td class="no">N/A</td> <!--PHP via Haskell-->
  164. <td class="no">N/A</td> <!--PHP via OCaml-->
  165. </tr>
  166. <tr>
  167. <th>Scala</th>
  168. <td class="yay">
  169. <a href="http://scalagwt.github.com/">Scala+GWT</a>
  170. <a href="http://www.scala-js.org/">Scala.js</a>
  171. <a href="http://jscala.org/">JScala</a>
  172. </td>
  173. <td class="no">N/A</td> <!--Scala via C/C++-->
  174. <td class="no">N/A</td> <!--Scala via Java-->
  175. <td class="no">N/A</td> <!--Scala via Ruby-->
  176. <td class="no">N/A</td> <!--Scala via PHP-->
  177. <td class="yay"><a href="https://github.com/lihaoyi/Metascala">Metascala</a></td> <!--Scala via Scala-->
  178. <td class="no">N/A</td> <!--Scala via C#-->
  179. <td class="no">N/A</td> <!--Scala via Clojure-->
  180. <td class="no">N/A</td> <!--Scala via Python-->
  181. <td class="no">N/A</td> <!--Scala via Lua-->
  182. <td class="no">N/A</td> <!--Scala via Haskell-->
  183. <td class="no">N/A</td> <!--Scala via OCaml-->
  184. </tr>
  185. <tr>
  186. <th>C#</th>
  187. <td class="yay">
  188. <a href="http://www.saltarelle-compiler.com/">Saltarelle</a>
  189. <a href="http://sharpkit.net/">SharpKit (Commercial)</a>
  190. <a href="https://github.com/vannatech/blade">Blade</a>
  191. <a href="http://jsc.sourceforge.net/">jsc recompiler</a>
  192. </td>
  193. <td class="no">N/A</td> <!--C# via C/C++-->
  194. <td class="yay"><a href="http://jsc.sourceforge.net/">jsc recompiler</a></td>
  195. <td class="no">N/A</td> <!--C# via Ruby-->
  196. <td class="yay"><a href="http://jsc.sourceforge.net/">jsc recompiler</a></td>
  197. <td class="no">N/A</td> <!--C# via Scala-->
  198. <td class="yay"><a href="http://www.mono-project.com/CSharp_Compiler">Mono C#</a></td> <!--C# via C#-->
  199. <td class="no">N/A</td> <!--C# via Clojure-->
  200. <td class="no">N/A</td> <!--C# via Python-->
  201. <td class="no">N/A</td> <!--C# via Lua-->
  202. <td class="no">N/A</td> <!--C# via Haskell-->
  203. <td class="no">N/A</td> <!--C# via OCaml-->
  204. </tr>
  205. <tr>
  206. <th>Clojure</th>
  207. <td class="yay"><a href="https://github.com/clojure/clojurescript">ClojureScript</a></td>
  208. <td class="yay">
  209. <a href="https://github.com/schani/clojurec">ClojureC</a>
  210. <a href="http://nakkaya.com/2011/06/29/ferret-an-experimental-clojure-compiler/">Ferret</a>
  211. </td>
  212. <td class="yay"><a href="http://clojure.org">Clojure</a></td>
  213. <td class="yay"><a href="https://github.com/unnali/rouge.git">rouge</a></td>
  214. <td class="yay"><a href="https://github.com/rodnaph/clj-php">clj-php</a></td>
  215. <td class="yay"><a href="http://clojure.org">Clojure</a></td>
  216. <td class="yay"><a href="https://github.com/richhickey/clojure-clr">clojure-clr</a></td>
  217. <td class="yay"><a href="https://github.com/Bronsa/CinC">CinC</a></td> <!--Clojure via Clojure-->
  218. <td class="yay"><a href="https://github.com/halgari/clojure-py.git">clojure-py</a></td>
  219. <td class="yay"><a href="https://github.com/raph-amiard/clojurescript-lua.git">clojurescript-lua</a></td>
  220. <td class="no">N/A</td> <!--Clojure via Haskell-->
  221. <td class="no">N/A</td> <!--Clojure via OCaml-->
  222. </tr>
  223. <tr>
  224. <th>Python</th>
  225. <td class="yay">
  226. <a href="http://pyjaco.org/demo">Pyjaco</a>
  227. <a href="https://github.com/anandology/pyjs">pyjs</a>
  228. <a href="http://www.skulpt.org/">Skulpt</a>
  229. <a href="https://github.com/p2k/PyCow">PyCow</a>
  230. <a href="http://brython.info/index_en.html">Brython</a>
  231. <a href="https://pypi.python.org/pypi/pythonium/0.4.5">Pythonium</a>
  232. <a href="https://github.com/andrewschaaf/pyxc-pj">PyXC-PJ</a>
  233. <a href="https://github.com/DenerosArmy/pythonscript">PythonScript</a>
  234. <a href="http://pyjs.org/">PyJS (formerly Pyjamas)</a>
  235. </td> <!--Python via JS-->
  236. <td class="yay">
  237. <a href="http://nuitka.net/">Nuitka</a>
  238. <a href="http://code.google.com/p/shedskin/">shedskin</a>
  239. <a href="https://github.com/pradyun/Py2C">Py2C</a>
  240. </td><!--Python via C-->
  241. <td class="yay">
  242. <a href="http://www.jython.org/">Jython</a>
  243. </td><!--Python via Java-->
  244. <td class="yay">
  245. <a href="http://github.com/vic/typhon">Typhon</a>
  246. </td> <!--Python via Ruby-->
  247. <td class="no">N/A</td> <!--Python via PHP-->
  248. <td class="no">N/A</td> <!--Python via Scala-->
  249. <td class="yay">
  250. <a href="http://ironpython.net/">IronPython</a>
  251. <a href="http://pythonnet.sourceforge.net/">Python for .NET</a>
  252. </td> <!--Python via C# -->
  253. <td class="no">N/A</td> <!--Python via Clojure-->
  254. <td class="yay"><a href="http://pypy.org/">PyPy</a></td> <!--Python via Python-->
  255. <td class="no">N/A</td> <!--Python via Lua-->
  256. <td class="yay">
  257. <a href="https://github.com/bjpop/berp/wiki">Berp</a>
  258. </td><!--Python via Haskell-->
  259. <td class="no">N/A</td> <!--Python via OCaml-->
  260. </tr>
  261. <tr>
  262. <th>Lua</th>
  263. <td class="yay">
  264. <a href="https://github.com/mherkender/lua.js">lua2js</a>
  265. <a href="https://github.com/humbletim/ljs" class="runtime">ljs</a>
  266. <a href="http://kripken.github.io/lua.vm.js/lua.vm.js.html">lua.vm.js</a>
  267. </td>
  268. <td class="no">N/A</td> <!--Lua via C/C++-->
  269. <td class="yay"><a href="http://luaj.org/">luaj</a></td>
  270. <td class="no">N/A</td> <!--Lua via Ruby-->
  271. <td class="no">N/A</td> <!--Lua via PHP-->
  272. <td class="no">N/A</td> <!--Lua via Scala-->
  273. <td class="no">N/A</td> <!--Lua via C#-->
  274. <td class="no">N/A</td> <!--Lua via Clojure-->
  275. <td class="no">N/A</td> <!--Lua via Python-->
  276. <td class="yay"><a href="http://metalua.luaforge.net/">Metalua</a></td> <!--Lua via Lua-->
  277. <td class="no">N/A</td> <!--Lua via Haskell-->
  278. <td class="no">N/A</td> <!--Lua via OCaml-->
  279. </tr>
  280. <tr>
  281. <th>Haskell</th>
  282. <td class="yay">
  283. <a href="http://fay-lang.org">Fay</a>
  284. <a href="https://github.com/ghcjs/ghcjs">GHCJS</a>
  285. <a href="http://uu-computerscience.github.com/uhc-js/">UHCJS</a>
  286. <a href="http://www.haskell.org/haskellwiki/Yhc/Javascript">YCR2JS</a>
  287. </td>
  288. <td class="yay">
  289. <a href="http://repetae.net/computer/jhc/">JHC</a>
  290. </td>
  291. <td class="yay">
  292. <a href="http://www.cs.uu.nl/wiki/bin/view/Ehc/UhcJazyDocumentation">Jazy</a>
  293. <a href="https://github.com/Frege/frege">Frege</a>
  294. </td>
  295. <td class="no">N/A</td> <!--Haskell via PHP-->
  296. <td class="no">N/A</td> <!--Haskell via Scala-->
  297. <td class="no">N/A</td> <!--Haskell via C#-->
  298. <td class="no">N/A</td> <!--Haskell via Clojure-->
  299. <td class="no">N/A</td> <!--Haskell via Python-->
  300. <td class="yay">
  301. <a href="http://www.haskell.org/haskellwiki/Yhc/Pyhi" class="runtime">Pyhi</a>
  302. </td>
  303. <td class="no">N/A</td> <!--Haskell via Lua-->
  304. <td class="yay"><a href="http://www.haskell.org/nhc98/">nhc98</a></td <!--Haskell via Haskell-->
  305. <td class="no">N/A</td> <!--Haskell via OCaml-->
  306. </tr>
  307. <tr>
  308. <th>OCaml</th>
  309. <td class="yay">
  310. <a href="http://ocsigen.org/js_of_ocaml/">JS_of_ocaml</a>
  311. </td>
  312. <td class="yay">
  313. <a href="https://github.com/ocaml-bytes/ocamlcc">OCamlCC</a>
  314. </td>
  315. <td class="yay">
  316. <a href="http://ocamljava.x9c.fr/">OCaml-Java</a>
  317. </td> <!--OCaml via Java-->
  318. <td class="no">N/A</td> <!--OCaml via Ruby-->
  319. <td class="no">N/A</td> <!--OCaml via PHP-->
  320. <td class="no">N/A</td> <!--OCaml via Scala-->
  321. <td class="no">N/A</td> <!--OCaml via C#-->
  322. <td class="no">N/A</td> <!--OCaml via Clojure-->
  323. <td class="no">N/A</td> <!--OCaml via Python-->
  324. <td class="no">N/A</td> <!--OCaml via Lua-->
  325. <td class="no">N/A</td> <!--OCaml via Haskell-->
  326. <td class="no">N/A</td> <!--OCaml via OCaml-->
  327. </tr>
  328. </table>
  329. </div>
  330. <script type="text/javascript">
  331. var _gaq = _gaq || [];
  332. _gaq.push(['_setAccount', 'UA-37318032-1']);
  333. _gaq.push(['_trackPageview']);
  334. (function() {
  335. var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
  336. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
  337. var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  338. })();
  339. </script>
  340. <script src="http://code.jquery.com/jquery.js"></script>
  341. <script>
  342. function range (a, b) {
  343. return Array(b - a + 1).join(' ').split('').map(function (_, i) {
  344. return i + a;
  345. });
  346. }
  347. function randomize (a) {
  348. return a.slice().sort(function () { return Math.random() < 0.5 ? 1 : -1; });
  349. }
  350. $(function () {
  351. $('#matrix').on('mousemove', 'td, th', function (e) {
  352. $('.hover').removeClass('hover');
  353. var $tr = $(this).parent();
  354. $tr.filter(':not(.heading)').addClass('hover');
  355. $tr.siblings(':not(.first-heading)').add($tr)
  356. .find('*:nth-child(' + ($(this).index() + 1) + ')').addClass('hover');
  357. });
  358. // The fun game at the top.
  359. var tds = $('#matrix td'), width = Math.floor(Math.sqrt(tds.length));
  360. tds = tds.toArray().map(function (t) {
  361. return $(t).find('a').toArray().map(function (a) {
  362. return $(a);
  363. });
  364. });
  365. $('#myideaoffun').on('mouseover', function () {
  366. $('#myideaoffun').addClass('hover');
  367. })
  368. $('#myideaoffun').on('mouseout', function () {
  369. $('#myideaoffun').removeClass('hover');
  370. })
  371. function newTrick () {
  372. if ($('#myideaoffun').hasClass('hover')) {
  373. return;
  374. }
  375. var idx = Math.floor(Math.random()*100);
  376. var t = tds[idx];
  377. if (!t.length) {
  378. return newTrick();
  379. }
  380. var links = [randomize(t)[0]];
  381. // Found random one, find next.
  382. while (true) {
  383. var rar = randomize(range(0, width))[0];
  384. var idx = (width * (idx % width)) + rar;
  385. var t2 = tds[idx];
  386. if (!t2.length) {
  387. return newTrick();
  388. }
  389. if (t2 == t) {
  390. // Don't be too obvious.
  391. if (links.length == 1 || (links.length < 3 && Math.random() < 0.5)) {
  392. continue;
  393. }
  394. $('#myideaoffun').html('&rArr; Try running ' + links.map(function ($a) {
  395. var pos = $a.parent().index();
  396. var $to = $a.parent().parent().siblings().eq(1).find('th');
  397. return '<a href="' + $a.prop('href') + '">' + $a.text() + '</a> (<i>' + $a.parent('').siblings().eq(0).text() + ' &rarr; ' + $to.eq(pos).text().replace('[1]', '') + '</i>)';
  398. }).join(' in ') + '!')
  399. return;
  400. } else {
  401. links.push(randomize(t2)[0]);
  402. }
  403. }
  404. }
  405. newTrick();
  406. setInterval(newTrick, 5*1000);
  407. });
  408. </script>
  409. </body>
  410. </html>