Discussions in support of the LOLCODE.com wiki
You are not logged in.
Hey I iz workin on a lolcode header, from the stuffs I got on lolcode.com, and I needz help. I is havin trouble wif variables and printf.
my changed version of lolcode.h:
#define GTFO break;
#define HAI {
#define KTHXBYE }
#define DIAF(x) exit(x);
#define IZ(x) if( (x) )
#define MOAR_THAN >
#define SMALR_THAN <
#define LIEK ==
#define UP +
#define NERF -
#define TIEMZ *
#define OVAR /
#define UP_VAR ++
#define NERF_VAR(x) x--
#define YARLY then
#define NOWAY else
#define STUFFS int
#define START main()
#define VISIBLE(x, y) printf(x "\n");
#define O_NOEZ VISIBLE("Damn you. Now I just lost the game",);
#define I_HAS_A int
#define NUM_OF
#define IM_IN_YR(x) while(1){
#define IM_OUTTA_YR(x) }
#define ORLY else
#include <stdio.h>
#include <iostream>
//feel free to add to this
and what I did:
I_HAS_A cheezburger;
NUM_OF cheezburger = 10;
VISIBLE("%d cheezburgerz left!", cheezburger)
Can anyone help me?
Offline
Unfortunately, the C preprocessor isn't powerful enough to handle LOLCODE in its entirety. Source-to-source translation IS possible, and in fact is how I'm planning on implementing my own interpreter, but it will require a proper parser and compiler rather than just simple string replacements like the C preprocessor can provide.
Still, nice. ![]()
Offline
Thanks-It's helping me learn lolcode and C, too!
So lolcode is supposed to be more powerful O.o?
I just wish there were more people serious about LOLCODE.
Offline
It's not a question of "power," although LOLCODE is more powerful than C. In this case, it's more simply the differences in the way the languages are structured. LOLCODE is just too different to be able to use simple macros to translate it into C; you need something more intelligent to perform the translation.
By the way, why are you using the 1.0 spec? ^^()
Edit: Correction. LOLCODE has the POTENTIAL to be more powerful than C, but without a full set of standard libraries, the currently accepted spec can't do everything you can do in C. The 1.3 spec, plus a standard library that has yet to be defined, will produce a language that should be at least as powerful as Python or Java.
Offline
hehe...because I'm more comfortable with it...
[/sheepishgrin]
Well I'll be monitering the advances (although I'm not seeing much on the forums OR the wiki) and will try to update it better.
Offline
Right now, most of the development is going on between JoshSuereth and I, and we're taking a break from LOLCODE proper to develop a related language we're calling Protocopter, which should be a whole heck of a lot easier to implement but will be functionally identical to LOLCODE, and once we have that we'll define LOLCODE's reference implementation in terms of it.
Offline
Alright...so should I start converting the header to 1.3?
Offline
I'd just go for 1.2 if you're using C. 1.3 is heavily object-oriented and you couldn't do it in C++ without a LOT of work -- definitely more than a stack of preprocessor macros.
Offline
Heyz!
I actually have an update!
It's not as great as that new interpreter that was just announced, but it's a project I'm still not giving up!
(Mainly because I would like to use LOLCODE in my C++ projects)
Right now I have, with a little help, the basic data type and a half-working form of bukkitz
Version 0.9 Stable
Included is a sample program that just shows off what it CAN do.
Offline
A .exe file? Noooo way, not touching that one. Even if I HAD Windows I wouldn't download an .exe file. How about a .zip containing the C++ bindings and the examples so I can compile them myself?
Offline
Oh...yeah, sorry about that. I forgot about how some people are exellergic.
It's not really much of an example...but it shows most of the features.
I'm having trouble with using the default data type to use strings, so I just typedef'd YARN to std::string. Does anyone have suggestions?
The other problem is, again, BUKKITZ. If you try them you will crash the program when it's supposed to end. I'm looking into it right now.
Also, I renumbered the versions...It's definitely not v0.9 and DEFINITELY not Stable.
Version 0.7.5 Beta
Offline
OMG!
We now have a dropbox-message me with your email if you want to join.
You'll get all the latest update in real time, and even be able to help improve LOL++.
Don't worry about someone editing everything into deletion, it automatically has a backup feature.
(I have all past releases and a current release, and I only have 1% of my 2gb that I get taken up!)
All files are stored locally and updated automatically, so no need to worry about redownloading files.
Speaking of, we have a new release, http://dl.getdropbox.com/u/285110/20081223.zip
This new version fixed several errors that were in the last version, and has a built-in versioning system for backwards compatibility with old programs made with an older header.
Offline
http://dl.getdropbox.com/u/285110/20090124.zip
Latest release, has many updates.
Hope you guys like it, let me know if there are any errors.
EDIT:
I've posted this on Chief Delphi for FIRST robotics...some people were interested.
Last edited by Demosthenes2k8 (2009-01-24 19:27:07)
Offline