Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

把长者语言写进电脑 #1

Open
xiaq opened this issue Jan 18, 2016 · 28 comments
Open

把长者语言写进电脑 #1

xiaq opened this issue Jan 18, 2016 · 28 comments

Comments

@xiaq
Copy link
Owner

xiaq commented Jan 18, 2016

两句诗 西方那一套
a比b不知道高到哪里去了 a>b
a比b跑得还快 a>b
excited exit(0)
I'm angry! exit(1)
资磁、吼啊 True
没有任何的意思 False
无可奉告 None
弄个 throw
大新闻 Exception
大新闻说a Exception(a)
我说a print a
党章 sys.stdout
把a写进b print >>b a
把a批判一番 print >>sys.stderr a
你问我a我当然b我怎么c if a: b; else: c
你们有一个好a报道上出了偏差b还需要c try: a; except: b; finally: c
中国有句古话叫 import
钦定a是b啦 a=b
另请高明 goto
识得唔识得 assert
a有一个好:b lambda a: b
a是属于b a in b
a那个b a.b
什么也不说 None
@ppwwyyxx
Copy link

halang

@xiaq
Copy link
Owner Author

xiaq commented Jan 18, 2016

@ppwwyyxx 我见过这个,但是感觉这个姿势水平不够,还需要多学习个

@summivox
Copy link

不需要\n,因为钦定了

@zshbleaker
Copy link

a 也有责任吧: import a

@Z-Shang
Copy link

Z-Shang commented Jan 23, 2016

a国那个b: a.b
什么也不说:nil

@xiaq
Copy link
Owner Author

xiaq commented Jan 23, 2016

@Z-Shang 不如就用“那个”表示 . 好了……什么也不说这个已收录,excited

@xiaq
Copy link
Owner Author

xiaq commented Jan 23, 2016

@zshbleaker 中国已经有句古话了,得想个别的语义

@pickfire
Copy link

我不知道可以用中文写程序,第一次见。

@wong2
Copy link

wong2 commented Feb 15, 2016

蛤蛤

@aseaday
Copy link

aseaday commented Feb 29, 2016

建议 Regular Grammer 走起来

@aseaday
Copy link

aseaday commented Feb 29, 2016

我当总书记主要做了三件事 stmt
如果还有一点的话,就是 stmt

等价于

{
try 
catch
}

@xiaq
Copy link
Owner Author

xiaq commented Feb 29, 2016

这个语义上略牵强了……

@aseaday
Copy link

aseaday commented Feb 29, 2016

想过 match 不知道怎么表达好

@xiaq
Copy link
Owner Author

xiaq commented Feb 29, 2016

搞成 try/finally 的话语义就好不少了

@aseaday
Copy link

aseaday commented Mar 1, 2016

我好像本来想写的就是这个。脑子短路了。


发件人: Qi Xiao notifications@github.com
发送时间: 2016年3月1日 0:31:25
收件人: xiaq/halang
抄送: bisunday
主题: Re: [halang] 把长者语言写进电脑 (#1)

搞成 try/finally 的话语义就好不少了


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-190278414.

@celeron533
Copy link

基本法-->父类
比如C#里的base
java里的super

@aseaday
Copy link

aseaday commented Mar 6, 2016

应该是 Object 这样的元基类

@ZergZenith
Copy link

当时我就念了两句诗
当时() {
//两句诗
}
等价于
while(){

}

@Andrew-liu
Copy link

Andrew-liu commented Jul 21, 2016

while (true) {
    life++; 
}

@tanktank2010
Copy link

加一秒 = ++
红衣 +=
续一秒 = --
续命 -=
给 =
长者 var

@wpkong
Copy link

wpkong commented Nov 21, 2016

None 也可以是闷声发大财/无可奉告 曰..曰

@wpkong
Copy link

wpkong commented Nov 21, 2016

def 或者 function 叫钦定
钦定 董先生():
+1s

@HAOGRE
Copy link

HAOGRE commented Nov 25, 2016

break叫啥比较好

@AlynxZhou
Copy link

怎么实现呢?语法倒是很不错,不过宏定义怕是解决不了了,要写个语法解析器吗…

@AlynxZhou
Copy link

@HAOGRE break可以叫请喝茶

@duangsuse
Copy link

duangsuse commented Dec 20, 2017

"""
def 月莫
  puts '蛤'
  $stderr.puts ':frog:'
  exit
end
"""

中国有句古话 java.lang.System  记者

新闻 Excited
  记者.exit 0
吼啊

新闻 Angry
  记者.exit 1
吼啊

新闻 月莫
   "蛤"
  愤怒 地说 ":frog:"
  Excited! # vcall a function fn_name!
吼了

会议 Main
  乃无 西方整数 蛤数 钦定为 1
  资资不资资 蛤莱士

  新闻 main(语录多了 args)
    钦定 蛤莱士  

     0 跑到 蛤数
       "+1s"
    吼蛙

    跑遍 args 中的 arg
      连任
        必须问我 arg 苟同 "-1s"
          弄个 大新闻
        吼蛙

        识得不识得 arg 苟同 "+1s"
         "[  ]--[  ] Excited!!!"
      批判 大新闻
        Angry!
      吼了
    吼哇

    开跑 钦定 i  0 演奏 i +1s 赛艇 i 没有 3 
      再续 # next
    吼哇

    连任
      批斗 蛤莱士  不吼
      弄个 大新闻
    批判 大新闻  
      什么也不说
    负责
      你要问我 蛤莱士 吼不吼
        谈笑风生 "Excited!"
      安归
          "Too Young!"
         "Angry!!!!!" 弹奏 记者 的那个 println 
         0 闷声弹奏 记者 的那个 exit
        """ 大概等于
        # 连任
        #   用 0 弹奏 记者 的那个 exit
        # 批判
        #   无可奉告
        # 结束
        """
      吼了
    吼了
  吼哇
吼蛙

现在这点只是微小的工作 🐸( 不过这是一门独立的程序设计语言
打算编译到 MinVM Assembly (当然现在还没时间开发),基本实现 Minlang 的所有功能(当然是OOP)
里面还没有宏的概念( 至于 怒 到 "Too Young!" 这样的还不清楚实现会不会困难
emmm...

@winston-wen
Copy link

西方那一套 <类名>

类似于python的class. https://docs.python.org/3/tutorial/classes.html#class-definition-syntax

obj.碾压()

类似于java的finalize()

见得多啦

类似于foreach

@1604780476
Copy link

苟利国家

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests