Frustrated and need to discuss...

General discussion for topics related to the FreeBASIC project or its community.
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Frustrated and need to discuss...

Post by leopardpm »

caseih wrote:As I see it, there are two solutions to the bindings problem. One is for community members to step up and volunteer to maintain the bindings for a particular library. For example, TJF seems to be maintaining GTK .bi files. There are tools to make the maintenance a bit easier by automating some of the translation from C header files. TJF wrote one of those tools himself (I think I have his username right).
life happens, I think this method has a high degree of problems - especially if doing such maintenance is a complicated and time consuming process, as I assume it is, unless one has all these tools(that they must write themselves..)
The other solution is more technical, though related. If a full translation tool existed that could parse all of the complexities of C header files to FB code, then the problem becomes elementary. Any valid C .h file could be used, perhaps with a transparent translation step, with FB. This would be ideal, and there was some work done in this area. This is really hard, though, as basically one is making a full C99 compiler that emits FB code. Matters are further complicated by the preprocessor too, both FB's preprocessor, and C's preprocessor. If translation were completely transparent then #defines in FB code would be able to trigger things in C .h files. It would be seamless.
This is obviously the 'ultimate' - have it be so easy to maintain that it could even be done by anyone with a step by step instruction sheet... BUT, as you pointed out, writing this 'ultimate' translation tool, in and of itself, seems a task as complicated as writing the original FB compiler itself.... BUT, any person (or group) developing a language, that also took the time to write such a tool during the development process (probably the easiest and best time to write this tool) would give their new language a GREAT boost in overall desireability by anyone looking to learn and keeping an eye to future support of the language. This is what is needed for FreeBasic to become a serious and 'popular' alternative to the C variations.... and, along those lines, if it also had some built-in, easy functions like PNG support that did not depend on libraries, that would make it all the more appealing....

You know, I think back to when I first learned programming, which was in a form of basic. And of course the tutorial always starts out with 'Hello World' of some form. It was exciting to actually 'control' the computer and its screen, to know that instead of 'hello world' I could put anything I WANTED inbetween those quotes and I would make the computer display it. Then, on down the line, I tried to teach myself 'C'.. and there too was a 'hello world'... but I had to type 10 lines of code that was explained as 'we will tell you what these do later' before even getting to the 'printf' line... those 'mystery lines' of code were so daunting compared to the simplistic and completely knowable BASIC lines, that I felt 'C' was out of my league - even without having previously programmed, I understood the BASIC commands enough to make me feel confident, unlike the cryptic C language written by necromancers and evil magical beasts.... make it easy for beginners so they gain the confidence to learn the harder stuff... builds loyalty as well, just look at all of us die-hard BASIC users!
aurelVZAB
Posts: 666
Joined: Jul 02, 2008 14:55
Contact:

Re: Frustrated and need to discuss...

Post by aurelVZAB »

Even Python, which is considered to be extremely beginner friendly
and this is ordinary floscula or blamage for naive people around world promoted by
( you know who!) and fact is that pythons is not very beginner friendly as pythoner whish
to spread all over the world
Imortis
Moderator
Posts: 1924
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: Frustrated and need to discuss...

Post by Imortis »

aurelVZAB wrote:
Even Python, which is considered to be extremely beginner friendly
and this is ordinary floscula or blamage for naive people around world promoted by
( you know who!) and fact is that pythons is not very beginner friendly as pythoner whish
to spread all over the world
I don't care for python, myself. I really don't like it's use of whitespace. I was just mentioning that I many people will claim it to be beginner friendly.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Frustrated and need to discuss...

Post by caseih »

Quite a few unis are teaching Python as an introductory course and having good success. I also know anecodotally of quite a few cases of children picking up Python and having a lot of fun. Of course I did the same thing with BASIC when I was about 6.
caseih
Posts: 2157
Joined: Feb 26, 2007 5:32

Re: Frustrated and need to discuss...

Post by caseih »

leopardpm wrote:This is what is needed for FreeBasic to become a serious and 'popular' alternative to the C variations.... and, along those lines, if it also had some built-in, easy functions like PNG support that did not depend on libraries, that would make it all the more appealing....
Popular alternatives to C often flare brightly for a time then disappear. There are no shortages of interesting languages to play with, many of which bill themselves as alternatives to C. For example, Mozilla Rust. There are other examples too, such as Google's Go. Only time will tell if any one of them actually does end up replacing C. I guess FB's advantage is that it offers almost 1:1 feature compatibility with C, while adding things like dynamic strings and arrays. Anyway, given how ADD developers are these days I'm always skeptical of anyone excited about some C alternative.
You know, I think back to when I first learned programming, which was in a form of basic. And of course the tutorial always starts out with 'Hello World' of some form. It was exciting to actually 'control' the computer and its screen, to know that instead of 'hello world' I could put anything I WANTED inbetween those quotes and I would make the computer display it. Then, on down the line, I tried to teach myself 'C'.. and there too was a 'hello world'... but I had to type 10 lines of code that was explained as 'we will tell you what these do later' before even getting to the 'printf' line... those 'mystery lines' of code were so daunting compared to the simplistic and completely knowable BASIC lines, that I felt 'C' was out of my league - even without having previously programmed, I understood the BASIC commands enough to make me feel confident, unlike the cryptic C language written by necromancers and evil magical beasts.... make it easy for beginners so they gain the confidence to learn the harder stuff... builds loyalty as well, just look at all of us die-hard BASIC users!
I think you're right about why BASIC still has appeal and is still valid today. Here's a very recent blog post on the subject. It's really eye-opening:
http://www.nicolasbize.com/blog/30-year ... -the-best/
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Frustrated and need to discuss...

Post by leopardpm »

caseih wrote:I think you're right about why BASIC still has appeal and is still valid today. Here's a very recent blog post on the subject. It's really eye-opening:
http://www.nicolasbize.com/blog/30-year ... -the-best/
nice link - and very much agree. In a way, we had it easy in the 80s because programming was about the only thing you could do with that fancy new contraption once you got bored of the games and showing your parents how a word processor would make their lives so much easier...
DamageX
Posts: 130
Joined: Nov 21, 2009 8:42

Re: Frustrated and need to discuss...

Post by DamageX »

Adding more built-in functions to FB is all well and good... but reading/writing particular file formats is something that can already be implemented in FB without using external libraries. (I'm going to make my own PNG decoder sooner or later, to incorporate in a couple of projects.) Higher priority should go to adding functions for things that currently CANNOT be implemented without external libraries (eg. playing sound under Win NT *hint* *hint*) IMO...
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Frustrated and need to discuss...

Post by leopardpm »

DamageX wrote:Adding more built-in functions to FB is all well and good...
so, for instance, you might advocate for a 'sprite' type of command to easily handle images as sprites, but...
DamageX wrote:reading/writing particular file formats is something that can already be implemented in FB without using external libraries.
not advocate for 'bload/bsave' to handle PNG files?

just clarifying

I didn't realize/know that there is no way for FB to play sound under Win NT... that is strange, but, too idiosyncratic I think... I don't really know - how many folks want to output sound under Win NT compared to how many folks want to load/save PNG images directly and easily without a library? I know I can't assume everyone is like me, but, I really can't imagine alot of folks even using Win NT anymore... maybe I am wrong
DamageX
Posts: 130
Joined: Nov 21, 2009 8:42

Re: Frustrated and need to discuss...

Post by DamageX »

so, for instance, you might advocate for a 'sprite' type of command to easily handle images as sprites, but...
I'm not sure what you mean by a 'sprite' command. Would this be similar to PUT?
not advocate for 'bload/bsave' to handle PNG files?
If someone wants to add it, I would not be opposed to this. However the functions could be written in FB without changing FB itself.
I didn't realize/know that there is no way for FB to play sound under Win NT... that is strange, but, too idiosyncratic I think... I don't really know - how many folks want to output sound under Win NT
When I say Win NT, I am referring to all subsequent versions of Windows as well (2K, XP, Vista, 7, etc.). I am not including Win 9x, because when running under Win 9x one could concievably program the sound hardware directly just as under DOS.
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Frustrated and need to discuss...

Post by leopardpm »

DamageX wrote:
so, for instance, you might advocate for a 'sprite' type of command to easily handle images as sprites, but...
I'm not sure what you mean by a 'sprite' command. Would this be similar to PUT?
yeah, pretty much. Here is another 'BASIC' I play with that has some really nice features for graphics and game programming (I wish FB had some of these features...), yet is still simple and easy to use.... unfortunately, the guy who wrote it is very flaky and doesn't ever respond to contact requests or anything... very sad: http://www.playbasic.com/features.php . It has a decent sprite command, allows to assign a 'z-level' to sprites for drawing order, automatic pixel-collision tests, and polygon shaped collision tests, and renders them extremely quickly.
not advocate for 'bload/bsave' to handle PNG files?
If someone wants to add it, I would not be opposed to this. However the functions could be written in FB without changing FB itself.
Writing a function to load up a standard graphic file type seems pretty 'unfriendly', especially to beginners... I guess it depends on what the overall goal is with FB: to have an expanding user base, be beginner friendly, be a QBASIC clone, be as lean as possible, etc... some of these goals conflict with each other..
When I say Win NT, I am referring to all subsequent versions of Windows as well (2K, XP, Vista, 7, etc.). I am not including Win 9x, because when running under Win 9x one could concievably program the sound hardware directly just as under DOS.
I was afraid you were going to say that... so, you are saying that me, under windows 10, cannot make sounds happen through FB without an external library call? which would mean a dependency (as I understand 'dependency' it means you need an additional program/code (like a DLL) with the .EXE made for it to function correctly)? This is a very sad state of affairs indeed!
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: Frustrated and need to discuss...

Post by Tourist Trap »

I personally think that we would better start trying implementing/re-implementing readers/writters for bmp, then jpeg2000, and so on. Those are well documented and bmp comes with lot of examples of code for readers. But I find this not really a simple task if one has to handle all the details. Once this done and evaluated, it would be time for png.

The problem is not adding a keyword. The problem is coding what is behind the keyword in a standard and efficient way. Otherwise introducing it would be quite controversial.

For instance the old picture box of vb had some methods for resizing that were just uggly. So it's here, but people wont be happy with it and would override the method with one of their own (maybe also for speed issues). In vb this was often how the things go. They have managed to provide not far to a method for each thing, but not the efficient clean ones... But in vb, everything is in fact in an optional library, the only difference with fb is that the visual studio editor will make it easy the task of adding a reference to the library via the project menu (or when you drag an icon that referes to this reference).
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Frustrated and need to discuss...

Post by leopardpm »

I imagine that all the standard file formats are pretty easy to get sources of - I don't think that would be an issue at all... these are not mysterious, secret routines, just involved and perhaps complex... but plenty of resources to get them.

The issue is whether the current devs want to do it or not - and they base this on MAYBE user initiative (like this thread), their own time and interest, if they 'feel' that it is in the spirit of what they think FB is or should be, etc. Considering that they are not paid for doing these sort of things, then it would have to be a highly motivated Dev who happens to have the time available to tackle the endeavor. Which is why these kind of issues would be great to deal with through the above-mention idea of mini-kickstarts or some sort of bounty/auction system... people can vote for what they would like to see with some money, and the Dev's time is compensated which provides additional motivation.

I do have a question though: it was mentioned above somewhere that adding to the FB language induces 'bloat' - is this talking about the size of the compiler, or the size of the compiled programs - our code? I would think our code would not be affected at all unless it used a particular command...If my program is:

Code: Select all

for x as integer = 1 to 10
next x
then I would assume that the compiled code for the graphic statment 'PUT' is not going to be in the final EXE file...

my own opinion is that compiler bloat is not a big issue at all... program EXE bloat IS a problem though
Tourist Trap
Posts: 2958
Joined: Jun 02, 2015 16:24

Re: Frustrated and need to discuss...

Post by Tourist Trap »

leopardpm wrote:I imagine that all the standard file formats are pretty easy to get sources of - I don't think that would be an issue at all... these are not mysterious, secret routines, just involved and perhaps complex...
I think this is not really true. I don't know about png, I can't find anything about this format, but I've made some exploration with pdf for instance, and believe me even with books and documentation this is a big mess. Other case, dxf file format (for cad software). Even if this format is quite well documented, due to its intrinsic complexity and multiple versions, it's also a life quest to get a versatile reader.

What I mean is that in my opinion a language can't afford to include a whole software embedded in a keyword for doing a task related to file formats. It's not that developpers are lazy. We don't even confront an algorithm related to png in this discussion so we can't say too much about this. What I know is that for me those affairs of format are really impressive and they generally are known for being so.

In the case of png that's the compression that sounds bad. This may imply the use of a compression library in addition of the core algorithm.

Have you found some link with png files specification those days?
leopardpm
Posts: 1795
Joined: Feb 28, 2009 20:58

Re: Frustrated and need to discuss...

Post by leopardpm »

google this "png file format encode/decode" and you will find a plethora or resources, source-code, etc. same for any other format

This one being the actual standard: https://www.w3.org/TR/PNG/

Side note: This is pretty interesting... but, not any sort of a standard yet... this would be an example of something for a library and NOT part of the FB core: http://flif.info/
Last edited by leopardpm on May 19, 2016 13:01, edited 1 time in total.
Imortis
Moderator
Posts: 1924
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Re: Frustrated and need to discuss...

Post by Imortis »

leopardpm wrote:...I was afraid you were going to say that... so, you are saying that me, under windows 10, cannot make sounds happen through FB without an external library call? which would mean a dependency (as I understand 'dependency' it means you need an additional program/code (like a DLL) with the .EXE made for it to function correctly)? This is a very sad state of affairs indeed!

This is not quite correct. FB does have access to all Windows API functions and features by including "Windows.bi". This will allow you to play sounds using windows functions. It does not require any extra DLLS to be packed along with the EXE.
Post Reply