To Be an Ecosystem Integratable Programming Language #1989
eminor1988
started this conversation in
Language design
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Sorry for bad English skill...
I just throw an idea.
If there's anybody like this idea, you can modify it and open an new discussion to describe your idea in better English represent.
I wish Carbon can let us write an external code in a "device lambda block".
In my example pseudocode, I used C++11 Raw String Literal style to write the device lambda block to integrating different programming/script languages.
What is a device?
Device is a framework that has its own programming/script language and runtime library(optional) but can pass in/out data by protocol(ABI) from/to Carbon both in compilation time and runtime(optional).
It means device is an one of toolchain/build-process that should be integrated into source code because it is also part of program.
The instance of device should provides compile time function and runtime time function by implement the device protocol.
"Device" is might not a good name, I just picked it.
And the device protocol should be designed as simple as possible.
Two type of devices
Heterogeneous Computing (Internal Device) Example in pseudocode:
Heterogeneous Computing by OpenGL 4.3 (External Device) Example in pseudocode:
Summary:
I did not mention any thought for safety of import device proxy because it is not the point in this idea.
Other useful cases:
Beta Was this translation helpful? Give feedback.
All reactions