LOLCODE
LOLCODE | |
---|---|
Paradigms : | Esoteric , imperative ( procedural ), structured |
Publishing year: | 2007 |
Designer: | Adam Lindsay |
Developer: | Adam Lindsay |
Current version | 0.10.5 (April 21, 2014) |
Important implementations : | C , JS , .NET, etc. a. |
Influenced by: | Lolcat |
Affected: | ArnoldC, LOLPython |
lolcode.org |
LOLCODE is an esoteric programming language (based on the internet jargon Lolspeak of the humorous internet phenomenon Lolcat ) and was developed in 2007 by Adam Lindsay at Lancaster University . The language is not clearly defined in terms of syntax and operators, but there are various functioning interpreters and compilers .
Structure of the language and examples
Below is an example of a Hello World program in LOLCODE:
example 1
HAI 1.2 CAN HAS STDIO? VISIBLE "HAI WORLD!" KTHXBYE
code Comment HAI [VERSION]
A LOLCODE program begins with the section HAI ("Hi!") And ends with KTHXBYE. At the commandHAI the version number of LOLCODE is also specified, which is currently not evaluated by all implementations. CAN HAS [LIBRARY]?
In many programming languages one of the first commands is to include a library for the standard commands such as B. Input and output. The command for this exists in LOLCODECAN HASwhich is currently being ignored. VISIBLE [MESSAGE]
Returns the text from the field MESSAGE or the "String" on the screen. KTHXBYE
With the HAI Section starts a LOLCODE program with KTHXBYE this section is ended. KTHXBYE "K," means "THX," and "Bye" means "OK, thanks, bye".
Example 2
HAI 1.2 CAN HAS STDIO? PLZ OPEN FILE "LOLCATS.TXT"? AWSUM THX VISIBLE FILE O NOES INVISIBLE "ERROR!" KTHXBYE
This example introduces the commands for file handling ( PLZ OPEN FILE "NAME"?
- "Please open a file named" NAME ""), and error handling ( AWSUM THX
- "Great, thank you", and O NOES
- "Oh no!").
Other commands used are to declare variables, ("variable [is] value") for value assignments to a variable, output error messages with instead of , and ("by the way") to introduce a comment that is ignored by LOLCODE.
I HAS A variable
variable R value
INVISIBLE
VISIBLE
BTW
Loops begin with and end with . Loops are terminated with the command ("enough") or, in older versions, with . Loops can also be exited with the command .
IM IN YR label
IM OUTTA YR label
ENUF
GTFO
IZ
Example 3
HAI 1.0 CAN HAS STDIO? I HAS A VAR IM IN YR LOOP UP VAR!!1 VISIBLE VAR IZ VAR BIGGER THAN 10? KTHX IM OUTTA YR LOOP KTHXBYE
This simple program displays the numbers 1 through 11 (specification 1.0). The same program according to specification 1.2 looks like this:
HAI 1.2 CAN HAS STDIO? I HAS A VAR IM IN YR LOOP UPPIN YR VAR TIL BOTH SAEM VAR AN 10 VISIBLE SUM OF VAR AN 1 IM OUTTA YR LOOP KTHXBYE
Implementations
The first implementation was written in PHP by Jeff Jones . This parser's website was also the first website to use LOLCODE as a scripting language . Further implementations are:
- .NET compiler for LOLCODE (a project by Nick Johnson)
- PL / LOLCODE for LOLCODE as a PostgreSQL integrated server-side programming language (a project by Josh Tolley)
- LOLCODE implementation by Microsoft for testing purposes
- Converter for LOLCODE to JavaScript
- LOLCODE compiler for the Parrot virtual machine
- LoLCode 1337 compiler including virtual machine and debugger in C
- Version for parallel and distributed computing with LOLCODE
Similar projects
- LOLPython (developed by Andrew Dalke) uses commands based on LOLCODE, but in a syntax similar to the Python programming language. LOLPython translates the source code into Python code.
- ArnoldC is a further reference to LOLCODE and uses (instead of the lolspeak -like syntax) quotations from various Arnold Schwarzenegger films.
Current reception
HackerRank , an international network of competing programmers (headquartered in Palo Alto ), launched a programming competition in LOLCODE for January 2016. In March 2017, LOLCODE was also used at Cornell University to teach the programming models Single-Program Multiple-Data and Partitioned Global Address Space , the entertaining structure of this programming language making it an appealing communication tool for a student body who grew up with Internet memes ( Meme-based learning ). Since no support for parallel computers or distributed systems was provided for esoteric programming languages up to now , appropriate compilers and plug-ins were programmed within the scope of this project , which should even be scalable for supercomputers . The developers plan to publish these as open source resources and explicitly recommend them for use for didactic purposes.
Web links
- LOLCODE - An esoteric programming language. Retrieved September 18, 2017 (English).
Individual evidence
- ↑ github.com .
- ↑ Franz Graser: Software Development - The 10 Most Bizarre Programming Languages. Vogel Business Media, July 11, 2011, accessed September 18, 2017 .
- ^ First Parser Comment . Lindsay.at. Retrieved June 9, 2009.
- ↑ LOLCODE .NET compiler on Google Code
- ↑ PL / LOLCODE
- ^ Charles Torre: John Lam and Martin Maly: Deep DLR. March 24, 2008. Retrieved September 18, 2017 (Channel 9 on MSDN ).
- ↑ LolCode . Fullvolume.co.uk. Retrieved June 9, 2009.
- ↑ A LOLCode compiler for the Parrot Virtual Machine . GitHub. Retrieved June 20, 2009.
- ↑ LoLCode 1337 .
- ^ Parallel and Distributed Computing with LOLCODE .
- ↑ LOL Python . Dalkescientific.com. June 1, 2007. Accessed June 9, 2009.
- ↑ ArnoldC - A programming language based on the one liners of Arnold Schwarzenegger. Lauri Hartikka, accessed September 18, 2017 .
- ↑ It's Elementary 2016 - Surprise Language Contest. HackerRank, accessed September 18, 2017 .
- ↑ David A. Richie, James A. Ross: I CAN HAS SUPERCOMPUTER? A Novel Approach to Teaching Parallel and Distributed Computing Concepts Using a Meme-Based Programming Language. (PDF; 292 kB) Cornell University Library, March 29, 2017, pp. 1 ff. , Accessed on September 19, 2017 (English).