Author Topic: Ozapell Basic  (Read 1075 times)

Transdiv

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Ozapell Basic
« on: 15. December 2016, 06:14:25 »
This is a new Retro/Minimalistic Basic I found on steam:

http://store.steampowered.com/app/523410/

It's not free, and one of his targets is to teach Basic to newbies.

One of his strange sintaxis is that to declare an Array they use:

MYARRAY=0
ARRAY=MYARRAY
RANGE=100
DIM

The variable MYARRAY is declared and given the value of 0. The ARRAY variable is given MYARRAY. RANGE will specify how many entries will be in the array. DIM changes the variable MYARRAY into an array containing 100 entries with the value of 0 in each.

The idea is not to use symbols to avoid confusion in newbies (not sure I agree on this).

wang renxin

  • Newcomer
  • *
  • Posts: 36
    • View Profile
Re: Ozapell Basic
« Reply #1 on: 15. December 2016, 08:44:35 »
I partially agree with this. I think BASIC has less symbols (and concepts behind symbols) than the C language family, and this is more friendly to newbies. But its array grammar is over simplification.

The idea is not to use symbols to avoid confusion in newbies.

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Re: Ozapell Basic
« Reply #2 on: 15. December 2016, 10:49:53 »
its array grammar is over simplification.

No, it's over confusion. This is clear:
Code: [Select]
  Dim MyArray$()
  For_ ct=0 To 9
Let MyArray$(ct)="This is string #"+Str$(ct)
  Next

The word DIM (or Dim or dim, as you like) stems from "dimension", and it indicates that a variable (in this case: a string) has at least one dimension. So it requires a feature that tells the compiler/interpreter how much it has to go in direction X; that feature is called a "counter".

Only the "geniuses" at Richmond, Seattle, were able to distort this utterly simple common language principle by forcing users to declare non-dimensional elements as Dim My$

Now the Ozapell guys are still introducing something completely new and original. The only problem is that their syntax has absolutely no added value. Probably they just weren't able to teach their parser how to recognise the coder's intent to declare an array  8)

Mike Lobanovsky

  • Full Member
  • ***
  • Posts: 162
    • View Profile
    • Freestyle BASIC Script Language
Re: Ozapell Basic
« Reply #3 on: 15. December 2016, 11:18:20 »
... distort this utterly simple common language principle by forcing users to declare non-dimensional elements as Dim My$

Not a very good example of non-dimensionality IMHO. Of all simple non-array data types, String has the strongest "x axis dimensionality" and is the one that's so close to the concept of an array that in fact almost all HLLs don't distinguish it from an array of characters. ;)
Mike
____________________________________________________________________________________________
(3.6GHz i5-3470, 16GB RAM / 2 x nVidia GTX 650Ti SLI-bridged, 2GB VRAM / x64 Win 7, x86 elementaryOS Luna)

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Re: Ozapell Basic
« Reply #4 on: 15. December 2016, 11:29:06 »
Why are you using then two different words, "string" and "character"?
In the same logic, would you call an integer an array of bits?

Dimensionality creeps in when you have more than one element of the same type. More than one integer (each composed of 32 bits). More than one string (each composed of characters).

One could argue that strings are arrays of characters. In that logic, Dim MyCharacters() would make sense.

But Dim My$ is just confusing VB syntax; they probably introduced this monstrous syntax because ignorant coders had the tendency to use new variables all over the place without declaring them first; which almost certainly introduces difficult to chase bugs, especially if variables are case-sensitive. So the Microsh**t guys abused good ol' Dim to force coders to declare their variables, so that further down the compiler could bark at them if it hit an undeclared one. Bad technology, dumb compiler.

In GfaBasic, for example, you had no need to declare variables, but the editor would bark at you if you tried my$="hi" instead of a previously used My$="ho": It would show you a MsgBox asking "declare new variable my$?". An intelligent feature, and you could even switch it off in the early stages of a proggie, when you were creating lots of new variables.

How do you handle that in FBSL? In MasmBasic, SetGlobals and Enum (further down) can be used, and Masm itself asks for declarations of the type MyInt DWORD 123 or My$ db "hi", 0.
« Last Edit: 15. December 2016, 11:50:31 by jj2007 »

Mike Lobanovsky

  • Full Member
  • ***
  • Posts: 162
    • View Profile
    • Freestyle BASIC Script Language
Re: Ozapell Basic
« Reply #5 on: 15. December 2016, 11:44:17 »
Because a one-character string is indistinguishable from the character it contains, the term "string" is effectively just an alias to the term "array of characters". The notions of a "string of WORDs" or "string of DWORDs" are largely machine-code and MASM-specific and shouldn't IMHO be projected mechanically into the realm of high-level languages. :)

What's much, much more confusing about vanilla BASIC in the beginners' eyes is its stubborn adherence to parentheses to denote access to the individual array elements. C-family brackets for array indexing, and parentheses, for function call parameters, are clear and concise while BASIC parentheses for both (or no parentheses at all for "commands") are the source of grief in the eyes of a Susie User.


[UPD] FBSL BASIC supports an #Option Implicit mode of operation where the user doesn't have to declare variables of simple data types if they so wish (as is characteristic of the beginner's level BASIC) and all type casting is done automatically by FBSL according to the context noticeably faster than were such permutations coded by the user explicitly.

FBSL arrays however are complex data types alongside UDTs, classes and such, and they require explicit Dim-ensioning regardless of mode of operation.

FBSL uses brackets for array indexing, parentheses for subprocedure calls, and no parentheses, for access to global variables of the same name as the respective subprocedures that store the last value the most recent call to the respective subprocedure returned. Does that qualify as an added value by your standards?

An example:

Code: [Select]
FileGet(FileOpen("filename.ext", BINARY), FileLen("filename.ext"))
FileClose(FileOpen)
Print FileGet

Look Mom, no temp vars! :D
« Last Edit: 15. December 2016, 12:48:33 by Mike Lobanovsky »
Mike
____________________________________________________________________________________________
(3.6GHz i5-3470, 16GB RAM / 2 x nVidia GTX 650Ti SLI-bridged, 2GB VRAM / x64 Win 7, x86 elementaryOS Luna)

B+

  • Sr. Member
  • ****
  • Posts: 436
    • View Profile
Re: Ozapell Basic
« Reply #6 on: 15. December 2016, 18:56:41 »
This is a new Retro/Minimalistic Basic I found on steam:

http://store.steampowered.com/app/523410/

It's not free, and one of his targets is to teach Basic to newbies.

One of his strange sintaxis is that to declare an Array they use:

MYARRAY=0
ARRAY=MYARRAY
RANGE=100
DIM

The variable MYARRAY is declared and given the value of 0. The ARRAY variable is given MYARRAY. RANGE will specify how many entries will be in the array. DIM changes the variable MYARRAY into an array containing 100 entries with the value of 0 in each.

The idea is not to use symbols to avoid confusion in newbies (not sure I agree on this).

I agree this doesn't look like ANY BASIC I've ever seen. In order to avoid symbols, this guy might be causing more confusion not only to newbies but also to what exactly BASIC was or is. Apparently people think, "If it has line numbers it must be BASIC." when it comes to using BASIC in the name. Not so bad as, "If it doesn't have line numbers, then it can't be BASIC."

B+

  • Sr. Member
  • ****
  • Posts: 436
    • View Profile
Re: Ozapell Basic
« Reply #7 on: 15. December 2016, 21:52:55 »
Quote
What's much, much more confusing about vanilla BASIC in the beginners' eyes is its stubborn adherence to parentheses to denote access to the individual array elements. C-family brackets for array indexing, and parentheses, for function call parameters, are clear and concise while BASIC parentheses for both (or no parentheses at all for "commands") are the source of grief in the eyes of a Susie User.

Hi Mike,

This Susie User always saw array(i) as like a function! It "returns" the ith index value of the array "function".  ;)

array(i) = newValue   'hmm... can't do that with function, but, until just now, never bothered to think about it.

Does anyone remember:

mid$(string$, i, length) = newValue$

Something like that, you could use Mid$ to change the string. Was it in GW Basic? It was handy but also totally inconsistent to a standard syntax design and practice.

Append:
Yes, my memory still is serving me.

Just a step away from:

anyString$(i [,length]) = newValue$
« Last Edit: 15. December 2016, 23:00:13 by B+ »

Mike Lobanovsky

  • Full Member
  • ***
  • Posts: 162
    • View Profile
    • Freestyle BASIC Script Language
Re: Ozapell Basic
« Reply #8 on: 15. December 2016, 23:45:37 »
This Susie User always saw array(i) as like a function! It "returns" the ith index value of the array "function".  ;)

Exactly, Mark!

"When I was younger so much younger than today", it used to drive me nuts as well. :)


Not so bad as, "If it doesn't have line numbers, then it can't be BASIC."

Just for lulz, FBSL BASIC allows line numbering to soothe the feelings of BASIC purists. However it simply ignores it for all practical purposes. ;)


Does anyone remember:
mid$(string$, i, length) = newValue$
........
Just a step away from:
anyString$(i [,length]) = newValue$

GW Basic was not alone:

MSDN: VB Mid Statement

FBSL BASIC doesn't support the Mid statement but rather the Mid() function alone. Instead, it offers a whole bunch of more practical operations expressed via Extract(), Replace(), Remain(), and Remove() routines.

As yet another manifestation of deliberate mockery it however offers a "multi-let" statement otherwise impossible in a vanilla BASIC:

Code: [Select]
Let(a, b, c, d, e, f, ..., z) = 0
which is an equivalent of C-style compound assignment

Code: [Select]
a = b = c = d = etc = z = 0;

... can't do that with function, but, until just now, never bothered to think about it.

Actually you can -- in VB. Its class property setters are defined as functions:

Code: [Select]
Class CFruit

    Private m_Kind As String

    Public Property Let Kind(NewValue As String)

        m_Kind = NewValue

    End Property

End Class

Dim Fruit As New CFruit

whereupon you assign the Kind property of class instance Fruit as follows:

Code: [Select]
Fruit.Kind = "Banana"
Apparently nearly half of VB vocab is effectively preprocessor metastatements in disguise rather than BASIC keywords proper, used to help translate the VB language quirks to equivalent C code for the C compiler that's part of VB's regular installation.
Mike
____________________________________________________________________________________________
(3.6GHz i5-3470, 16GB RAM / 2 x nVidia GTX 650Ti SLI-bridged, 2GB VRAM / x64 Win 7, x86 elementaryOS Luna)

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Re: Ozapell Basic
« Reply #9 on: 16. December 2016, 03:34:47 »
Because a one-character string is indistinguishable from the character it contains, the term "string" is effectively just an alias to the term "array of characters".

Mike,
You exhibit strong professional distortion: "Lobanovsky" is not an array of characters, it's text, a name, a string, whatever suits you. And as such, it is a simple type, as you call it. As mentioned above, if you go that other road, I'll haunt you in the coming years with stubborn adherence to correcting you whenever you talk about "integers" - they are fixed-size arrays of bits, dear!! No serious programmer would call these precious animals "integers" 8)

Take it easy... and don't confuse C habits with "standards" - everybody is absolutely free to code without {strange} [brackets] and; semi-colons; all over the place, and is free to exit switches without "breaking" {[(SHUDDER)]}

Re Mid$:

include \masm32\MasmBasic\MasmBasic.inc      ; download
  SetGlobals My$="Such a fine language is .. BASIC"
  Init
  Let Mid$(My$, 6)="an incredible crap is C/C++, if this was C, it would produce a buffer overflow"
  Print My$
EndOfCode


Btw Let Right$(My$, 6)="an incredible ..." is valid syntax, too. And doesn't require patch tuesdays because of totally "unexpected" buffer overflows. If I think of all the time wasted for "updating" C/C++ applications because of their totally unexpected "security" problems, or if I look at the loooong lists of Microsoft's attempts to introduce "safe" string functions, I get the creeps. Long live BASIC - Best Approach to Simple and Intelligent Coding :)
« Last Edit: 16. December 2016, 03:56:48 by jj2007 »

Mike Lobanovsky

  • Full Member
  • ***
  • Posts: 162
    • View Profile
    • Freestyle BASIC Script Language
Re: Ozapell Basic
« Reply #10 on: 16. December 2016, 09:08:13 »
Mike,
You exhibit strong professional distortion: "Lobanovsky" is not an array of characters, it's text, a name, a string, whatever suits you.

Well Jochen,

Programmatically, "Lobanovsky" is neither a text, nor a name, nor an array of bits; it is a datum of type String, and as such it is an array of literal characters.

Dixit Wikipedia: "In computer programming, a string is traditionally a sequence of characters, either as a literal constant or as some kind of variable. The latter may allow its elements to be mutated and the length changed, or it may be fixed (after creation). A string is generally understood as a data type and is often implemented as an array of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding."

That's about all there is to it so far as the String data type goes, and there's really no point in any further attempts to superinduce peculiar deviations of assembly language terminology from the usage of this term conventionally accepted in the context of high-level languages.

But as a special bonus to you and in order to stress again my friendly attitude to Asm programmers in general, I hereby grant you a very special permit to use the string representation of my Christian, parental, and family names, as well as my avatars available as of the date of publication, for programmatic experimentation in MasmBasic to the benefit of the entire BASIC community.

Talented assembly programmers are so few these days, after all. They should be fostered, petted and encouraged in every possible way rather than allowed to die out to oblivion as a species.

:D
Mike
____________________________________________________________________________________________
(3.6GHz i5-3470, 16GB RAM / 2 x nVidia GTX 650Ti SLI-bridged, 2GB VRAM / x64 Win 7, x86 elementaryOS Luna)

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Re: Ozapell Basic
« Reply #11 on: 16. December 2016, 10:43:37 »
I hereby grant you a very special permit to use the string representation of my Christian, parental, and family names, as well as my avatars available as of the date of publication, for programmatic experimentation in MasmBasic to the benefit of the entire BASIC community.

Christmas is near, hal-le-lu-jaaaaaaaaaah!

ZXDunny

  • Full Member
  • ***
  • Posts: 135
    • View Profile
Re: Ozapell Basic
« Reply #12 on: 17. December 2016, 01:24:20 »
Oh, for crying out loud! I leave you guys alone for five minutes and you're at eachother's throats again!

I'm going to have to explain things to you once and for all.

A "Lobanovsky" is not a bloody string, please get that through your skulls. For your edification:

A Lobanovsky - a sub-species of the genus "BASIC Interpreter Creator", is a rare creature (only one known in existence) which spends its days busily building its interpreter and compiler in the hope of pursuing an ambition to create that one perfect language implementation. It is known to be quite vexatious when cornered, and will readily use four words where one will do.

Other sub-species of this genus are the "Jochen" (pronounced "Joke-ing") which is generally enthralled with not so much building an interpreter or compiler, but with taking elements of a readily available package and augmenting it with parts of the BASIC language in such a way that the unwary programmer is converted to thinking in assembly language without their realising it - only when it is too late do they understand that they've been drawn into the Jochen's lair. The antlion of the genus, if you will.

Finally, there's the "Dunny", which spends most of its spare time grumbling about line numbers and posting condensed versions of other people's code in the hopes of attracting a user. The Dunny can often be found refuting the claims of the other sub-species, who declare their products "BASIC" in nature, and will stubbornly refuse to admit that the language dialect has moved on from the 1980s.

All three types are easily caught in the wild with various traps - mostly web forums with seemingly innocuous posts about what is and isn't a BASIC, which brackets should be used to access arrays and other sundry non-issues that regular programmers would ignore. Once trapped in the forum arguing, they can be picked off, stuffed and mounted on the wall with ease. It should be noted that as these are one-of-a-kind developers though, they do enjoy endangered species protection.

The environment in which these curious creatures create their works is abundant with various symbiotes - there's the "Richey" which sees them as a means to expanding his programming knowledge, and there's the "B+" which although capable of producing some excellent graphical code, is usually distracted by "benchmarking" languages against eachother in their implementations. These are not mere hangers-on, though, as through their actions in the community nourish the BASIC implementation creators.

So there you have it. Now stop banging on about what is and what isn't a sodding string, or I'll start a debate about line numbers that will make your toes curl - including GO TO a*20.

Mike Lobanovsky

  • Full Member
  • ***
  • Posts: 162
    • View Profile
    • Freestyle BASIC Script Language
Re: Ozapell Basic
« Reply #13 on: 17. December 2016, 10:43:21 »
Beware of a silent dog and still water indeed!

You made my day, Paul, you really did! ;D
Mike
____________________________________________________________________________________________
(3.6GHz i5-3470, 16GB RAM / 2 x nVidia GTX 650Ti SLI-bridged, 2GB VRAM / x64 Win 7, x86 elementaryOS Luna)

jj2007

  • Full Member
  • ***
  • Posts: 124
  • MasmBasic rocks
    • View Profile
    • MasmBasic - faster than C
Re: Ozapell Basic
« Reply #14 on: 17. December 2016, 11:08:36 »
Paul,

Thanks for this brilliant analysis. If after the Brexit, you'll need a visum to enter Europe, I'll certify that your presence here will be a valuable contribution to European Union culture 8)