The Direction of FreeBasic development...

For other topics related to the FreeBASIC project or its community.
rolliebollocks
Posts: 2655
Joined: Aug 28, 2008 10:54
Location: new york

Postby rolliebollocks » Nov 26, 2008 14:14

I do agree with your logic on the teaching end just because having python first would make the transition to C++ and Java and Perl that much easier.

However, if its beauty you seek there's been a lot of wonderful poetry written in the last couple millenia, which I read when I seek beauty.

At any rate, the OO features of FB are super simple to learn. The TYPE takes the place (more or less) of all C++'s data structures, and I've heard whispers that soon FB will feature inheritance.

Having followed the development of FB now for a bit, the strategy seems to be to make a free OOP BASIC compiler which is capable of making high quality executables, is backward compat with QBasic, and implements the OO power of modern languages.

Here I don't agree. It was made to be taught ... 40+ years ago. Basic is not good for teaching now. It is not consistent. It is a stack of procedures, each with its own syntax.


Ok - I agree - but FB is good for teaching now, and the #1 reason is because it wouldn't require any money down for a educational establishment to teach to its students. And if uniformity and simulation are a part of your conception of "beauty" then I don't think you should be teaching anyway...

The capability of a procedure to be called in specific/multiple/condition dependent ways is part of what makes BASIC powerful. The mere fact that the syntax is mutable and procedure dependent makes it more similar to natural language than logic based PROLOG or set based (LISP) which more based on what an Academic considers natural as opposed to "Joe the Plumber".

By the way, I have a copy of a LISP interpreter written in FreeBASIC... It's really cool. My LISP scripts can now call other LISP scripts. Yay.

At any rate the conception of beauty you have, I find it rather dubious and frightening.

:)
fabrizio
Posts: 73
Joined: Sep 29, 2006 13:39
Location: Roma, Italy

Postby fabrizio » Nov 26, 2008 14:30

Thanks for your explanation. "Beauty is in the eye of the beholder".

I agree that more formal languages tend to be distant from the natural language. More formal languages are easier for parsers, not for humans.

Still, I think they make good objects to be considered and explored. Which, in a teaching environment, is more important than building quick solutions to problems.

Just that. (Be reassured, though, I don't teach programming :)

BTW I'd be interested if you posted the LISP in FB (I have one in C and one in Python, and I would like to consider the differences among the three. Thanks!)
marcov
Posts: 3020
Joined: Jun 16, 2005 9:45
Location: Eindhoven, NL
Contact:

Postby marcov » Nov 26, 2008 15:28

McLovin wrote:Hi Marcov,

Just curious as to why you believe that maintaining a BNF grammar file would be more difficult then maintaining the actual rules in the code base itself.


You are not constraint by yacc's pattern matches, and can easier use context.

Also it is easier to insert places where errors should be generated.

I see your point about maintaining backwards compatibility as new versions are released, but I also see that as being easy to maintain via BNF.

New BNF's can be added and existing ones easily extended without breaking existing rules and backwards compatibility.


No, since you might have to split rules, multiply them to get all odd associativity and precedence behaviour etc.

I think it would be easier to follow the changes via a BNF grammar file than trying to wade through mountains of parser source code for the changes and quirk handling.


Just try it is the only remedy if you don't believe me. Since FB has some legacy, multiple dialects and the works, it is a nice candidate to show off GOLD.

Start, and maintain it for a while, and you'll see.

Once modified the tables are regenerated and automatically added to a template file that beomes part of the compiler.


That's with all LALR generators (admitted, some generate .C source, but that is not a real problem). The expressiveness is, specially when atrophy sets in.

'm not trying to be difficut here - just trying to understand all angles of this. Maybe I'm missing something big. Maybe there's stuff that simply can not be modelled via BNF? I read the Barry Kelly comments in your google link - thanks. Maybe I am just being naive but I believe that a properly formalized grammar should not allow things like keywords being treated as identifiers. The BASIC language should be more easily modelled than the langauages that he works on.


Well, the problem is that you abolish everything that is not allowed, you don't end up with language that people actually use, but with a crispy, nice, and most importantly, unused, compiler packaged with some thesis.

I have reviewed the compiler source code. I can follow it (been a programmer for over 20 years) but this is the first time that I have ever done any compiler work and it is pretty refreshing and exciting.


Do you have errorhandling in your first attempts already ? Do you generate specific errormsgs for that really indicate the problem in the right spot with the right diagnosis?

Another problem is what if you can check if an identifier (constant) is defined in the preprocessor part of the parser ? E.g. in Delphi, as you can see in those msgs, parser and preprocessor are partially interweaved.

The one time I tried, that was one of the problems. Another was making exceptions for precedence (disambiguation between boolean AND and logical AND)
rolliebollocks
Posts: 2655
Joined: Aug 28, 2008 10:54
Location: new york

Postby rolliebollocks » Nov 26, 2008 18:30

http://freefile.kristopherw.us/uploads/rolliebollocks/lisp-2008_08_01-win32.zip

I am somewhat reluctant to post it because I cannot seem to find the homepage anywhere online. I downloaded it this weekend, and I figured I'd be able to find it again vis a vis the name of the zip/the author's name:
Jeffery R. Marshall. But anyway, what are you going to do? If I'm asked to take it down I'll take it down. Otherwise I'm hoping Mr. Marshall doesn't mind.

fabrizio wrote:BTW I'd be interested if you posted the LISP in FB (I have one in C and one in Python, and I would like to consider the differences among the three. Thanks!)
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Postby AGS » Nov 26, 2008 21:07

Off - topic message deleted.
Last edited by AGS on Dec 03, 2008 0:35, edited 1 time in total.
coderJeff
Site Admin
Posts: 3343
Joined: Nov 04, 2005 14:23
Location: Ontario, Canada
Contact:

Postby coderJeff » Nov 26, 2008 21:12

rolliebollocks wrote:... I cannot seem to find the homepage anywhere ...


heh, that was a fun one to write. The first version was back when FB was taking some of it's first steps with adding OOP stuff.

My DL page here:
http://www.execulink.com/~coder/freebasic/lisp.html

And an (old) thread here:
http://www.freebasic.net/forum/viewtopic.php?t=8765

That's cool that you tried it out and had some fun with it. License is same as FreeBSD, so no problems on redistrib. :)
rolliebollocks
Posts: 2655
Joined: Aug 28, 2008 10:54
Location: new york

Postby rolliebollocks » Nov 26, 2008 22:07

I'm still playing with it. Now I know who direct my questions to! :)

I want to do like a "move the robot" demo using the inline parser. I thought it was the coolest thing I've seen in long time. Thanks for sharing. I especially like how you don't have to recompile the lib every time you add a command. You only barely have to know lisp to use it.

I'm going to hook it up to a GUI so, I'll post it when it's done. I'll call it
"3 Bathic". :)

coderJeff wrote:
rolliebollocks wrote:That's cool that you tried it out and had some fun with it. License is same as FreeBSD, so no problems on redistrib. :)

Return to “Community Discussion”

Who is online

Users browsing this forum: No registered users and 6 guests