Py2many is a transpiler, which converts source code of one language to source code of another language (which then needs to be compiled).
So far, Py2many seems to support Rust and C++14, and preliminary support for Julia, Kotlin, Nim, Go and Dart.
Py2many tries to primarily build a standalone C program without the python runtime, although it supports a --extension flag, where it generates a PyO3 extension for rust.
If you use additional type markings it can generate more performant C code.
BTW: I remember a blog article of someone who was using Cython as the primary language instead of Python.
As the sibling comment notes, transpiler is not a very useful term.
A thought assembler was a "compiler", where a "compiler" is a special type of transpiler that is only capable of producing machine code.
There are also many, like me, who find it to be a distinction without a difference. We call them all compilers.
One example is the TypeScript team:
> Let’s get acquainted with our new friend tsc, the TypeScript compiler.
https://www.typescriptlang.org/docs/handbook/2/basic-types.h...
Another is Bjarne Stroustrup. Back in the glory days of BIX, I posted a comment in one of the forums that said, "C++? That's a preprocessor, isn't it?" (At the time, the only C++ implementation was Cfront, which translated C++ to C.) Bjarne replied in no uncertain terms that Cfront was a compiler.
Longer version of the story with some discussion of other words and phrases:
https://news.ycombinator.com/item?id=15154994
Of course, the word "transpiler" had not yet been coined, but I have a feeling Bjarne still prefers to call Cfront a compiler, as the Wikipedia page does:
> Cfront was the original compiler for C++ (then known as "C with Classes") from around 1983, which converted C++ to C; developed by Bjarne Stroustrup at AT&T Bell Labs.
https://en.wikipedia.org/wiki/Cfront
So to my mind, a compiler doesn't have to generate a "compiled executable". It also doesn't have to take "source code" as input.
Most implementations of JavaScript and Java have at least two compilers: one that translates source code into bytecode, and a Just In Time Compiler that never sees the source code, but analyzes and profiles the bytecode while it runs, and translates sections of the code into machine language as it finds hotspots.
Now if you like the word "transpiler", as many do, I won't try to convince you otherwise. I just wanted to explain why some don't find it a useful distinction and prefer "compiler" for all these cases. It's a program that translates computer code from one language to another, whatever the form of those languages may be.
I suppose by my own argument I should also call an assembler a compiler! But no one does that... :-)
Friend fyi... the word "transpiler" to make a distinction of converting the source to another higher-level language rather than a lower-level machine language appeared as early as 1960s. In the 1964 paper, see the last page and the 2nd-to-last paragraph:
http://comjnl.oxfordjournals.org/content/7/1/28.full.pdf+htm...
>There are also many, like me, who find it to be a distinction without a difference. We call them all compilers. [...] Now if you like the word "transpiler", as many do, I won't try to convince you otherwise. I just wanted to explain why some don't find it a useful distinction and prefer "compiler" for all these cases.
I understand your point of why "compilers" already encompasses transpilers so the word "transpilers" seems redundant. But I'll try to explain why "transpilers" still endures. If you're not familiar with concept of "lumpers vs splitters", take a look at: https://en.wikipedia.org/wiki/Lumpers_and_splitters
Imagine if we did not have the word "transpiler". Language usage would still evolve to make a distinction via extra prefixes or suffixes or extra adjectives. Examples of alternative history might be:
- "compiler-to-asm" or CTA acronym, or "compiler-to-executable", or "native compiler"
- "compiler-to-another-high-level-language" or CTAHLA acronym, or "programming language translator"
But humans don't like to say or write verbose multi-syllable terminology and they'd eventually substitute a simpler word as shorthand for the distinction. That shorthand word might be "transpilers" or another word to serve the same purpose. And that's what happened in 1964 when AF Parker-Rhodes suggested the word "transpiler".
Similar concept of labeling Linux ext4, Microsoft NTFS, Apple HFS as "file systems" instead of just "databases" -- even though they are all conceptually "databases" which have same computer science concepts of keys, blocks, btree indexes. If we tried to police the language and insist that "file system" adds no useful distinction because it's a "database"... human language usage would still evolve with extra adjectives such as "operating-system-built-in-database-for-documents-and-arbitrary-files-etc" ... which is a cumbersome mouthful which motivates a shorthand terminology... perhaps call it "file system".