Because Jake can't work on the compiler right now so we have nothing to do but work on the syntax and think up features. He doesn't have a computer until maybe christmas. We are looking for someone to help him with it so we can get started sooner.
Printable View
Because Jake can't work on the compiler right now so we have nothing to do but work on the syntax and think up features. He doesn't have a computer until maybe christmas. We are looking for someone to help him with it so we can get started sooner.
There lies the awesome point.Quote:
Originally Posted by |2eM!x
chem
Okay, if that is how you guys feel, then what do you suggest we do?
I am TOTALLY open to suggestions. It bugs me that we aren't moving anywhere at the moment also, but what can we do without out a key team member? If we assign the compiler to someone else at this cirtical stage then we are making a big decision. That person holds a lot of huge decisions in their hands and are joining the team late (unless its someone who has been following this thread).
Does anyone have any ideas?
I don't know how far Jacob got with the compiler/linker, but not very far I presume, so it wouldn't be too big a deal. Once he has his computer he can get back working on it again.
I disagree. The big decisions should be made at this stage when the language is still in design phase ;)Quote:
Originally Posted by eyeRmonkey
Also, obviously if the compiler is going to be open-source, then the language has to be a standard of some sort (so that others can develop compilers for it). so words to that effect need to be written somewhere.
Not sure what you were reffering to in the last paragraph when you you said "words to that effect."Quote:
Originally Posted by penagate
I asked some questions near the beginning of this post. Could I get some feedback?
He means that if LightFusion is oging to be open source (which we assume it will be), then a standard must be produced. We don't mean a standard be produced in your head, we mean write it down, and post it on the original Post.
chem
I'm not the one who is writing a standard in my head. That was Jake last time I checked. I posted a .doc with all the syntax rules that have been suggested a few pages back. Obviously that is not sufficient to count as a standard but we are not far enough and have not made enough decisions to have anything that could count as a standard at this point. But, as penagate pointed out, that is probably something we should be working on now.
I feel a lot of critisism coming from the few people who are reading this thread. You guys keep saying we aren't doing what we need to be, which is fine, but I would really like to hear some suggestions (such as: "You should make a standard for the language") instead of "You shouldn't be doing this or that".
Chem, you keep posting things to the effect of "get to work" but every time I ask for suggestions I don't get any replies (Post #885).
You guys can't expect that we should know what we are doing. We are a bunch of chickens with our head cut off because we don't have any professional training and we are just a bunch of friends who came together for a project. Why should we know what we are doing?
Now obviously that isn't an excuse to not be organized and not try to do our best, but we need constructive critism (and we get some) not things like "Why dont you get it working first?"
I hope you guys can understand where I am coming from on this.
The point of all this is to learn something from making a programming language. That's what we n00bs at this intend to do. We are not experts at this. But based on our programming experience, I feel it's very possible that we can pull this off. :)
Penagate, could you continue the discussion of your ideas for making everything property based or give me an example or something like that? I would like to make a decision on it eventyally since that is probably the better thing to do at this point.
Here is a syntax conversion of some code originally posted by Wossy:
Quote:
Originally Posted by WossName
And here is the LF conversion:
As far as I'm concerned, semi-colons are back in.Code:static bool UserGameLoop()
{
//USER has to guess the computer's number
Random r = New Random;
int lower = 0;
int upper = 999;
//Console.Clear();
Console.WriteLine("Guess the computer's secret number, between 0 and 999, (enter 'Q' at any time to quit)");
int CPUNumber = r.Next( lower, upper ); //computer chooses a number between 0 and 999
int userNumber = 0;
int attempts = 0;
string scratch; //accepts user input before parsing
double userDouble = 0; //holds the raw number
do
{
userNumber = Console.ReadInput;
if ( Vars.TypeOf(scratch) = lfDouble )
{
Console.WriteLine( "Quitting..." );
Return False; //quit the game
Exit;
}
if ( userNumber < CPUNumber )
Console.WriteLine("{userNumber} is too small, try a LARGER number.");
if ( userNumber > CPUNumber )
Console.WriteLine("{userNumber} is too LARGE, try a smaller number.");
attempts++;
} while( userNumber != CPUNumber );
Console.WriteLine("Congratulations, you guessed {CPUNumber} correctly in {attempts} attempts.");
Return True; //success
}
I'm unsure about the following:
* Class for Random stuff (should it be a class?)
* Class for Vars (should it be Vars.TypeOf()?)
Penagte, how long until the small logos will be ready so I can put them into the icon? How about a thin banner like you made before (except now based on the most recent version).
Does anyone have any idea how we can find someone to work on the compiler?
You call that a LF conversion? :ehh:
Looks more (or actually all) like C++. We were designing LF to be sort of like a cross between VB and C++ with a twist of our own style, and we were most certainly eliminating the semicolons.
Jake, well what would your conversion look like then? The whole point of doing this is to iron out the syntax (I guess its more like sew it together, not iron it out :)).
Why am I so easily swayed on the issue of semi-colons. I guess it is a pain to type them out. It will be harder to parse, but if you do make the parser then I guess its your choice.
i would say that typing one extra character per line is not much effort, considering the benefits in code readability and ease of parsing.
There's a superfluous Exit call in the conversion. Unless Return no longer returns immediately.
It won't be any more difficult to parse. The new line character is invisible to us, but not the computer when converted to bytes, and would be no different than the semicolons. I'd parse it right now and show you, but I only got like 10 minutes of my lunch break at work left. :(Quote:
Originally Posted by eyeRmonkey
I guess it depends on how you view Return. I was thinking of it as FunctionName = (value). I guess Return is different than that.Quote:
Originally Posted by CornedBee
Once again, how would your coversion look like in LF?Quote:
Originally Posted by Jacob Roman
What would the sytax look like for a set of code that is all on one line then? As in multiple lines on one line. In a C-ish language it would look like this:
Code:b = 10; c = "start"; d = ALPHA_2
Hi there!
This project looks awesome! I'm writing my own parser/interpreter at the moment (Which i'm then going to convert to a compiler).
Are you going to use lex and yacc? or Flex and Bison for all you windows users? It will make your life SOOO much eisier.
-Girvo
Girvo, I'm pretty sure we will be be using Flex and Bison, but at this point we don't have a team member on the compiler (at least not for a month or 2) so we are looking for someone to join the team. At this point we are going no where. The IDE is coming along slowly, but is totally pointless this early on and even more pointless without a compiler.
Current To-Do List:
* Make some decisions on syntax.
* Begin taking small VB projects and translating them to LF code to help us in making decisions for LF sytnax.
* Find someone that wants to work on the compiler (and help Jake with the compiler once he gets his computer up and running).
Once again, I changed my mind on the subject. It wouldn't be hard at all to have the IDE insert the semi-colons for you (because it will already be doing a lot of other operations automatically). That is the best of both worlds IMO. Readability, easy parsing and easy coding.Quote:
Originally Posted by Jacob Roman
What do you guys think of that?
Would you like me to help with the compiler? I'm ok with Flex and Bison. But, you might want to keep the same person working on the compiler the entire time so...
-Girvo
The only hard part I could see with this project is actually figuring out how to convert the parser into a compiler. I was thinking somewhere along the lines of parsing the language into C/C++ then having a C/C++ compiler do the hard work for us. Perhaps we could think of doing that?
We would like to have the same person working on the compiler the whole time, but that might not be a realistic possiblity at this point.
You seem like the perfect person for the job, but do you honestly feel you have the time/energy to put a month or 2 of work into this project? If you have the time, then you will most likely get the position.
As long as you want to help we are glad to have you. Especially with your previous experience with Flex and Bison.
Before we were thinking of parsing into ASM and using an asm compiler (MASM?) to do the work for us (we are trying to make the compile the fasted code possible). Jake thought about parsing into C++, but we need a free C++ compiler (perferablly open source) to use. Free assemblers are easier to come by. What are your thoughts on this?
Well, ASM would be faster, but C++ would be easier. I know of a great free C++ compiler that we can use: MingGW. You might have heard of it. I use it along with the Dev-C++ IDE, and its better than VC++ :D
Anyways, 2 months of work...hmm...I would love to do it but I have school work todo, and I'm not really meant to use my laptop during the week. BUT, this would be a great experince, and definatly a step up form my scripting language: SIMPLE. (ps. I'm working on a language at the moment called ModBAS, a step up from basic towards C/C++).
I would love to try and help in any way possible. Sign me up ;)
-Girvo
MinGW would be perfect as far as I can tell. I don't know a WHOLE lot about it but I can do some research. It is licensed under the GPL right?
What is the Dev-C++ IDE?
I'm in school too so I feel your pain on that note. I also have a girlfriend so that brings my programming time down to near 0, but I still manage to squeeze out some results.
So you think your up for this? You will be starting us on the most important aspects of the compiler so you have a lot of power in your hands. I guess the parser is where we need to start, though.
Translating into C++ is fine because we can inline asm (or can you not do that with MinGW)?
I'll download MinGW and Flex and Bison later today and look around so I can get a feel for what you are working with.
Have you read the whole project thread (or most of it)? I think it would help if you did. You might also want to read the threads that are linked to at the bottom of the first post.
As long as Jake and Penagate don't have any problems with it, then I'm pleased to say Welcome Aboard!
I don't have a problem with it. We need as many team members as we can get anyways to get this project in gear, so we don't risk situations like I'm in. It's gonna take more than one or two people to work on the compiler and linker anyways since it's so difficult to work with.
And I sorta have a girlfriend myself, only I'm not in a relationship. All we ever do is....yeah you know ;)
brag? :DQuote:
Originally Posted by Jacob Roman
On a (more) serious note, why emit C++. C would be easier, and a bit closer to assembly so it would be easier to turn into a full assembly-emitting compiler later down the track.
Not terribly closer, but I see what you mean.Quote:
Originally Posted by penagate
EM: The Dev-C++ IDE is exactly what it says, an IDE. Last time I had a look at it you needed to supply the compiler, which is probably why Girvo is using MinGW with it..
chem
Re MinGW, this is the page you will be interested in.
MinGW is not itself a compiler however. It is merely a library and collection of header files. It includes the GCC compiler, which is of course distributed under the GPL. The MinGW runtime library is, as far as I can tell, freely distributable and modifiable without any licence terms.
Emitting C sounds like a good compromise.Quote:
Originally Posted by penagate
I couldn't find anyplace to download it from that link, just a crap load of documentation that I will never have time to read (even though I really want to at least read some of it) because of the my current homework load.Quote:
Originally Posted by Penagate
I'll search some more for a place to download stuff at.
how hard would it be to convert an OOP language like lightfusion into a non-OOP language like C?
Not very hard. The original C++ compiler, Cfront, emitted C. Still does, in fact.
Why can't I find a place to download the GNU compilers? Yesterday was the 2nd or 3rd time I have looked for a place to download them at, and all I can find is a "List of successful builds". Where can I find a link to directly download them? How about for MinGW?
Hi there.
C would be eisier seing as that C is Flex's default output language. If you would like to see what tools I am using, then check out this site: www.bumblebeesoftware.com and www.bloodshed.net
I am using Parser Generator which pretty much gives you an IDE for Flex and Bison. Pargen uses its own version however, which can output to C,C++, and Java, depending on what you would like.
Bloodshed has the Dev-C++ IDE, which in my opinion is the best there is.
Anyways, if you would like me to buyild a simple parser for LightFusion, one that doesn't do much, but has the bare basics, then I'll get to work on it. If someone could provide me the syntax.
For example, could someone translate what this would look like in LightFusion:
Notice that this is just a simple program. If you could give me the LightFusion syntax for this, I can make a working parser that could make programs like this.Code:#include <iostream>
using namespace std;
int main()
{
cout << "Hello world!\n";
int x=5;
int y=10;
area = x*y;
cout << x << " times " << y << " equals " << area;
if(x<y)
{
cout << "X is smaller!\n";
}
else
{
cout << "Y is smaller!\n"
}
}
-Girvo911
I just had an idea.
Instead of having the error checking built into the parser (very frustrating), what if we had it built into the IDE itself? It would run a scan over the code before it even gets sent to the parser. The parser would include some basic error checking, I can't avoid that. But the IDE could handle all of the more fiddly stuff.
What do ya think?
You can probably only have very limited error checking without performing a lot of the steps needed for compilation.
For example, you need to know the Type of every expression to check for type mismatches. You need to know which variable an identifier refers to if it's inside multiple block statements. You need to know the definition and type of a function to determine if the proper number and types of arguments are being passed to it.
Basically, you need a parse tree to perform any sort of definative error checking.
GNU itself only provides GCC in source form. You can find a list of mirrors here:Quote:
Originally Posted by eyeRmonkey
http://gcc.gnu.org/mirrors.html
Then you have to navigate to the release you want, e.g. for 3.4.4 at the Austrian University of Technology:
ftp://gd.tuwien.ac.at/gnu/gcc/releases/gcc-3.4.4/
Installation instructions are here:
http://gcc.gnu.org/install/
Be warned: installing GCC from source is not trivial.
Probably every Linux distro has GCC packaged somehow, though, making this process a lot easier.
MinGW, now ...
MinGW seems to be just as complicated. There's supposed to be a one-file installation, but it's hard to find it. The instructions are here:
http://www.mingw.org/download.shtml
I believe you need to scroll down to the "Proposed" section and get " MinGW 5.0.0". It seems to be an installer. However, running under Linux right now I can't test this.
You could also get Cygwin, which allows you very easy installation of MinGW. But there's a lot of bloat coming with that.
While it's always nice to have as much error detection in the IDE as possible, it's a very bad idea to remove it from the compiler. That would mean that the compiler depends on the IDE to keep bad code from it, which means it can't run standalone. Which is not good.Quote:
Originally Posted by Girvo911
That's not to mention that this means that either the compiler part is extremely unstable (because every coding error would probably make it crash - and incidently, since the compiler depends on the IDE for checking, it will probably be part of the same process and thus crash that, too!) or programmed extremely defensively, to catch all bad input - so you're validating code correctness anyway, just probably in a way that makes it impossible to provide meaningful error messages.
Net gain: none.
Net loss: stability, meaningful error messages, running standalone.
Girvo, I'm downloading ParGen and Dev-C++ as we speak.Quote:
Originally Posted by Girvo911
Have you read the whole thread? I really think you should. You can skim over it and just focus on parts dealing with syntax, but I think it will give you a better idea of what we are after.
There have been a few attempts recently to convert code from any language to LF, but we aren't totally in agreement about everything. I attached a .zip with all the documentation I have relating to syntax. You can take a look at it.
The only problem with the more recent syntax conversions we have done is that we aren't in agreement about some stuff, but you can work off the basics I suppose.
I was actually hoping I wouldn't have to do a ton of error checking in the IDE. Or at least not until later down the road. As a few people have already said, the parser/compiler probably need to be able to do this, even though it is probably a pain.Quote:
Originally Posted by Girvo911
CornedBee, thanks once again for you input. CornedBee
Jake, if you didn't like that most recent sytnax conversion I did, then you REALLY need to do your own so we can see how you envision the syntax.
I ran across this while downloading a bunch of stuff today: http://sources.redhat.com/gdb/
Its the GNU debugger. We aren't really to the point of using it yet, but I thought I might throw it out there so we all know its available. I might save us some more work.
Okay then. I'll have a PROPER read through. I read like the first 4 pages, then skipped to the last ;)
So you would like the error checking built into the parser? Ok then. That shouldn't be TOO hard.
Do you know what the only problem with this is? I've never written an OOP language before. I'm finding out about it as we speak.
Heres a useful site for you all, if you would like to learn a little bit: http://groups.google.com/group/comp.compilers