473,883 Members | 1,576 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

On-the-fly compilation and execution of C++ program

Hi,
we are designing some stuff , that will generate c++ program(s)
What we want is we wanted to execute that generated code....

i.e.
1. Xml based language
2. C++ code generated from 1.[Its mapping between 1 & 2]
3. compilation
4. execution.

What we have got stucked at compilation, we want that our user should
not take care about compilation or c++ code generation etc...They just
write some xml "code" and it should execute !

[we are developing something like Event processor, reactor system etc]
-Raxit

Jun 27 '08
16 4277
Ra***@MyKavita. com wrote:
What we have got stucked at compilation, we want that our user should
not take care about compilation or c++ code generation etc...They just
write some xml "code" and it should execute !
That thing has existed for over 50 years and is called "Lisp".
Jun 27 '08 #11
On Jun 2, 4:04 am, James Kanze <james.ka...@gm ail.comwrote:
On Jun 2, 7:47 am, Walter Bright <wal...@digital mars-nospamm.com>
wrote:
http://www.digitalmars.com/dscript/index.html

That's actually a very good suggestion. Javascript, perl,
python, and probably a couple of other languages have
interpreters which you can directly link into a C++ program.
Add Lua to that list. The Lua/C interface is modeled as a stack of
value-typed variables, and it's incredibly easy to integrate into C or
C++ projects.
Jun 27 '08 #12
On Jun 2, 4:28 pm, Matthias Buelow <m...@incubus.d ewrote:
Ra...@MyKavita. com wrote:
What we have got stucked at compilation, we want that our
user should not take care about compilation or c++ code
generation etc...They just write some xml "code" and it
should execute !
That thing has existed for over 50 years and is called "Lisp".
Lisp can execute XML? (I'll bet it couldn't 50 years ago.)

Just about any interpreted language can, at least in principal,
take a string and execute it---I've even seen some Basic's which
can do it. Compiled languages, like C++, typically don't carry
the weight of a compiler around with them. About the only thing
special about Lisp (and its dialects, like Scheme) here is that
is remarkably easy to compile, so the extra weight is
considerably less (although the executable for scheme, on my
system, is still more than 3.5 MB). Historically, of course,
Lisp was the first interpreted language.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #13
James Kanze wrote:
Lisp can execute XML? (I'll bet it couldn't 50 years ago.)
No, but it's been pointed out that the only fundamental difference
between Lisp and XML is that Lisp can be executed.
Jun 27 '08 #14
James Kanze wrote:
Lisp can execute XML? (I'll bet it couldn't 50 years ago.)
:)

What I wanted to say is that the rôle that "executable XML" is supposed
to occupy is traditionally (and imho, much better) filled in by a Lisp
dialect of some sorts. They have a head-start of almost 50 years on XML
and Lisp S-expressions are (imho) more readable than XML.

The idea, of course, being that instead of somehow trying some awkward
construct to turn XML into C++ and feed that to an external compiler and
then load the generated object file (or somesuch), it might be more
productive to use S-expressions instead of XML, and embed a Lisp system
in the (C++) application.
Jun 27 '08 #15
Walter Bright wrote:
No, but it's been pointed out that the only fundamental difference
between Lisp and XML is that Lisp can be executed.
Or as John McCarthy says: "XML is isomorphic to the subset of Lisp data
where the first item in a list is required to be atomic."

(http://www-formal.stanford.edu/jmc/cbcl2/node4.html)
Jun 27 '08 #16
On Jun 3, 1:38 pm, Matthias Buelow <m...@incubus.d ewrote:
James Kanze wrote:
Lisp can execute XML? (I'll bet it couldn't 50 years ago.)
:)
What I wanted to say is that the rôle that "executable XML" is
supposed to occupy is traditionally (and imho, much better)
filled in by a Lisp dialect of some sorts. They have a
head-start of almost 50 years on XML and Lisp S-expressions
are (imho) more readable than XML.
Yes, but Lisp isn't "in", and XML is. So obviously, a new
project can't use Lisp, and must use XML.
The idea, of course, being that instead of somehow trying some
awkward construct to turn XML into C++ and feed that to an
external compiler and then load the generated object file (or
somesuch), it might be more productive to use S-expressions
instead of XML, and embed a Lisp system in the (C++)
application.
And XML probably maps easier into Lisp than into C++. (There is
a basic simimlarity of structure.) So you can still keep the
XML to show to the customer, and be in, and use a Lisp
interpreter to do the real work:-). (Most of the time I've had
to generate code automatically, it's been mainly tables, and
nested structures do map fairly easily into C++, although if the
structures are dynamic, you end up needing a lot of pointers.)

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
Jun 27 '08 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
3520
by: Chris Krasnichuk | last post by:
Hello every one, Does anyone know how to make php work on your computer? please reply I need help Chris
20
11685
by: Chris Krasnichuk | last post by:
hello, Does anyone know how I make php work on "my" computer? I made a mistake in my last post so I fixed it here. Chris
2
3721
by: Patricia | last post by:
I am a new Oracle user. I am trying to install Oracle 9i Personal Edition on Windows ME; however, I am getting the following error during the installation: Oracle Database Configuration Assistant failed during install. Error message: java.lang.NoClassDefFoundError: com/inprise/vbroker/CORBA/ObjectException in thread "main" at oracle.sysman.assistants.dbca.backend.Host.<init>(Host.java:437) at...
57
25552
by: Bing Wu | last post by:
Hi all, I am running a database containing large datasets: frames: 20 thousand rows, coordinates: 170 million row. The database has been implemented with: IBM DB2 v8.1
1
1397
by: gndzkdr | last post by:
hi all, i m new on Sql and i have a project related to C# and Sql. i have to do a project which must work on LAN, and there must be only one database file on main computer(Server Computer) and other computers(client computers) must connect database on main computer. i m preparing my project on my personal computer(it is called MYCOMP) and doing connection with wizard. then it doesnt work on other
7
3978
by: SHC | last post by:
I'm in need of some javascript to load two pages into two seperate iframes which are on two seperate and different pages. Rather complicated I know (and easier done in one frameset), but caused by some limitation issues of SharePoint. To help:
8
7663
by: PhongPham | last post by:
Hello, Info relate: OS : uclinux Platform : unix version 2.4.22 (or 2.4.26) Chip on board : ARM7 I want to get a python package on network to "make" in linux (Fedora core 1 or anything if it maybe done) and run python on board with above info .After I made package 2.2.3 and 2.5.2 of Python, I tried run on board such: ./python <script> with <script> is a script file and get error : BINFMT_FLAT: bad magic/rev (0x1010100, need...
8
9391
by: Lemune | last post by:
Hi, I'm developing window service application on C# 2005. The service is to read a new excel file on certain directory, and process it to database. The service work find on XP. But when I install the application on Windows Server 2003, when i start the service it said: "The <my serviceon Local Computer started and then stop. Some service stop automatically if they have no work to do , for example ,
19
4236
by: pmw | last post by:
Hi I've got a problem with my current application. I currently use Windows Vista with Visual Studio Express 2008. If I compile the application on Vista, it works fine on Vista, but it doesn't work on XP. If I compile it on XP (with the same source code ), it runs without any problems. The thing is: I only have a virtual machine to test my software on XP, but I can't develop on it.
16
2907
by: tvnaidu | last post by:
I have these two ON and OFF buttons html code below, based on condition I am displaying status on screen(I have mutliple lines for each LED), my row shifting when some displaying ON and some displaying OFF, because ON button is smaller than OFF (ON is 2 character and OFF is 3 character), Is there anyway I can specify for both should take fixed length?. <input type="button" value="ON " style="background-color: #00cc00; color: #ffffff;" /> ...
0
11137
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10845
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10412
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9571
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7970
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5797
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5990
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3231
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.