It is too long nonsense, please don't take it seriously. ;)
1. Showcase
As far as I know, FreeBASIC is born to make QB alive/mimic QB in today's os, once this goal is achieved, I feel that the development slow down recently.
Gallery of Applications for some notable examples presents a feel of last century, and says "FreeBASIC can only be a toy language for non-serious or commercial applications".
As a contrast, purebasic, xojo/realbasic or even freepascal/Lazarus look beautiful and modern.
The capability and realization are not the same things. Maybe something prevents FreeBASIC from writing applications. So the first dream is on eye candy: an up-to-date FreeBASIC application gallery to show where FreeBASIC can be used in, and which level the current FreeBASIC projects can meet.
2. Syntax
Yes, maybe FreeBASIC has supplied the features to write applications by extending some new feature. But QB/VB and C, are born decades ago. More features are introduced in the new languages since then.
Maybe someone would say "hey, you are talking about python, not FreeBASIC. Go to your f*king python".
- No, think about !"string" in FreeBASIC, which is not BASIC's syntax; why FreeBASIC accepted it?
- No, as we all know, FreeBASIC has borrowed many features from C which do not exist in QB/VB
- No. what do you think about "for each" in VB
- No. what do you think about interpolated string in Vb.net
Well, I know it is hard to add new syntax, too hard from my ability, so I think this just will always be a dream.
Furthermore, the idea to break some old syntax is doomed to make someone very very angry. Please don't blame me, I don't want to offend anyone. I said it is a dream.
But it could be better if the (impatient) user, for example me, can find a way with less code/keyboard-typing to write the program by using some sugar syntax.
For example,
2.1 "for each" in VB.net to enumerate, or enumerate in python
2.2 'in' to judge whether something is in another. Yes, there is `InStr` to locate the first occurrence of a substring within a string
2.3 slice, the ONE syntax can be used to
- replace LEFT$, RIGHT$, and MID$ in BASIC,
- choose element every Nth character in the original string or in the reversed string to a new string
- reverse a string.
- object[indx] to get the object on index
- object[start_pos:end_pos] to get a subrange object from start_pos to end_pos( excluded)
- object[start_pos:end_pos:step] to get a subrange object from start_pos to end_pos( excluded) at a stride of step
- index, start_pos, can be positive( 0, 1, ... len(obj)-1) or negative(-len(obj), -len(obj)+1, ..., -1)
Meanwhile, https://nim-lang.org/]Nim and Rust says something like s[0..5] in which the stride is not supported
I often do work with text, this slice style is more readable, especially if I make a chain of operations. And the negative index and the stride give me more ease.
This is not a really totally new operation in FreeBASIC. Currently, FreeBASIC has Operator[] (String Index) which is not in QB but new in FreeBASIC, or, I think, is borrowed from C. But it can only use one index to return one char/wchar
Code: Select all
dim a as wstring * 20= "你好hello"
dim as integer i
for i = 0 to len(a)-1
? wchr(a[i])
next
2.4 we can use three all of the above on string and array, or even customized type.
2.5 string syntax for multiline text, so that we do not need to add CR/LF at the ends of every line manually. Perhaps, in the time when QB lived, the computer can not deal too long string easily, so QB breaks them down line by line. But nowadays, we often meet long text with many paragraphs, for example, webpage source, XML, CSS and so on. The old-school QB's way to write such text is too clumsy and has low efficiency. Yes, we can use "\n" in "!string", but for long text, it will still be hard to read, there is an example
https://github.com/PaulSquires/WinFBE/b ... o.bas#L404
In python, a couple of three quoted mark is used.
Or since we have
Code: Select all
!"string with escaped \n"
Code: Select all
m"I'm
string
on multiline
"
2.7 if "_ " is eliminated in multiline string, how about
Code: Select all
dim as integer i = 10
if (
i > 1 and
i<100) then
? i
end if
"_" is kept, but it is only needed in the case we have to use it else the syntax is wrong.
2.8 as for comment, how about using
Code: Select all
# this is a comment which is common in bash/python/perl..., but may be hard for FreeBASIC due to the macro/preprocessor/...
or rapideuphoria's style
Code: Select all
-- this is a comment
Code: Select all
; this is a comment
Code: Select all
/*
this is a comment
on many lines
*/
// comment on one line
Code: Select all
' a single quote mark, the old QB-style comment
Code: Select all
aString = 'string in this way, so we can use "Double quote mark" in it easily'
Yes the string interpolation is supplied in Formatting library (C++20) or in fmt, the modern formatting library, for C++.
2.10 native multi-dimensional array/matrix operator. But this may be done via the operator overload perhaps.
3. Beyond traditional Application
3.1 the ability and document to develop an application for Android/iOS. I mean a real application, not a "hello world"
3.2 or the ability to devleop web appliaction like spiderbasic does
4. a GUI library
4.1 which uses Visual Format Language.
I find Visual Format Language is used in swift/javascript/Objective-C mostly, but can also be tested on line.
I find only wNim runs on MS Windows, which is implemented in https://nim-lang.org/]Nim language. You may find that it is so terse to describe the GUI layout: line 72 - line 79.
At the same time, wNim supports to place the control widgets at pixel coordinate and set the width/height of widgets via pixel unit just like VB6 does.
4.2 Or maybe up-to-date GUI inc in FreeBASIC for up-to-date GUI library. I can't remember too much, but only iup and FLTK-C are in the candidate list. However, FLTK looks in a strange fashion :(
How about wxWidgets? But it is a CPP project.
wNim, iup, wxWidgets use grid/box way to locate the controls. Whereas wNim, FLTK and wxWidgets use pixel coordinate, it is tedious to design and calculate the coordinate if there is no GUI layout editor.
In wNim/iup/FLTK-C, there is no need to write the parent control where a new control is created in, so it is easy to change the layout before the final release.