Language Design: Basis

Programming, for all ages and all languages.
Schol-R-LEA

Re:Language Design: Basis

Post by Schol-R-LEA »

Nope, those haven't been defined yet. However, since there does not seem to be much consistency in how different BASICs handle User Defined Types, I thought it would be better to put it up for discussion as to how they should work in Basis. Especially if an unconventional approach might prove better than an existing one (unlikely, but possible).

We also need a decision on how to resolve the pointer/access issue.

Besides that, I would like more feedback on the existing material, to make sure that it is all accpetable, and to see if there was else important that I've missed. Once I we've agreed that all the important details have been covered, I'll go ahead a gather the existing BNF into a single comprehensive grammar.
Schol-R-LEA

Re:Language Design: Basis

Post by Schol-R-LEA »

Pardon the thread necromancy, but...

For now, I'd like to propose the following User Defined Type mechanism, similar to the one QBasic and VB; alternatives are welcome.

Code: Select all

<user-defined-type> ::= "TYPE" <type-name> <newline> <declaration-list> "END TYPE"

<declaration-list> ::= <declaration>+
I'm not sure that a class mechanism would be appropriate; if one is used, I definitely think it should not be like that in VB. Any other opinions?
minotaurcomputing

Re:Language Design: Basis

Post by minotaurcomputing »

"I'm not sure that a class mechanism would be appropriate"

So would you propose accessing the UDT structure elements directly, as in:

PRINT MyTypeVar.myelement

or would autogeneration of accessors be more appropriate, ala:

PRINT MyTypeVar.getMyElement

-m

#
# http://www.minotaurcomputing.com
# http://www.modus-ponens.com/blog
#
Schol-R-LEA

Re:Language Design: Basis

Post by Schol-R-LEA »

The former, I think; autogenerated accessors isn't really n line with what is supposed to be a very minimalist systems language comparable in semantics to C but using Basic-like syntax.

Is anyone else still interested in this? If so, I'll go ahead an collect the existing grammar - the parts most of us agreed upon, that is - into a single document (I'll probably re-work it as ABNF for consistency's sake) and post it on my website. More can be added to it as needed; I doubt that we'll have everything we need in the first implementation, anyway.

We might want to set up a Sourceforge site for the project once we've settled some more basic issues, but doing so now would probably be premature - not that that ever stopped anyone, but still.
Post Reply