本人最近研究语言,并在.net上用C#测试实现。
我把这个语言框架命名为Story,
并希望它最总能够实如其名的理解人的部分语言。向大家介绍一下目前进展。 世界你好程序:
Console.WriteLine "Hello world". #这是注释# 解释运行,交互运行:
可以当作计算器:
>>>1+1
2
>>>5/10
0.5 基于.net内裤:
和.net交互,能够调用.net的类库。
包括你自己写.net的类。
>>>"abcdef".Substring(1)
bcdef 语法通俗,超通俗:
#他是一个学生#
he is a new student.
#他的名字是Jack#
he's name is "Jack". 动态语法和语义,只要告诉它某个语法代表什么语义: #说某话将输出某话#
say(hi) will Console.WriteLine(hi)
#便可以用#
say "Hello world"
#输出 Hello world# 看起来像定义方法,其实不然:
还可以:
#某人说某话将输入某人的名字:说的话#
(sb)say(hi)will print sb's name +":"+hi 这样就可以用:
he say "Hello world!"
#输出:Jack:Hello world# 还可更夸张的定义语法:
#{花括号}表示文本,暂时的语法#
get a {type}will read string.Format("the {0} is a new {0}",type) 有了这个语法就可以:
get a student.
the student say "hello world". 这个意思就是,比如get a student 就会读 the student is a new student
读了the student is a new student它就明白的the student 是什么东西。
就可以直接用the student 说话了。 甚至可以用来定义sql语法:
select{attr}from(table)will dosomething. 希望大家都给个建议。
我把这个语言框架命名为Story,
并希望它最总能够实如其名的理解人的部分语言。向大家介绍一下目前进展。 世界你好程序:
Console.WriteLine "Hello world". #这是注释# 解释运行,交互运行:
可以当作计算器:
>>>1+1
2
>>>5/10
0.5 基于.net内裤:
和.net交互,能够调用.net的类库。
包括你自己写.net的类。
>>>"abcdef".Substring(1)
bcdef 语法通俗,超通俗:
#他是一个学生#
he is a new student.
#他的名字是Jack#
he's name is "Jack". 动态语法和语义,只要告诉它某个语法代表什么语义: #说某话将输出某话#
say(hi) will Console.WriteLine(hi)
#便可以用#
say "Hello world"
#输出 Hello world# 看起来像定义方法,其实不然:
还可以:
#某人说某话将输入某人的名字:说的话#
(sb)say(hi)will print sb's name +":"+hi 这样就可以用:
he say "Hello world!"
#输出:Jack:Hello world# 还可更夸张的定义语法:
#{花括号}表示文本,暂时的语法#
get a {type}will read string.Format("the {0} is a new {0}",type) 有了这个语法就可以:
get a student.
the student say "hello world". 这个意思就是,比如get a student 就会读 the student is a new student
读了the student is a new student它就明白的the student 是什么东西。
就可以直接用the student 说话了。 甚至可以用来定义sql语法:
select{attr}from(table)will dosomething. 希望大家都给个建议。
你用脚本语言的交互执行模式吗?
就是那样的。
现在BASIC还在语言排行榜上名列前茅,
还没过时呢。你说这个是有什么提示吗?
AppleII BASIC? 3+2
5
10 INPUT A
20 FOR I=1 TO A
30 LET SUM=SUM+I
40 NEXT I
50 PRINT A
60 END
RUN
10
55
LIST 20
20 FOR I=1 TO A
CLEAR
PRINT "HELLO"
"HELLO"
OK.
但是Basic的语法我略知一二。
大多数的动态语言(脚本)都能处理这样的功能。
不足为奇。
这个关系到页面的内容,
不用ASP,JSP等嵌入网页的脚本,不好写啊
tipbiz add the from's tip
等我把框框搭好,
我也去看看相关技术。