Jump to content

cross languagues

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
SimonBoris

SimonBoris

    Newbie

  • Members
  • Pip
  • 5 posts
Hi everybody, it's me again, thinking about weird stuff, again...

I was wondering if it was possible for a language like javascript to embed C or C++ code so it could be executed by the javascript interpreter made in C.

I do not wish to call a C method using javascript, i just want to create a program and send it to the C interpreter so it could be executed.

After all, it's all text! no?

Does cross languagues can be achieved?
Thx

#2
technica

technica

    Learning Programmer

  • Members
  • PipPipPip
  • 63 posts
may be you are building some wrong logic OR may be you are talking about .net technologies.

#3
Guest_Jordan_*

Guest_Jordan_*
  • Guests
It sounds like it is a huge security risk and I'm not sure that it would be allowed but this article shows that you can execute shell commands. You could write the C++ code to a file and execute a compiler. However, they might not have a compiler installed or you may not know which one.

Aside from that, there is no way to "embed" c/c++ code in JavaScript to be executed by the compiler that I know of.

#4
SimonBoris

SimonBoris

    Newbie

  • Members
  • Pip
  • 5 posts
Yes it would a big security risk...
but i only think about technical possibilities,
i do not wish to annoy people with male enhancement system :)

But i was wondering if C or C++ had a equivalent to the eval method in JS and if it could be detected by the Compiler just by reading the code embedded in the javascript and execute it.

I am not a C programmer and cannot make test since i do not even have access to any javascript engine, thats why i am asking.

Thanx again for your time.

#5
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
In theory, you could write a C/C++ interpretter in JavaScript, but that sounds like a true nightmare.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog