|
 |
Darren New schrieb:
>> I found a program (I forget what it did) that was runnable in multiple
>> languages simultaneously...
>
> I saw that. And not similar languages. Like, javascript, awk, Haskell,
> and C++ or something.
I actually encountered something close to this in real-life work: It was
a file designed to be included in both a C program and a makefile, to
define certain constants.
And typically, pulling this off is even easier if the languages are
quite different, as the most typical way to do it is by having one
language see comments where the other one doesn't.
For instance, to fuse POV-Ray SDL and Lua code, you can use the
following pattern:
#version 3.7; /* (Lua ignores first line if it starts with "#")
-- Lua code goes here
--[=[ */
// POV-Ray SDL code goes here
// ]=]
Post a reply to this message
|
 |