Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frontend (command line) examples #235

Open
apfeltee opened this issue May 20, 2023 · 2 comments
Open

Frontend (command line) examples #235

apfeltee opened this issue May 20, 2023 · 2 comments

Comments

@apfeltee
Copy link

The build setup generates and installs a myriad of frontend executables, some native, some scripts, et cetera.

However, nowhere in the wiki, or even the official documentation is ever given decent examples for their use. For instance:

  • identityTranslator is hinted at to be able to transpile source-to-source. I've not found any documentary that explains its use.
    I have of course studied the --help output, and while one might assume that the options -rose:Fortran_output_language (among others) would be the ones, they actually require input language to be the same as the output language.
    There is nothing, no --help text, no manual page, no documentation, that explains how this command is supposedly transpiling anything.
    Maybe it's actually just a sample program; but then, why is it installed globally?

  • rose-cc, and rose-c++, are, as far as I can surmise from the scarce documentation, drop-in replacements for gcc, clang, etc.
    Most frontend commands behave similar to how LLVM clang, or GCC frontends behave: they inherit common options, which little to no hinting at what options are specific to each frontend.

The documentation, scarce as it might be, does include what one could roughly consider examples for transpiling. And by roughly, I really do mean rough: None of them actually translate input source from language $INPUTLANGUAGE to output source language $OUTPUTLANGUAGE.
They appear to do what LLVM Clang's AST rewriting does. Feel free to correct me on this, though.

In short, documentation on these frontends would be useful. While I've been read, grepped, and disseminated the manual pages, documentation, even google to the furthest extend possible, I've yet to actually find anything that properly explains their use.


I know this seems I'm getting hung up on transpiling, and that's mostly because I am: the ROSE framework was recommended for its source-to-source transpiling ability, e.g., from C to Fortran, or vice versa (which, again, I haven't been able to locate).

@pinnown
Copy link
Contributor

pinnown commented May 23, 2023

ROSE does not translate between languages, it is a framework for building tools that do source-to-source transformations. It does function similar to Clang's rewrite mechanism but allows for more arbitrary transformations.

A small project was done years ago to prototype a Fortran to C translator. The project worked on simple functions and was eventually mothballed. https://github.com/rose-compiler/rose/tree/v0.11.90.0/projects/Fortran_to_C

@apfeltee
Copy link
Author

I appreciate the response.
However, strictly speaking, a source-to-source transformation (https://en.wikipedia.org/wiki/Source-to-source_compiler) is precisely what I'm talking about. They are occasionally also referred to as transpilers, but conceptually, it's more of an umbrella term.

But, even so, I still would say that ROSE should need more / better documentation for frontend tools.

The project you linked is interesting, but I wonder how much of source-to-source transformation can be done with the frontend tools. But that would require more information about what they are, and what they do, 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants