How many people actually use FreeBasic?

General discussion for topics related to the FreeBASIC project or its community.
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: How many people actually use FreeBasic?

Post by oyster »

although it is an old post...

I started to learn programming in high school by using BASIC, sorry I don't know which machine and BASIC is exactly.

now, I frequently handle kinds of text data in my work. But to be frankly, I don't want to write such an app in ANY BASIC. I hate to read/write tons of LEFT/MID/RIGHT; and in fact I don't like to use & to join strings because 2 keys(shift and 7) have to be pressed, I prefer to `+` symbol. (Edit: thanks for freeBasic which can use + to join string, and I know this feature)

Nowadays I use python frequently, because it supplies the slice operation, `in` iteration, `in` to judge whether is a sub-string - in fact this 3 statements can work for any iteratable builtin/user-defined object.

Why I emphasis `builtin` object? Because I know we can use the OOP in FreeBasic to wrap a user-defined string to mimic what Python does viewtopic.php?f=2&t=27332&p=257024#p257024
But we have to wrap all FreeBasic string, including the result from function call, with this code. As you may guess, it is not acceptable for me, a very lazy man.

But none language is perfect. Some of my python app built with py2exe/pyinstaller can't work on all kinds of Windows, so I try to use nim http://nimlang.org/. But nim is still a very young language, so I have to port libs from FreeBasic to nim.
Last edited by oyster on Jan 28, 2019 13:34, edited 2 times in total.
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: How many people actually use FreeBasic?

Post by oyster »

there are "for each" in vb, I don't know when it will be in fb
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: How many people actually use FreeBasic?

Post by jj2007 »

oyster wrote:I hate to read/write tons of LEFT/MID/RIGHT
That's a matter of taste. I even write a$=Mid$("Hello World, how are you?", 7, 5), because the $ sign makes sure that I never ever confuse a numeric and a string variable. Being verbose is not a problem of a programming language, it's a feature. Dig out a big program (>10k lines) that you wrote 3 years ago, and you might realise that it was a big mistake NOT writing it in a verbose manner, with longer syntax and extensive comments.
Lost Zergling
Posts: 538
Joined: Dec 02, 2011 22:51
Location: France

Re: How many people actually use FreeBasic?

Post by Lost Zergling »

@oyster "there are "for each" in vb, I don't know when it will be in fb".
Yes indeed. You can, however, work around the problem using lzle (https://freebasic.net/forum/viewtopic.php?f=8&t=26533): iterators are fast and versatile enought for most purposes but it requires you to use the lzle list type to store your data. Another technical solution, faster, is to use the pointers directly on your data types (arrays, strings) but this then imposes a micro-management of the memory that can prove binding in terms of optimization and as well as limitations in terms of volumetry. The use of lzle with a basic mastery of the pointers allows you to combine the two techniques according to the constraints of optimization (volumetry and algorithmic use of the data or RE-use of data's adresses). You can also only use Lzle for fast encoding. A ForEach on arrays would be a nice feature, but I do not regret so much that of vb !
Josep Roca
Posts: 564
Joined: Sep 27, 2016 18:20
Location: Valencia, Spain

Re: How many people actually use FreeBasic?

Post by Josep Roca »

> and in fact I don't like to use & to join strings because 2 keys(shift and 7) have to be pressed, I prefer to `+` symbol

And what prevents you to use + instead of &? You can use both with FreeBasic.
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: How many people actually use FreeBasic?

Post by marcov »

for each is mostly just syntactic sugar around iterators (often interfaces, or hard ducktyping), with some exceptions for e.g. plain arrays.
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: How many people actually use FreeBasic?

Post by oyster »

Josep Roca wrote:> and in fact I don't like to use & to join strings because 2 keys(shift and 7) have to be pressed, I prefer to `+` symbol

And what prevents you to use + instead of &? You can use both with FreeBasic.
I know + can be used in FB to join string. I finger out both LEFT/RIGHT/MID and & in "ANY BASIC". Never mind, I edited my original post
marcov
Posts: 3462
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: How many people actually use FreeBasic?

Post by marcov »

Hmm, didn't know Nim(rod) sources were originally in Free Pascal :-)

Still, I don't like wholly garbage collected languages (though I don't mind a few automated types to keep business code simple)
oyster
Posts: 274
Joined: Oct 11, 2005 10:46

Re: How many people actually use FreeBasic?

Post by oyster »

Lost Zergling wrote:@oyster "there are "for each" in vb, I don't know when it will be in fb".
Yes indeed. You can, however, work around the problem using lzle
I, a non making-living-on-programming guy, get totally lost after reading your lzle post
Lost Zergling
Posts: 538
Joined: Dec 02, 2011 22:51
Location: France

Re: How many people actually use FreeBasic?

Post by Lost Zergling »

@oyster. It was not my goal! On the contrary, go to the link (viewtopic.php? F = 8 & t = 26533) and create a lzle.bi file by copy-pasting in the 3 parts of the source code. Then in your source code add an #Include once "PathName \ LZLE.bi". Instead of using the following syntax:
ForEach ref in MyVar .. Next ref or ForAll refv in mylist ..EndForAll
you can use :
For i = 1 to MyList.AllOf: MyList.fStep ... Next i or While MyList.HashStep .. Wend (for indexed entries)
Or also (edited 23/02) :
MyList.AllOf : While MyList.fStep .. Wend,.. or MyList.AllOf : For i = 1 to MyList.Count : MyList.BlindStep(-1) ... Next i,
While MyList.KeyStep and MyList.HashTag<>$key.. Wend, and so on. It is possible to combine keywords making so your own syntax.
Reverse or partial parse supported as well on flat and tree (indexed lists).
You can choose how and when a list, a branch of a tree or even a listnode can be send to garbage or to protected flat list or to another list.
meaning : list data exchanges at any level supported, recycling on demand or on any subset or on whole list.
Data can be send from indexed to non indexed and vice-versa. Index creation & management supported.
Syntax behaviour is optimized to distinguish existing nodes and new ones in one catch. Soft deletion possible on indexed lists.
Reverse seek supported, other advanced optimizations options. Sorts supported (will be improved in future versions).
Some multi-values features, hierarchical count down. Consistent speed. Consistent deallocations.
Tracking enable features that would require pointers just by instruction set extension and without having to manipulate pointers
..
Same spirit (edited 17/02) :
mylist.Add($Key,$Value) is translated :
mylist.BlindTag($Key) : mylist.Val($Value) or mylist.BlindTag($Key) : mylist.RwTag1($Value) (depending the value size)
mylist.Add($Key,$Value1, $Value2, etc ) is translated :
mylist.BlindTag($Key) : mylist.Val($Value1) : mylist.BlindTag($Key) : mylist.Val($Value2) : etc
This for non indexed ('flat') lists
For supporting multi values on indexed lists use HashTag($Key) with HashKeyUnique property previously set to 0
This can also be managed 'manually' by using manual multi values in .val property

The syntax is just slightly different but the basic usage is not that much different.
This is especially important (originally designed for this purpose).
On the other hand, the optimization possibilities and the functionalities are enormous compared to a simple ForEach.
I'm really sorry if I confused you by wanting to extol more advanced uses.
Last edited by Lost Zergling on Feb 23, 2019 21:09, edited 7 times in total.
Lost Zergling
Posts: 538
Joined: Dec 02, 2011 22:51
Location: France

Re: How many people actually use FreeBasic?

Post by Lost Zergling »

Addendum. ForEach is an iterator, a syntax implementation wich is dedicated to multi-values, wich means mainly arrays and lists. ps : I'm not sure that a generic, global-oriented iterator would be the best choice now because lists and tables may have their own unique characteristics at a functional level. Indeed, a ForEach for tables and everything else except lists seems to me like a good idea.
Addendum (2) In my previous post, by "combining the two techniques" I meant using the .val property to store long string and manage these strings by pointers as if they were arrays (zstringPtr=StrPtr(MyList.Val)), so as to get the as fastest parse as possible (For Each) onto these subsets of datas (non indexed, non reallocated except at listnode level). In this implementation, the idea is to manage one or any listnode(s) in its own right as if it was a buffer. When priority is set to the optimization strategy of the algorithm, the optimization strategy of the algorithm leads as far as possible the choices the best adapted memory implementation.
Post Reply