List of Transpilers, TransCompilers, Decompilers, etc, source to source converter, & similar & related tools/apps
List Of Transpilers, TransCompilers, etc source-code to source-code converter & similar tools/apps, and Decompilers, Compilers, etc & related tools/apps.
( History : I created a question in StackOverflow(SO), where i have initially asked Which transpiler can convert "Go"
source-code into "C"
source-code, and then i had to change question & ask : Which transpiler (out of four specific transpiler) can convert from Go
to C/C++
and can still keep (almost all) high-level algorithms & structures used in source-code , fairly accurately same/intact in output source-code . And this project/data borned from that research, so later when StackOverflow’s "PRO-GOOGLE"
& "PRO-GO"
do-evil mods ganged-up on my Quesiton+Answer & deleted it (vote to undelete here) , so i had to publish from this github project, & improve it here. )
--- BEGIN the Peaceful Open Source License ---
License/Contract name: PEACEFUL OPEN SOURCE LICENSE/CONTRACT.
License/Contract version(y-m-d) 2020-11-07.
License/Contract authored by: Linkesh Diwan. 2013.
License/Contract authored by: Emde T. Ashfolk. 2020.
Transpiler.And.Similar.List : List of transpilers, transcompilers,
decompilers, compilers, etc.
Copyright (C) 2020 Erik T. Ashfolk (atErik at ashfolk dot com).
License version(y-m-d) : 2020-11-07.
Redistribution and use of this "SDSP" or "SHIDSP", where SDSP/SHIDSP
is pointing to the above software/hardware/information/data/service/
project,etc accompanying this PeaceOSL license/contract in source
and binary (aka: object-code) forms, with or without modification,
are permitted provided that the following ten conditions are met:
1. Redistributions of this SDSP/SHIDSP (software, source code,
data, hardware, information, service from this project) must
retain the above copyright notice, this list of conditions,
and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution from this SDSP/SHIDSP (software/hardware/info/data/
service/project).
3. Modifications to this SDSP/SHIDSP (software, source code,
data, hardware, information, service from this project) must
retain the above copyright notice, this list of conditions,
and the following disclaimer, and may not include further
conditions or licensing which go against the spirit of this
license.
4. Here we are using "HR" = Human-Rights. "CH" = Copyright-Holder(s).
This SDSP/SHIDSP (software/hardware/info/data/service/project)
must not be used to violate or abuse (any) HR, either directly
or indirectly in any form. This SDSP must not be used to abuse
or violate HR in any form in any physical location, written
articles, media, broadcast, video, etc or in any form inside
cyberspace/Internet. This SDSP license/contract is declaring/
stating in early to you, user of this SDSP, that, this SDSP/SHIDSP
must not be used to violate or abuse any human-rights even for
"National Security" excuse/reason : As nothing (not even
"National Security" or court order/decision or voted decision)
can be above "Human-Rights". This SDSP license/contract is further
declaring and stating in early to you : any result/decision from
any voting, or any order or decision from any court, to override
usage of this SDSP or SDSP content to violate/abuse HR, is hereby
declared null-and-void and illegal.
5. This SDSP/SHIDSP(software/hardware/info/data/service/project)
must not be used to cause deliberate harm to any human individual,
group,community or country either directly or indirectly, in any
form.
6. This SDSP(software/data/service/project) must not be used for
stealing any data or physical items, and this SDSP must not be
used to violate or abuse any privacy rights, of any human group,
individual, community, country or earth, either indirectly or
directly in any form. This SDSP must not be used for any type of
stealing: spying, data collection, etc, without first obtaining
written fully aware and voluntary specific consent from each
individual, person, groups, subjects,etc, and also not without
obtaining prior permission from this SDSP CH(copyright-holders).
This must not be used for any type of digital (or physical) jail:
monitoring, tracking,etc not-without obtaining permission from
each subject's written fully-aware and voluntary consent, and
also not-without obtaining prior permission from this SDSP CH.
This SDSP license/contract invalidates any permission to spy/
steal/collect which is (or will-be) obtained from any judge(s),
proxy, jury, court or vote, etc. To obtain exception/permission
from CH of this SDSP, CH must be provided proof of real voluntary
consented permission directly from each subject, and such must
not violate/abuse HR (human-rights). This SDSP license/contract
is declaring and stating to you in early, that, any type of voting
result/decision or any court or judge's any order/decision to use
this SDSP for mass scale (data) stealing/collection, etc are still
violation and abuse of HR and any such decision/order is/are
hereby declared null-and-void and illegal.
7. This SDSP(software/data/service/project) must not be used by any
Military or branches, Law Enforcement or branches, or by any
service/items provider or supplier of/for Military or Law
Enforcement. Unless specific written exception/permission is
obtained from CH(copyright holders) of this SDSP.
8. This SDSP (software/data/service/project) must not be used by any
Human-Rights-violating-or-abusing = "HR-v-o-a" entity or person:
HR-v-o-a Government(Gov), HR-v-o-a Gov branches, HR-v-o-a public
offices, Gov/public funded HR-v-o-a individual, companies, groups,
corporations, businesses, organizations, etc, any HR-v-o-a private
individual, offices, companies, corporations, businesses, groups,
organizations, etc Or any human/contractor person working in/for
any of mentioned entities in this section.
9. This SDSP(software/data/service/project) license/contract stating
and declaring to you in early, that, you are permitting this SDSP
CH(copyright holders) to question & obtain answer+proof from you
and other sources, to find-out if this SDSP can be used for any
violation or abuse of HR (human-rights). This SDSP license/
contract further stating: upon any report of HR violation or abuse
by the user of this SDSP or by this SDSP itself, this license/
contract authorizes CH to obtain detail usage information from
you/user of this SDSP, and also authorizes CH to obtain further
related information/proof from any other sources by any means,
including obtaining any data which even if you have defined as
type of "secret" data, etc and then these are to be used for
realizing the level of HR violations and abuses and losses
therein. You completelt agree & permit, that any type of HR
violation or abuse by you automatically removes all protection
of all related data, including any type of "secret" data, and
brings those under public & international sector and scrutiny,
to find-out detail of HR violations/abuses, to deter HR abuses/
violations. This license/contract also permits CH to seek
compensation, remedy, etc. This license/contract permits CH to
terminate this license/contract, when CH decide(s) to do so at
any time at CH's will. This license/contract also stating and
declaring to you in early, especially after above mentioned
incidents, CH of this SDSP are automatically authorized to
investigate and proceed to international or public court, even
if you fail or succeed in providing detail data. This SDSP
license/contract is further declaring and stating to you in
early: any decision or order from any type of "secret" or
non-public nature of court(s), judge/jury, proxy or vote, is
hereby declared invalid and null-and-void, from overriding any
prceedings into international or public court. Any HR violation/
abuse must be resolved publicly, so that, even coersion/corruption
can become public knowledge. This license/contract also stating
you/user of this SDSP: upon HR violation/abuse report/incident,
CH at their/his/her will can also publish publicly what HR abuse/
violation has occurred, and what steps are taken to solve.
10. If you do not agree with these above conditions, then you cannot
use this SDSP(software/data/service/project) in any form directly
or indirectly, and you are free & welcome to choose any other
software/choice. This SDSP has shown these conditions at every
stage in top or in beginning or agreement is obtained with yes/no.
Any usage of this SDSP grants this SDSP CH(copyright holders)
your full consent of your full acceptance & agreements of above
all (including this condition number ten) conditions and terms
and contract, specified in this SDSP license & contract. This
license/contract will make every attempts & efforts to avoid any
and all type HR("Human-Rights") violations/abuses (related to
where this SDSP is used, and who is using this SDSP, etc),
So please do not use this SDSP, if you cannot uphold or honour
all HR.
DISCLAIMER : THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
AND CONTRIBUTORS "AS IS", AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT HOLDER, AUTHORS, OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, MONEY, POSSESSIONS,
OR LIFE; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
--- END of the Peaceful Open Source License ---
Get copy of "PeaceOSL(2020)" license for this project, from here.
CPL = Computer Programming Language | f.e. = for-example | i.e. = in-example | e.g. = example-goes-to | aka = a.k.a. = also-known-as.
TRANSPILE : source-code to source-code conversion , where high-level structures, algorithms, etc (of input code) are usually kept same or accurate during conversion process (in output code) . Sometime extra codes are needed in output code, to function same, as input code . Transpile is also known as: Transcompile, Transform, etc.
Which TRANSPILER Can Convert (aka: TRANSCOMPILE) Input Source-Code (for-example: "Go"
or Any/✱ other CPL) Into (A Different Language) Output Source-Code (for-example: "C"
or Any/✱ other CPL) ?
Which TRANSPILER Can Keep High-Level Algorithms / Structures Used In Input Source-Code (f.e: "Go"
or Any/✱ other CPL) Fairly Accurately Intact/Same After Conversion Into A Different Language Based Generated / Output / Destination / Target Source-Code (f.e: "C"
or Any/✱ other CPL), As Much As Possible ?
( abbreviations : lang
= language | C++
= Cpp
= C-plus-plus
| Go
= Golang
)
TRANSPILE : source-code to source-code conversion , where high-level structures, algorithms, etc (of input code) are usually kept same or accurate during conversion process (in output code) . Sometime extra codes are needed in output code, to function same as input code.
For example, when input code ("Go"
language code) contains:
// "Go" based source-code:
var n int
type Node struct {
left, right *Node
data interface{}
}
func twice(f func(int) int, v int) int {
return f(f(v))
}
func main() {
f := func(v int) int {
return v + 3
}
twice(f, 7) // returns 13
}
Then, this "Go"
-to-"C"
conversion/transpilation1 process need to convert & generate/output below "C"
language code:
// Converted "C"-lang based source-code
#include <stdio.h>
typedef int (*int_func_int) (int);
int n;
struct Node {
struct Node *left, *right;
void *data;
};
int add3(int x) {
return x + 3;
}
int twice(int_func_int f, int v) {
return f(f(v));
}
int main() {
printf("%d\n", twice(add3, 7));
return 0;
}
When "Go"
-to-"C++"
(C++14
) transpilation is done, then output should be:
// Converted "C++"(C++14)-lang based source-code
#include <iostream>
int n;
struct Node {
struct Node *left, *right;
void *data;
};
auto twice = [](auto f, int v)
{
return f(f(v));
};
auto f = [](int i)
{
return i + 3;
};
int main()
{
std::cout << twice(f, 7) << std::endl;
}
When "Go"
-to-"C++"
(C++11
) transpilation is done, then output should be:
// Converted "C++"(C++11)-lang based source-code
#include <iostream>
#include <functional>
int n;
struct Node {
struct Node *left, *right;
void *data;
};
auto twice = [](const std::function<int(int)>& f, int v)
{
return f(f(v));
};
auto f = [](int i)
{
return i + 3;
};
int main()
{
std::cout << twice(f, 7) << std::endl;
}
An actual EXAMPLE of “C”-to-“Go” CODE is shown here 2, 3, but we want opposite of “C”-to-“Go” : so we want “Go”-to-“C” (go-to-c / go2c),
and/or "Go"
-to-"C++"
/"Cpp"
(go-to-cpp / go2cpp).
•
Let us assume, you’re more familiar with "C"
& "C++"
more, than "Go"
/✱.
•
In computer programming language, let us assume, C
/C++
/Assembly
are your native computer language (these you have learned in School/University, & then practiced).
•
So it should be okay to convert non-C
& non-C++
language "Go"
aka: "Golang"
/✱ , into "C"
or "C++"
, to understand better.
•
Learning a second computer language (for example: "Go"
/✱) (or lets say: French) & hoping to become expert within 7-days or so like your native computer language ("C"
or "C++"
) (or lets say: English) , is not only a plain wrong expectation , if any fool suggested such then that i consider a wrong advice , because this will NOT take you to a LEVEL where you can begin to contribute in real open-source projects . But one of the right advice can be this : Start to learn+practice the second computer language in parallel (in a different, easy & forked project), as it will take long time & effort to reach expert level in that second computer language.
•
So, we do not want to keep any input ("Go"
/✱) source-code remaining in output (C/C++
) source-code . ( But some Assembly
is fine in output if you’re okay with Assembly
language ) . And also be aware of that ‘Go’ Has Problems 2, 3, 4 , Security Vulnerabilities of ‘Golang’ 2, 3, 4, 5, etc are just few reasons to move away from "Go"
, and use other language . You have full freedom & right to choose what you want to do.
•
Let us assume : Necessary Features or Functionality that i or you need to add, those are developed & optimized for C/C++
, and those are not-available for input language (here: "Go"
/✱ language), Or, input language devs (here: "Go"
-devs) do not want to add such functionality or features that i or you need.
•
Programs that i or you want to TRANSPILE/CONVERT from Go-to-C
or ✱-to-C
, or from Go-to-C++
or ✱-to-C++
, that type of programs should be developed with C/C++
, as that type of programs work better with C
, and even more better with C++
.
•
Recreating complex & large software/systems with years of development, from scratch, with another (second) computer language , is not-only hard , that is also not-suggested1 (not-adviced) , So transcompilation steps are helpful to give a head-start by converting easier or simpler source-code faster . Transcompilation process always requires human developer based manual code conversion, as none of the Transcompilers/Transpilers are perfect or supports ALL aspects of source/input language or different programming styles, codes, libraries, etc that are used in real practical projects/languages . Small project(s) or new project can be built from scratch, and even by using a second computer language.
•
If source code is from open-source project , then Human/manual and/or automated transpilation of output source-code should also be released as open-source , same as input source-code . In that way, another group of developers skilled at output language (C/C++
) can also participate in open-source development, to help all users & people.
Currently, i SPECIFICALLY have these solutions/choices to use:
•
Solution A or #1 : “go2cs”, “CSharp.lua”, “lua2c”.
•
Solution B or #2 : “go2cs”, “Blazor”, “wasm2c”.
•
Solution C or #3 : “gomoku”, “Cfront” or “Comeau C/C++”.
•
Solution D or #4 : “go2c”.
•
…
WHICH Go
-To-C
SOLUTION (out of above solutions) IS BETTER ?
( better at keeping high-level algorithms/structures,etc fairly or accurately same in output source-code )
is there (similar) better transpiler solution, among the links that i have shown ?
Above (transpiler-set) solutions have what Pros/Cons ?
Solution-Set A or #1 :
"Go"
-->"C#"
-->"Lua"
-->"C"
"Go"
/"Golang"
source-code
into "C#"
(C-sharp) based code.
D:\Dev\GoProject\
)D:\Dev\Go-to-CS-GoProject\
)Go
file: go2cs -l D:\\Dev\\GoProject\\src\\Main.go
Go
project: go2cs D:\\Dev\\GoProject
Go
Standard Library: go2cs -s -r D:\\Dev\\GoProject\\src\\
"C#"
source-code into
"Lua"
code with this
"CSharp.lua" transpiler.
Usage: CSharp.lua [-s srcfolder] [-d dstfolder]
Arguments
-s : can be a directory where all cs files will be compiled, or a list of files, using ';' or ',' to separate
-d : destination directory, will put the out lua files
Options
-h : show the help message and exit
...
(source
folder should be: D:\Dev\Go-to-CS-GoProject\
)D:\Dev\CS-to-Lua-GoProject\
)
"Lua"
source-code into
"C"
code with this "lua2c"
transpiler.
D:\Dev\Lua-to-C-GoProject\
or specify previous as destination folder in next command)lua
to C
cmd: lua lua2c.lua D:\Dev\CS-to-Lua-GoProject\Main.lua
"C#"
&
"Lua"
, and you can also clearly see that transpile/conversion occurred 3-TIMES :
"Go"
-->"C#"
-->"Lua"
-->"C"
,
which is not-very-good . Conversion done by go2cs
is high-quality(HQ),
but other tools in chain are not that much HQ, so overall conversion quality is not good.C#
or Lua
)."C"
code will still
have high-level structures fairly intact that were used in initial
"Go"
source-code.
Solution-Set B or #2 :
"Go"
-->"C#"
-->"WebAssembly"
-->"C"
.
(also see alternative Solution-E)
"Go"
/"Golang"
source-code
into "C#"
(C-sharp) based code.
"C#"
source-code into
"WebAssembly"
code with this
"Blazor"
transpiler."WebAssembly"
source-code into
"C"
code with this
"wasm2c"
transpiler."Go"
-->"C#"
-->"WebAssembly"
-->"C"
,
but these steps will completely breakdown all high-level structures & meaningful
programming codes into large amount of micro (machine level) elements, etc,"Assembly"
& "C"
&
also "C++"
).
Solution-Set C or #3 :
"Go"
/"Golang"
source-code into
"C++"
based code.
"C++"
source-code into "C"
code with (any one of these) transpilers like these:
Cfront,
Comeau C/C++,
also see these SO(StackOverflow) pages for more info:
1,
2,
3,
4.C++
-to-C
1:clang -c CPPtoC.cpp -o CPPtoC.bc -emit-llvm
clang -march=c CPPtoC.bc -o CPPtoC.c
llvm-g++ -c CPPtoC.cpp -o CPPtoC.bc -emit-llvm
llc -march=c -enable-correct-eh-support CPPtoC.bc -o CPPtoC.c
"Go"
-->"C++"
-->"C"
. In "Go"-to-"C++" conversion by "gomoku", only subset (smaller portion) of "Go" is supported, but it can keep high-level structures/algorithms, etc intact . Then, in "C++"-to-"C" conversion stage, output quality varies . When LLVM/llc, etc are used, then output "C" does not have input's high-level structures intact anymore . Comeau C/C++ appears able to keep high-level structures intact during "C++"-to-"C" conversion, but it is a proprietary (aka: not-openSource) & older tool.
"Go"
source-code into "C"
based code, though it can transpile "Go"
-to-"C"
by itself, but at this moment (when this was posted here),
sadly this supports only a subset components of Go.
These transpilers can also be used for Go-to-C
conversion :
goc,
go-transpiler(mewbak),
etc, but these also only supports subset of "Go"
language,
at this moment (when this was posted here).
Go
-->"C"
, but does not support conversion
of all components of Go
-language.
Solution-Set E or #5 :
"Go"
into
"Go"-"Assembly"
, "go2goasm"
, output of
"Go"
-tool is a Google/Golang
flavored
"Assembly"
, its not completely Standard/regular
Assembly
, but close to it .
Commands:go tool compile -S Main.go
go build -gcflags -S Main.go
Go-"Assembly"
source-code file, and manually change/convert incompatible portions into general
Assembly
until Boomerang can do Asm-to-C conversion . Or use
asm2c, etc transpiler, that can convert
Assembly
(Asm
) into C
(Asm
-to-C
) . Other solutions are mentioned
here,
2,
3.
"Go"
->"Assembly"
->"C"
. Because of
"go2asm" conversion, allmost all higher-level structures in "Go"
will go away from "Assembly"
(low-level language) . So, after
Assembly
to C
conversion , C
source-code
will not-include any high-level structures of "Go" source, new high-level
C
will be something different, though functioning same way."Go"
->"C#"
->"C"
.
Many higher-level structures in "Go"
will remain in final output .
The "go2cs"
does HQ conversion, but next step ("cs2c")
not that much, need more improvements.
This “esp32-transpiler” can convert ‘Go’ into ‘C’ for Arduino (an embedded system), but only small subset of ‘Go’ lang spec is supported.
"Go"
-to-"C"
transpiler-set,
Many developers have pointed out, in some cases C++
(based compiled program) can often be much better & faster than C
ones, so i’m also displaying these few options in below to convert/transpile Go
source-code directly (or via multiple stages) into C++
source-code while keeping higher-level algorithms & structures fairly intact/accurate as much as possible , in this way output C++
source-code is also easier to improve as/when necessary:
Go
to C++
.Go
to C++20
/C++17
.GoLite
(subset of Go
) to C++
. GoLite Transp supports only subset of Go
.Go
to C#
(C-Sharp), then use any of these: cs2cpp, Alter-Native, CoreRT, OneLang, Ranger, etc to convert C#
into C++
.Go
to C++
.Go
-To-C++
SOLUTION (out of above solutions) IS BETTER ?"Go"
-TO-"C++"
:go2cs
conversion quality is higher, but next stage cs2cpp
tools are not. abbreviations : aka
= also known as
Transpiler/Transcompiler1 internally contains primarily three major components:
•
Transpiler.•
How to write a transpiler, 2.•
Transpiling between any languages.•
The “Transpiler Diagram Image” shown above, is a modified image, it’s original image was obtained from RoseCompiler website . Rose compiler is released with BSD modified license, and it was developed at Lawrence Livermore National Laboratory(LLNL), Livermore, California, United States.I have added reference-links immediately after each sentence or section, by using superscript numbers.
Go2C Conversion : My objective here is to share simple steps/directions on converting / TRANSPILING Go
/✱ language source-code into C
(or C++
) lnaguage source-code , with one of the mentioned (in above) possible set of TRANSPILER-set solutions , that can still keep high-level algorithms / structures, etc used in initial/input Go
/✱ source-code , fairly or accurately same/intact in final destination / output C
(or C++
) source-code.
Then we can compile such transpiled/transcompiled C/C++
source-code (into binary machine code) when necessary, to run it faster.
So after Go-to-C
/✱-to-C
or Go-to-C++
/✱-to-C++
source-code conversion , it will be possible to change source-code , to add required necessary feature or functionality , and improve C
(or C++
) source-code.
Some users have mis-conception (aka: brainwashed) about "Go"
computer programming language , and some users intentionally lies purposefully as they work under some projects from “Google” or projects supported by “Google”, or working under a project that uses Google products, for-example : Google’s “Go” language, Google Advertisements, Google’s practice of violating Privacy-Rights (aka Spying-on ak Stealing-from People,Citizens,Users,Persons), etc, etc , these are hard-core Google-PUSHERS (aka: Google-supporters) , some of these criminal/”evil” acts are very dangerous Anti-Humanity (aka: Anti-Human-Rights) activities.
We need to push Google (and it’s parent company: Alphabet) and it’s corporate-controllers by exposing their criminal & “evil” activities , so that their harmful & “evil” acts are Questioned & punished , so that in end Google (and Alphabet) & it’s corp-controllers chooses real good & correct & non-“evil” ways to do correct & good & non-“evil” things for People, Citizens, Users , not-only inside USA but for entire World.
In entire world, country after country are now filing Lawsuit against years of Google’s “evil”/hamrful practices . So if Google/Alphabet wants to do business with/for people/companies, they need to cultivate good & non-“evil” practices.
References: 1, 2, 3, 4, 5, 6.
So, (to remove mis-conception & brainwashing), I have added data/info from accredited computer COMPETITION , BENCHMARKS , etc to prove which computer programming language is better & which is not.
And remember, ANYONE/USER/people have full Freedom+Right to informaton what he/she wants, and also have full Freedom+Right to convert one language into another.1, 2, 3, 4, 5
Do not ever forget, there are people & groups who are pushing more & more for violation of human-rights , profitting by violating human-rights , and also there are people who are pushing for establishing more human-rights & peace & justice.
Some COMMON-SENSE & HUMAN-RIGHTS:
abbreviations : CPL
= Computer Programming Language | lang
= language.
Here are some results of a yearly COMPETITION on CPL, based on CAPABILITIES of CPL and tools:
Rust
| 2nd: C++
| 3rd: - | Lightning: C++
& Haskell
.Rust
| 2nd: C++
, Python
, Ruby
, JavaScript
, bash
, SQL
| 3rd: - | Lightning: OCaml
.
Go
(Golang) HAS NOT ACHIEVED ANY PRIZE in any category . In 2002 C
achieved 2nd prize . And in 2018 C++
achieved 2nd prize again.
abbreviations : CPL
= Computer Programming Language | lang
= language.
See various benchmarks: 1, 2, 3, 4, 5, 6, 7.
C++
(g++
), C
(gcc
),
Rust
, Julia
, Intel Fortran
, Ada 2012
,
C# .NET Core
, Free Pascal
, F# .Net Core
, Go
,
Java
, etc.
Go
& C
, or Go
& C++
.
The "Go"
(Golang) is ~2 to ~5.25 TIMES SLOWER THAN "C"
.
"Go"/"Golang"
is ~2.25 to ~7 TIMES SLOWER THAN "C++"
.
abbreviations : CPL
= Computer Programming Language | lang
= Language.
Comparison of Programming Language’s instructions, functions, components, etc:
•
Basic instructions.
•
Syntax.
•
Higher-order function.
•
Operators.
•
Object-Oriented Programming(OOP).
•
OOP Constructor.
•
Exception handling.
abbreviations : CPL
= Computer Programming Language.
How To Determine Which Transpiler/Tarnscompiler Is Better Than Another ?
CHECK+COMPARE SUPPORTED COMMANDS / INSTRUCTIONS, FUNCTIONS, etc LIST PROVIDED BY TRANSPILER DEVELOPER / WEBSITE :
Transpiler software’s primary-dev or project’s website displays LIST of supported commands/instructions, functions, etc language components . Their primary developer(s) & other developers are developing+improving those transpiler-projects when they can . Usually support for more options, instructions, etc are added into these Transpiler projects.
So, you have to often check out those LISTs & COMPARE, to find out which transpiler is better.
And also do this TEST : use same source file and convert with multiple transpilers (in sae category) , and check & compare output source-code file , to find out which transpiler able to do conversion completely or which one has skipped some portions or which one has done incorrect conversion.
So, Which one is BEST, that will always change or most-likely be different at different time.
(and “BEST” is connected with different “Category” , so based on different category there are different types of BEST, and at different time)
Most of the time, certain code/strings need to be modified/changed, & prepared in each initial source-code (here "Go"
) files (with PreProcessor type of software), before the primary transpiler can be used.
And, often you also have to change some specific style of code/string in each output (here "C"
or "C++"
) file , and you also have to fix or change something that was not automatically generated by transpiler in output source-code.
So use below code/string replacing script-codes, mentioned in below linked SO/SE pages:
•
Use sed to replace a multi line string.•
Do recursive find & replace string with awk or sed.•
Find & replace string in all files recursively using grep & sed.•
How can I replace a newline (\n) using sed?.•
Re2c: fast flexible scanner for regular expression matching.•
Recursively read folders & execute command on each.•
Process all files in all directories.•
Execute command on all files in a directory.•
In Bash, Handle paths that have spaces and wildcards.ANY USER/PEOPLE HAVE FULL FREEDOM+RIGHT TO INFORMATION ON ANY LANGUAGE AND ANY TOOL/TRANSPILER TO TRANSLATE/TRANSFORM ANY LANGUAGE1, 2, 3, 4, 5.
abbreviations : CPL
= Computer Programming Language | lang
= Language.
Some users have tendency to give false & wrong suggestions and wrong advice(s) and wrong Answer (about Transpiler , Transpilation, etc) . If quesiton is about “A”, then such user(s) answer for “B” & says they answered the Quesion about “A” … this is wrong + incorrect , even if the answer for “B” is a very good solution , because its not an answer for Quesiton-“A” . Answer for Quesiton-“A” must discuss about “A” & provide solution for “A” , then that user can/may talk about “B” inside an extra-info section in bottom-side of an answer.
So here in below, i have tried to gather & post correct advices , after reading & contacting more knowledgeable persons & their discussions:
C/C++
is better, if that is the case for your software need or your project’s target/objectives, then TRANSPILE Go
/✱
into C/C++
with transpiler, Or transpile manually by hand-typing in C
/C++
code, by replacing Go
/✱
(with equivalent C
/C++
code) . Which steps you will take, that freedom & choice is yours.
Go
is better, if that is the case for your software need or project’s target, then you should avoid conversion/transpilation of Go
into something else, instead improve existing Go
codebase, if you can after learning it . And again, which steps you will take, that freedom & choice is yours.C
/C++
, when features & specialties & benefits of C
/C++
usage are needed, And know firsthand/early, where (aka: in which USE CASES) C
/C++
excels and where Go
excels, then decide to do+follow correct & balanced steps.
C/C++
”, “When to not use C/C++
”, or use only C
or C++
or Go
or Golang
, etc.Go
into C/C++
. After complete “Go-to-C” or “Go-to-C++” conversion, If you publish publicly then other devs/users can see & may join to improve it or contribute in it.GPL
licensed, then output also have to be licensed under GPL
(in most cases. CWPL) . And without all copyright-holder(s) & code-contributor’s permission/approval, the GPL
license (generally) cannot be changed into another license . When input source-code is licensed under Apache
, BSD
, MIT
, etc (or code was released in Public Domain) then output can have same Or different license . If you use or have used your own hand, eye, brain to transform/transpile (aka: source-to-source code conversion) manually some portions or significant portions of source-code , then you can claim copyright ONLY on the portions of code which you yourself have manually by yourself modified or transformed or written (without using any machine/software based transpilation) , so in such case you can add your name under the input/”upstream” software’s copyright-holder(s) name, in the destination language (here "C/C++"
) source-code . If you have used machine or mechanized process or software to do complete code transpilation, then you cannot claim any copyright on any portion which were transpiled in such way (because, a machine has done it, not you), and in such case, input/”upstream” software’s copyright-holder(s) name(s) must be added/declared back into the destination/output source-code, (and again, you cannot add your name under those “upstream”/input software’s copyright-holders).1 So far, there is no Transpiler software, that can do complete 100% conversion of large or real-life useful practical projects , human conversion/transpilation is always needed . Usually If you have seen (input) source-code or source-algorithms, and then if you have written / transformed / transpiled those algorithms with your own hand, eye, brain, etc manually by yourself into a DIFFERENT destination/output language based code, here C/C++
, only then, it is a totally new work done/created by you . When you need to transpile propietory functions done by a machine-code binary program(s) then you first have to find another developer-user who will first convert machine-code or proprietory source-code or dissassembed Assembly
source-code, etc into “Algorithms”, flow-chart, etc, etc first , then you can only see that “Algorithms”,etc, (you cannot & must-not see see any source-codes), and then you can write new source-codes (in same or different computer programming language) with your own (human) hand , then such will be treated as “new work”, otherwise it will be treated as a “derivative work”) . So, in such “new work” case, you can add your name as copyright-holder, without adding any input / “upstream” software’s previous copyright-holder(s) name(s) , & you can also use whichever license you prefer, in the output source-code.Some brainwashed or stupid people/users have question, Why this License has so many “restrictions” ? … , …
Does “Freedom/Right Of Speech” allows you to say/speak LIES or harmful things against someone ? NO.
Does “Freedom/Right Of Religion” allows you to disrespect+destroy another religion ? NO.
Does “Freedom/Right of People To Keep and Bear Arms” allows you to kill/shoot someone/anyone ? NO.
…
You cannot do “whatever” or “unethical” or “immoral” things that you want to, with your Freedom/Right, etc.1, 2
CIVILIZED SOCIETY/PEOPLE/COMMUNITY always have restrictions on how much or what you can do with such freedom/Right.
Civilized Society makes sure a Freedom/Right DOES-NOT & cannot allow someone to harm/kill someone-else or steal from someone or destroy something valueable.
…
right ?
…
So why software or freedom of software will have Freedom to be used for KILLING Human, Steal from Human, Destroying Society/Community, Or Destroying Earth Or it’s Elements !? !?
…
All+Everything must have peaceful & balanced “restrictions” in all abilities & where used , for greater benefit & goodness.
…
Those who want to use or help to use something for destruction, stealing, killing, etc , Those type of users will always want “FULL” freedom, etc, and give BIG speech about “FULL FREEDOM”, “FREE”, etc.
Face+Challenge those Anti-Humanity (or Pro-Destruction or Pro-Stealing) type of persons/users . Some of them may look like human being, but all else is completely “evil”.
Transpiler.And.Similar.List : Copyright (C) 2020 atErik (Erik T. Ashfolk).
( Licensed under PeaceOSL(2020) )