每周源代码11-LOLCode DLR版

During my Friday Keynote at the PNPSummit I did a silly 30 minute PowerPoint that ended with some LOLCats and a few examples of LOLCode. If you're not familiar with LOLCats, they are basically silly pictures of cats that speak a l33tspeak-like language, like IM IN UR BASE KILLIN YUR D00DS.

在我周五基调在PNPSummit我做了一个愚蠢的30分钟的PowerPoint一些结束大笑猫和几个例子LOLCode 。 如果您不熟悉LOLCats ,它们基本上就是说似l33tspeak语言的猫的愚蠢照片,例如IM IN UR BASE KILLIN YUR D00DS。

This language has turned into a Programming Language called LOLCode for which there are already at least TWO .NET implementations. The first implementation of LOLCode.NET is up on Google Code and is by Nick Johnson.

这种语言已经变成了一个编程语言称作LOLCode为此,已经有至少两个.NET实现。 LOLCode.NET的第一个实现是在Google Code上进行的,由Nick Johnson进行

During my talk, unbeknownst to me, literally that minute John Lam was uploading the DLR team's own implementation of LOLCode implemented from scratch on the DLR. The amazing Martin Maly of the DLR team implemented LOLCode on his plane ride to Spain for presentation at TechEd.

在我不为人所知的谈话中,片刻John Lam正在上传DLR团队自己的LOLCode实现,该实现是在DLR上从头开始实现的。 DLR团队令人惊叹的马丁·马利( Martin Maly )在飞往西班牙的飞机上实现了LOLCode,以在TechEd上进行演示。

I invited John up on stage spontaneously to give a demo of LOLCode and he did...he showed a Fibonacci implementation.

我自发地邀请约翰上台进行LOLCode演示,他做到了...他展示了斐波那契实现。

This is great code to read for two reasons. It's two completely separate implementations of the same general idea - an LOLCode compiler. However, they are implemented completely differently. Of course, the DLR team images this as a Dynamic Language so their implementation is a great primer on how to make your own language on the DLR.

这是一个很棒的代码,有两个原因。 这是同一基本思想的两个完全独立的实现-LOLCode编译器。 但是,它们的实现方式完全不同。 当然,DLR团队将其想象成一种动态语言,因此它们的实现是如何在DLR上编写自己的语言的很好的入门。

HAI

CAN HAS STDIO?
VISIBLE "HAI WORLD!"

I HAS A CODE ITZ "CRAZY"
VISIBLE CODE

I HAS A NUMBR
LOL NUMBR R 2
VISIBLE NUMBR TIEMZ 2

I HAS A FIB
I HAS A A ITZ 1
I HAS A B ITZ 0

VISIBLE "Fibonacci: "
GIMMEH FIB

IM IN YR
    VISIBLE B

    IZ FIB SMALR 1?
		YARLY
			GTFO
	KTHX

    I HAS A TEMP ITZ A UP B
    LOL A R B
    LOL B R TEMP

    NERFZ FIB!!
KTHX

CAN HAS System?

VISIBLE CurrentDirectory ON Environment ON System
NJU Hashtable ON Collections ON System
I HAS A HT ITZ IT

I HAS A DT
LOL DT R DateTime ON System
VISIBLE Now ON DT

COL Add ON HT WIT "LolCode" AN "Rulezz!!"
VISIBLE COL get_Item ON HT WIT "LolCode"

COL Concat ON String ON System WIT "LolCode " AN "Rulezz!!"
VISIBLE IT

KTHXBYE

In order to get the DLR Team's implementation running on your own machine, you need to do the following:

为了使DLR团队的实现在您自己的计算机上运行,​​您需要执行以下操作:

  1. Get the LOLCode sources

    获取LOLCode源

  2. Get IronPython 2.0 Alpha 6

    获取IronPython 2.0 Alpha 6

  3. Get the Gardens Point Parser Generator (GPPG) 

    获取Gardens Point Parser Generator(GPPG)

  4. Get the Gardens Point Scanner Generator (GPLEX)

    获取Gardens Point Scanner Generator(GPLEX)

    Get the Gardens Point Scanner Generator (GPLEX) These are kind of Lex and Yacc for C#. Open up the Parser.y and Scanner.l to see the language grammar details.

    获取Gardens Point Scanner Generator(GPLEX)这些是C#的Lex和Yacc。 打开Parser.y和Scanner.l以查看语言语法详细信息。

  5. Confirm the PostBuild steps point to the right locations and make sure the Microsoft.Scripting.dll reference points to the Microsoft.Scripting.dll from the IronPython download.

    确认PostBuild步骤指向正确的位置,并确保Microsoft.Scripting.dll参考指向IronPython下载中的Microsoft.Scripting.dll。

Enjoy! If you don't think this is fun, go play with the MVC Demo Source Code from DevConnections and the PNPSummit.

请享用! 如果您觉得这不好玩,请尝试使用DevConnections和PNPSummit的MVC演示源代码

翻译自: https://www.hanselman.com/blog/the-weekly-source-code-11-lolcode-dlr-edition

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值