Live data from Hacker News

A graph of programming languages connected through compilers

akr.am

71–80 of 110 posts

Re: A graph of programming languages connected through compilers

#71
post #63

I tried in vain to find WebAssembly. Why would you include JavaScript but not WebAssembly in a graph that has LLVM in it?

It does have WebAssembly, but its incorrectly labeled as targeting Java Bytecode.

That line is labelled with https://github.com/cretz/asmble

Re: A graph of programming languages connected through compilers

#72
post #51

My main takeaway: people want to avoid writing JavaScript about as much as they want to avoid writing machine code or Java bytecode.

Nah. It's just that different people have different tastes. Don't compare JavaScript alternatives to people wanting an alternative to Java bytecode; compare JavaScript alternatives to people wanting an alternative to Java.

It's just that, at least for the first couple decades of its existence, the platform in question had no bytecode, so transpiling was the only way to escape.

Re: A graph of programming languages connected through compilers

#75
post #4

A few missing items: - CIL to C++ using CoreRT/AoT compiler [1] - JVM to CIL using ikvmc [2] - Quite a few languages to WebAssembly using LLVM [3] - J# if you are willing to include dead but somewhat significant languages [1] https://blogs.msdn.microsoft.com/alphageek/2016/10/13/native... [2] http://www.ikvm.net/userguide/ikvmc.html [3] https://stackoverflow.com/questions/43540878/what-languages-...

(A subset of) Clojure can be compiled to C++ using the Ferret compiler: https://ferret-lang.org/

Re: A graph of programming languages connected through compilers

#78
post #46
post #11

So, you can apparently compile C++ to LLVM-IR, then to Javascript, then to Python and then to C++ (you can do similar feat with C). Wonder if there is a fix point, or it diverges.

Like when you auto-translate English -> Japanese -> English. Very unlikely you will recover the original Good fun though.

By the pigeonhole principle, any such iteration must either enter a cycle, or the translations must be unbounded in length. If you experiment, you will find that Google Translate usually lands in the first category; transpilers usually land in the second.

Re: A graph of programming languages connected through compilers

#79
post #5

Interactive graph is nice, but what's with so few zoom levels? It's either too small or too large.. Or is my mouse scroll wheel too sensitive?

I suspect it was developed on a trackpad, which has pixel-level scroll precision. Zooming is a bit fast but generally fine on my MacBook Pro. Probably anything like this should have a zoom slider (like Google Maps does) for people without precise scrolling or pinch zoom.

Re: A graph of programming languages connected through compilers

#80
post #70

Earlier quoted context omitted.

> given that the machine code is an intermediate product The machine code isn't the intermediate product - it's the final product. Some internal IR is the intermediate product. But yes it's normal convention in the industry to talk about JIT compilation to machine code as 'compiling to machine code'.

But let's say, they added "decompilers" to the graph, and there is (say) a decompiler from machine code to C. Then I'd assume, because there is a path in the graph from JavaScript to C (going through machine code), that I can translate from JavaScript to C. Except this isn't true because V8 is a JIT, and doesn't output its internal representation.

It's not a graph of compilers to a file on disk. It's a graph of compilers. Just because it exists only in memory doesn't mean it doesn't exist. Has the JavaScript been compiled to machine code. Yes, it has.

You mean that the JavaScript compilation is only valid for a given application at a given point in time? Yes that's true.

Post reply on HN