C++ to xml, byte-code to xml

http://xmlvm.org/overview/

http://www.gccxml.org/HTML/Index.html

大家有冇諗過點解今時今日寫program仲要用plain text?
compiler又要pre-process又要tokenize/parse, lexical analyses...
.h 又要重覆又重覆咁parse (唔計pre-compiled header)  先可以compile到program出黎?
何不用editor直接save as xml, or even更binary嘅format?

當然, plain text 極之方便version control.

Using plain text language for programming because it is more human readable so that it is more easy to write and maintain programs.  Moreover, binary format is not cross-platform as different platforms have different instruction sets and endians.

Using binary format directly will be painful.

PS: XML is also plain text.

[ 本帖最後由 [email protected] 於 2009-9-10 00:49 編輯 ]

TOP

原帖由 [email protected] 於 2009-9-10 00:43 發表
Using plain text language for programming because it is more human readable so that it is more easy to write and maintain programs.  Moreover, binary format is not cross-platform as different platform ...


Be reminded that, I am talking about source program in binary form.
You can always save any xml in binary form, see the idea of .mkv and apple .mp4.
They are quite binary form of xml.

And since I am talking about hardware independent "source code" in binary form.
It is not machine code. It still has to be compiled into machine code for different machines.

TOP

回覆 3# 的帖子

Sorry for mis-understanding your idea.

The idea of "source code" in binary form is already used widely -- Java bytecode.  However, it still need to go through creating/editing text based source file and compiling to bytecode.  Even there is an editor can save to this kind of binary format, the text based source file is still required to modify when changes are needed.

TOP

回覆 1# 的帖子

I don't get it, why XML?

Using notepad to edit the XML file?  
A kind of  special weapon to kill brain cell?

[ 本帖最後由 wifi 於 2009-9-11 00:12 編輯 ]

TOP

原帖由 wifi 於 2009-9-11 00:11 發表
I don't get it, why XML?

Using notepad to edit the XML file?  
A kind of  special weapon to kill brain cell?


when using such structured file format, of course, it is for a special editor, not notepad

TOP