LOLCODE: Part 4, A New Beginning

Time to LOLCODE. Watching the forums, it’s fun watching the definition of a programming language where the grammar is obvious.

And I’ve also thought of a great, quotable reason to use LOLCode:

Nick Hodge, Enthusiast Evangelist for Microsoft, recommends the investigation of LOLCODE as Enterprise-worthy Programming Language if your development project has a strong requirement to entertain future system maintenance engineers, and your present development team gets LOLCATS humor.” You can quote me on that.

What was not immediately obvious, another effort is to make your lines of LOLCode funny. Careful choice of variable names should result in LULZ.

There were a few occasions where I had a peek at the C# source code of the LOLCode compiler. It will be interesting to see how much of the engine that makes the compiler is taken over by the new DLR, and how hard/easy it is to create a domain specific language. The DLR contains mainy of the infrastructure pieces, such as creation of abstract syntax trees, etc.

Note that these examples compiled with LOLCODE.Net Build 35, and are based on the 1.2 specification.

First program: Hello World

HAI
VISIBLE “hello world”
KTHXBYE

What’s going on here? HAI is the indication of the beginning of the lolcode app; KTHXBYE is the end.

VISIBLE “hello world” prints out, well, hello world.

Second program: Getting Input

HAI
    I HAS A FLUFFYZ
    VISIBLE “ur namez is?”
    GIMMEH LINE FLUFFYZ
    VISIBLE “hello “!
    VISIBLE FLUFFYZ
KTHXBYE

So, what’s going on this time?

I HAS A FLUFFYZ– declares a variable called FLUFFYZ

GIMMEH LINE FLUFFYZ– gets some input, in this case from the keyboard

The exclamation mark at the end of the VISIBLE “hello “! keeps the printout on the same line

VISIBLE FLUFFYZ prints out the content of the variable FLUFFYZ. Simple

Third program: Looping, Conditionals

HAI
I HAS A LIFE ITZ 1
I HAS A OSCARZ ITZ 10
IM IN YR HEADSPIN UPPIN YR LIFE TIL BOTH SAEM LIFE AN OSCARZ
    VISIBLE LIFE
IM OUTTA YR HEADSPIN
KTHXBYE

This code example should work; it compiles in lolc but neatly stops when running in the CLR. The new parts are the assignment of a value to a variable (I HAS A LIFE ITZ 1)

Secondly, the line  “I am in your loop increasing your LIFE until both-the same life and OSCARZ” is a simple loop with increment and a test.

The “IM IN YR HEADSPIN” is an example/attempt at humor. HEADSPIN is the name of the loop. Crafting these names to something funny will provide a future code maintenance geek some LULZ in the future.

Blogger’s Lounge at TechEd

Happy Caturday Everyone!

Next week (actually, from Caturday for me) is TechEd.

This year, Zaakera is over from Microsoft US to capture the spirit of TechEd in a video-bottle for release on Virtual TechEd.

Also, we have a “Blogger’s Lounge”. WTF? Oh, and there’s a Blogger’s lunch

This is an area on the Exhibition Floor where I will be with my laptop, talking to people. All are welcome, bloggers or not. Chat, photos, linking up. We’re keeping it a little less structured so anything could happen.

Oh, and I’ll be storing your “The Geek Stories” for publishing http://on10.net/

late night edit geek

Let’s just Blame Windows.

Adobe Premiere and Photoshop are a critical part of the application set I use daily to produce videos and online content. Therefore, I (actually Microsoft) owns an Adobe Production Premium to edit and create all my thegeekstories.com

Some months ago, I installed a beta of Adobe Soundbooth CS3. And a beta of Adobe Premiere Pro CS3. In retrospect, probably this was the root cause of my headache.

Having installed my new Production Premium on my Vista laptop; Setup.exe brings up a notice that SoundBooth CS3 could not be installed as I had previously used a Beta. OK, using the Adobe supplied WinCS3Clean script (written in Python, BTW), I de-installed everything and attempted to install a fresh.

No go. None of the applications that make up the Suite would install. “Components Failed to Install”

Reading the installer help support files suggests using msconfig.exe to restart without startup applications; no go. Restart in safe mode (F8 at startup) and install. No go. Move the installer DVDs (4x) onto the hard drive and install from this image. No go.

This time, it is my usual practise has been to “blame the OS” (note: even the install notes for Creative Suite CS3 on MacOS X runs to 23 individual points!) . Launch the Setup.exe as Administrator. No go. Run WinCS3Clean as Administrator, and use the Windows Install Clean Up. No go. Log into the Microsoft network just in case there is some weird Group Policy thing on my account. No go. 

Finally, I stumble across this on the Adobe support site: “License has Expired” . Right; my serial number has already been recorded and the apps cannot be installed again. Whilst not the exact error I was seeing, it seemed to be where I was ultimately at as the next step.

It worked.

What the? I notice that there are a couple of steps prior to removing this file. Re-installing onto another PC “as a test” and most probably re-installing your whole OS . If I hadn’t removed this cache file, I may have resorted to a complete OS re-install step.

The problem ultimately was Adobe’s draconian and flawed install process. Not the OS. I want my 24 hours of lost productivity back, please.

If I had reinstalled the OS, yes the problem would have been fixed. But it’s like opening an almond nut with a H2 Hummer going at 100. It will surely solve the problem; but lesser force and better information earlier can open the nut, too. And save lots of time and a barrell or two of oil.

Oh, and as a part of my near scorch the earth clean up, I de-installed Acrobat 8 Professional. Having not used Professional for anything apart from reading PDFs in the last 6 months, I am not going to re-install it.  Using the .xps format printing out stuff I need to keep is great.

How does someone who doesn’t have a day to install software navigate this? How does someone who hasn’t been installing Windows and Adobe applications for 10+ years get through this?

Mind Migration: Orcas / Visual Studio 2008 Beta 2 and LOLCODE.net

aka: I CAN HAS EAT FREEWILLY NOW?

before reading this: note I am a scripter at best; and am learning C# and all the Microsoft tools. I know more than I’ve done which means I am super dangerous. Doing this is purely an experiment in what is possible, not what really should be done to ensure that the world cools down so whales don’t get eaten by Orcas.

Why LOLCODE.net? Does the world really need another obscure programming language?

Why doesn’t the world have one standard language. You know, like French or English?

The brain is a strange thing. Language helps people communicate ideas, or memes, from one person to another.

Programming Languages are more formalised as they map to a very binary computer underneath. No memes here.

Making a programming language from a meme is an attempt to bridge the LULZ we have in our head to the mundane art of punching in zeros and ones. Esoteric programming languages r0x0rz

Enough esoteric blathering on languages as noone cares and onto my personal LOLCODE  journey.

http://lolcode.com/ is LOLCODE central, where the language is being formally specified (more formally than Ruby, albeit less functional. Pun, get it?)

Orcas. Sort of like a black-and-white cat of the sea that eats seals, but has no paws. Orcas are pretty smart beasties. Love eating the tongues of whales. Funny code name for Visual Studio 2008. For this, I’ve installed beta 2.

LOLCode.net. Grab the .zip file from the archive and pop into a directory “c:program fileslolcode”

Readme.txt:
This distribution includes the compiler (lolc.exe), compiler library (lolcode.net.dll),
standard library (stdlol.dll) and code samples.

Read the readme. Hmm, according to the Readme and the LOLCODE forum, “We’d need MSBuild support and a VS extension“. Quick live.com search on msbuild. Ah, msbuild is a build platform. Gotcha. Visual Studio extention.  Now that looks harder.

Might just stick to the documentation and use command line. Firstly, let’s stick the directory into my %PATH%

OK, run cmd

type cd c:Program FilesLOLcode

Let’s be brace and just lolc fulltest.lol   (that is, compile the .lol file fulltext.lol)

Error at line: 2. “Library ‘STDIO’ not found” (line sez: CAN HAS STDIO?)

Probably best to go from source. I’ve been putting this off for months: it’s time for an SVN client for Windows. Off to TortoiseSVN so I can download a build.

Using TortoiseSVN checkout http://lolcode-dot-net.googlecode.com/svn/trunk/ Revision 35 at the time of posting.

Double-click on the .sln file (Visual Studio solution file) and convert to VS2008.

Ahh, 51 compile errors and 17 warnings. Need NUnit. http://nunit.org/ here I come. Installed, and 0 compile errors, 11 warnings. Forget the warnings. If they were serious, they’d be errors. Coolio. Set my code to generate a Release version.

Again, run cmd

cd C:Program FilesLOLcodelolcbinRelease

lolc test.lol

Success! I have a test.exe

test

Number guessing game. I CAN HAS LOLCODE, compiled from source.

 

Technorati Tags: , ,

Want to be famous? Go large at Virtual TechEd 2007

virtualteched.gif

Virtual TechEd will be at TechEd Australia. This is a major coup as Microsoft continues to evolve the TechEd format.

As you can see from the existing content on Virtual TechEd, if you have something to say to the world: now is the time to stand up and be interviewed!

Comment here/send me an email and we’ll schedule you in.

Also, I’ll be at the Blogger’s lounge with video camera, laptop and a wireless connection. Come and have a chat!

Sydney Twitter Meetup, 25th July 2007

All tagged Flickr photos here: http://flickr.com/search/?q=stub+twitter&m=text

My First iPhone

Thanks to http://twitter.com/cathye for organising us twitter-erz to actually get off our keypads/keyboards and have a meatspace meetup. Subscribe to http://twitter.com/stub for more info.

So, http://twitter.com/jjprojects http://twitter.com/funkycoda and myself now have the responsibility to organise the next meetup. 3 blokes doing it is dangerous.

Also, thanks to our sponsors for sponsoring.

Geek Trivia Night: The Web

Thanks for the invite, Cheryl. Arrrgh: I am missing Web Trivia night in Sydney as I am at TechEd. LOLCODE is getting priority!

 

Web Trivia Night – Sydney
Know who invented the internet? Any ideas what WWW stands for? Clued up on who the first blogger was?

If so, keep August 9th free, as News Digital Media and Web Directions are hosting a night of networking for fun and profit on August 9 at the Vault Hotel in Sydney. Compete with your peers in a world first: a trivia night where all the questions will focus on the web, tech, and online life.

http://www.webdirections.org/2007/07/22/geek-trivia-night/

There’ll be free drinks and food and all manner of awesome prizes, so be sure to RSVP now as numbers are most certainly limited. Don’t worry about forming teams or otherwise, this will all get sorted out on the night. Just bring yourself and your friends, and a bag to carry home all your bounty.

What: Web Trivia Night
When: August 9, from 5.30 for 6.15 start
Who: Anyone who thinks they could have a stab at answering the question “Who invented the internet?”
Where: Downstairs at the Vault Hotel, 122 Pitt St Sydney
Map: http://tinyurl.com/2cxfq3
RSVP: maxine@webdirections.org