Skip to content

Interesting concept and simple implementation, what if... #1

@mcanthony

Description

@mcanthony

The subject of transpilation of arbitrary source seemed to be taboo until ecmascripten shook things up. I stumbled onto this project and wondered if I could ask your thoughts on something that has been nagging me for some time.

I am working on a project where a whole lot of algorithmic code is used. The project will be in the form of an "isomorphic" code-base which intends to be able to support its operation purely from the browser, unless a node environment is available, in which case it would leverage node in order to operate without security/performance limitations imposed by the browser.

This would operate in the same manner as a progressively enhancing UI would - except in this case it is progressively enhancing features not related to UI enhancement such as direct file-system access, and native code execution in the form of node extensions.

This is the part that I would like to use a project somewhat like this to accomplish. Here is the ideal goal and how I would intend to implement it:

Portions of the code-base in the form of loosely coupled modules dealing exclusively with algorithmic computation, or in some cases file I/O (perhaps more, I have not thought of the possibilities and what limitations may arise). Your idea of using TURN to infer and inflect types would come in handy here... Would I would like to do is be able to dynamically trans-pile eligible modules into C++ from JS without modification. I would like it if the only required step was to specify which modules and/or objects should be targeted for "progressively enhancing trans-pilation" - and the result should be such that their original interfaces are available now as if they are part of the native JSAPI, where everything would operate as normal with no further specification... The JS implementation of these modules serves as a front-line/fallback for browser based execution, and as a reference implementation for the generated equivalent node-extensions.

Perhaps this idea is too far fetched or possibly not very useful as this step could be done ahead of time... The project I have in mind is a sort of IDE, so it seemed like it would be neat if I could arbitrarily add modules to the code-base and automatically allow for native execution where possible, without a thought to hand crafting node-extensions.

Now that I have typed it out for the first time I am not sure if it would be as cool as it seemed to me before... Sorry if this is not an appropriate or preferred forum for this discussion, and don't sweat it if you don't want to get into analyzing my crazy thoughts! Any comments, advice, or harsh criticism would be welcome anyway...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions