Welcome Guest [Log In] [Register]

[ Copy this | Start New | Full Size ]
Add Reply
LOLCODE
Topic Started: Mar 1 2009, 12:22 PM (514 Views)
SpaceMan
Member Avatar
Administrator
[ *  *  *  * ]
LOLCODE is an esoteric programming language that resembles Lolcats speech. This is the "Hello World" program:
Code:
 

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE


The first like HAI starts the program, the second like CAN HAS imports library STDIO, and the VISIBLE keyword is like print in BASIC or Python.
The last like, KTHXBYE ends the program block.
BTW starts a line comment.

Variables:
Code:
 

HAI
CAN HAS STDIO?
I HAS A variable ITZ 12
VISIBLE "The variable is ", variable
KTHXBYE


It prints The variable is 12. The I HAS statement defines a variable.

LOLCODE official site: http://lolcode.com

LOLCODE Java Virtual Machine language plan.

I'm going to implement a LOLCODE compiler that can be used to make Java programs(but not Java classes), it uses IN TEH and GO method WIT args! to call methods.
The following program is Hello World program in LOLCODE for Java:
Code:
 

BTW filename: Hello.lol
HAI Java
CAN HAS * IN TEH lang IN TEH java? BTW import java.lang
GO println IN TEH out IN TEH System WIT "HAI WORLD!"
KTHXBYE

It will generate the following Java code:
Code:
 

class Hello {
private static class $INTERNAL {
//........... many reflection stuff..............
private static Object call(Class ret, String name, Object ... args) {
//................
}
private static Object construct(/* ........... */) {/*......................*/}
}
public static void main(String[] args) {
$INTERNAL.call(String.class, "java.lang.System.out.println", "HAI WORLD!");
}
}
Posted Image
Offline Profile Quote Post Goto Top
 
Cultred
C-Rank
[ *  *  *  * ]
lol wow... LOLCODE... I might attempt its use sometime.
Firefox rules. Okay? Live with it ;)

I made this signature before DM. Oh well :)
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Esoteric Programming Languages · Next Topic »
Add Reply