---
title: "ware语言---helloworld大获成功"
author: "suifeng"
date: "2010-10-05T04:18:25Z"
tags: []
categories: ["编程语言"]
slug: "ware-helloworld"
draft: false
lastmod: "2010-10-05T08:23:39Z"
id: 777301
url: "https://pipe-line.iteye.com/blog/777301"
---

## 前言

经过多次改进, ware语言的基础架构基本成型, 为面向应用又迈进了一地步.

ware语言已经实现了网络化开发, 接下来就是全球化的网络开发了, 高兴中.....![](/images/smiles/icon_biggrin.gif)![](/images/smiles/icon_biggrin.gif)![](/images/smiles/icon_biggrin.gif)

想着通过ware语言, 让全球的开发人员一起开发调试程序, 就让人激动不已.

下面的hello world演示了使用 ware语言, 输出 几种流行语言的helloworld程式码.

 

## svn

http://wareware.googlecode.com/svn/trunk/GHCC-1.5

 

 

## helloworld.ware.xml

 

```
<?xml version="1.0" encoding="UTF-8"?>

<helloworld 
	
	xmlns="http://wareware.googlecode.com/svn/trunk/GHCC-1.5/api/helloworld-ware/ware-keywords/helloworld.ware.keywords.xml"
	
	xmlns:c="https://wareware.googlecode.com/svn/trunk/GHCC-1.5/api/helloworld-ware/ware-keywords/c.helloworld.ware.keywords.xml"
	xmlns:cpp="https://wareware.googlecode.com/svn/trunk/GHCC-1.5/api/helloworld-ware/ware-keywords/cpp.helloworld.ware.keywords.xml"
	xmlns:java="https://wareware.googlecode.com/svn/trunk/GHCC-1.5/api/helloworld-ware/ware-keywords/java.helloworld.ware.keywords.xml"
	xmlns:python="https://wareware.googlecode.com/svn/trunk/GHCC-1.5/api/helloworld-ware/ware-keywords/python.helloworld.ware.keywords.xml"
	xmlns:ruby="https://wareware.googlecode.com/svn/trunk/GHCC-1.5/api/helloworld-ware/ware-keywords/ruby.helloworld.ware.keywords.xml"
	xmlns:lisp="https://wareware.googlecode.com/svn/trunk/GHCC-1.5/api/helloworld-ware/ware-keywords/lisp.helloworld.ware.keywords.xml"
	>
	<!--  c language -->
	<c:printf>
		main() {
		    printf("%s\r\n", "hello world!");
		}
	</c:printf>
	
	<!--  c++ language -->
	<cpp:std>
		<cpp:out>
			<![CDATA[
			
				#include <iostream>
				 
				int main()
				{
				    std::cout << "Hello, World!" << std::endl;
				    return 0;
				}
			
			]]>
		</cpp:out>
	</cpp:std>
	
	<!--  java language -->
	<java:System>
		<java:out>
			<java:println>
				<![CDATA[
					public class HelloWorld
					{  
					        public static void main(String args[])
					        {
					           System.out.println("Hello World!");
					        }
					}
				]]>
			</java:println>
		</java:out>
	</java:System>

	<!--  ruby language -->
	<ruby:puts>
		<![CDATA[
			puts 'Hello, World!'
		]]>
	</ruby:puts>
	
	<!--  lisp language -->
	<lisp:write-line>
		<![CDATA[
			(format t "Hello, World!~%")
		]]>
	</lisp:write-line>
	
	<!--  python language -->
	<python:sys-stdout-write>
		<![CDATA[
			print("Hello, World!")
		]]>
	</python:sys-stdout-write>
</helloworld>
```

 

 

## ware开发模型

 

```
三组联合开发模式core, api, app
   core---核心开发组---ware语言运行平台开发, 提供ware语言运行环境, api加载, app的运行
   api---api开发组---ware语言api开发, 以插件方式提供给使用者
   app---应用开发组---ware语言使用者, 在core和api的环境下开发应用
```

 

 

## 运行

java -classpath dom4j-2.0.0-ALPHA-2.jar;jaxen-1.1.3.jar;ware.jar ware.core.boot.Boot helloworld.ware.xml

 

依赖的jar包: http://wareware.googlecode.com/svn/trunk/GHCC-1.5/core/ware-core/lib  
源代码helloworld.ware.xml : http://wareware.googlecode.com/svn/trunk/GHCC-1.5/app/helloworld/ware-code/helloworld.ware.xml

只需要下载核心包, api里面需要的class在google code 的服务器上, 运用 URLClassLoader自动下载执行

 

## 运行结果

![](http://dl.iteye.com/upload/picture/pic/73480/ff291ebc-ae05-398e-a7c8-2c72de1002bd.png)

 

 

 

## 下载执行

[ware\_helloworld\_demo.zip](http://wareware.googlecode.com/files/ware.helloworld.demo.zip)