guymark
Posts: 15
Joined: Fri Sep 14, 2018 2:56 am

Re: A compilable basic that uses line numbers for Pi?

Wed Sep 26, 2018 10:55 pm

Thank you!

I should have known to do that.
It even seems to load properly now from the terminal.

Happy Days :)

guymark
Posts: 15
Joined: Fri Sep 14, 2018 2:56 am

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 9:03 am

Well, having run the various things to install libraries I now seem to have FreeBasic in various places. I have chmod 777 *.* (At this point in time, security of my Raspberry Pi is not a priority) and I am STILL getting errors like:-

ld: cannot find /usr/local/bin/../lib/freebasic/linux-arm/fbextra.x: Permission denied
ld: cannot find /usr/local/bin/../lib/freebasic/linux-arm/fbrt0.o: Permission denied
ld: cannot find -lfb
ld: cannot find -lncurses

The last two can understand as they seem to be missing - so will try and find a copy somewhere. However the first two files are present in the /lib/freebasic/linux-arm directories AND permissions are confirmed as being 777.

However, I don't understand the .. bit between /use/local/bin and /lib/freebasic so I am guessing this might be where I am going wrong. I have tried to Google the answer but have not found anything - if you can explain the .. thing in the middle of a directory path please do!

I realise I am going to have to learn Raspberian / linux. I had just hoped to be able to get on with programming in freebasic first - and worry about the quirks of a linuxy operating system later.

I am quite happy to re-re-reinstall noobs and get a fresh copy of Rasperian installed BUT at the moment, I think I will still end up with a compiler that cannot find the libraries it wants.

I have followed suggestions from various folks on here and reading notes on the freebasic site and installed various libraries - some of the code has installed extra copies of the fbc.exe too.

Reading notes on freebasic I gather it looks for the libraries in both the lib directory and also the current directory. So in desperation, I copied all the libraries into the current directory where the "helloworld.bas" program resided and STILL the same libraries are not found even though the first two are there and visible.

Thank you for putting up with my idiot questions and queries!

I do miss the days of DOS :)

User avatar
topguy
Posts: 5566
Joined: Tue Oct 09, 2012 11:46 am
Location: Trondheim, Norway

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 10:57 am

if you can explain the .. thing in the middle of a directory path please do!
I cant really explain how it got there, but it has something to do with how path prefixes are created in configure and Makefiles.
How it works is the same as with "cd .." it refers to the parent directory. So "/usr/local/bin/.." is the same as "/usr/local".

guymark
Posts: 15
Joined: Fri Sep 14, 2018 2:56 am

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 11:30 am

Ahhh. Thank you.

I know linux (and Raspberian) are amazingly flexible operating systems - but I do think sometimes, it was designed by people who got a buzz out of obfuscating things.

"Heh, shall we make it so they can just copy this set of files into the right directory - perhaps from a script?"

"Nahh, let's make them build a file using this option with half a dozen switches - and then see if they can install the first and second module and remember to do an update on the first module AFTER they installed the second module but before they install the third module

"Sounds like a plan, where shall we put the installation notes?"

"How about on a different website altogether and label it as "optional info" - and then save it as a tar file which can unzip into morse."

"Bingo"

I jest - and I DO acknowledge that it is ME being stupid and almost everyone else can do this standing on their heads - just a little frustrating for noobs like me that software that has been around for some years (freebasic) installs easily on almost every other operating system other than Linux / Rasperbian - and the ONE guy who apparently had found an easy way to install it - took his website down and the method has vanished along with it!

User avatar
scruss
Posts: 2251
Joined: Sat Jun 09, 2012 12:25 pm
Location: Toronto, ON
Contact: Website

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 2:34 pm

guymark, sounds like you really should do some reading about Linux. The Linux Command Line by William E. Shotts, Jr. is pleasantly written and has a nice pace. Expecting Linux on a modern computer to behave like MS-DOS isn't realistic: we've moved on from single-tasking, single-digit-megahertz computers.

What was the website that was taken down that showed how to install FreeBASIC?
‘Remember the Golden Rule of Selling: “Do not resort to violence.”’ — McGlashan.

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 4:46 pm

guymark wrote:
Mon Oct 01, 2018 11:30 am
I know linux (and Raspberian) are amazingly flexible operating systems - but I do think sometimes, it was designed by people who got a buzz out of obfuscating things.
The exact opposite in fact!
The designers of UNIX were extremely clever engineers who were fed up with the complexities of the large operating systems of the day - specifically Honeywell Multics. Compared to the old mainframe OS's and file systems, UNIX is really simple and at the same time very powerful.
It takes a clever engineer to produce a simple solution to a complex problem.
scruss wrote:
Mon Oct 01, 2018 2:34 pm
Expecting Linux on a modern computer to behave like MS-DOS isn't realistic: we've moved on from single-tasking, single-digit-megahertz computers.
Exactly!

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 5:25 pm

guymark wrote:
Mon Oct 01, 2018 11:30 am
I do think sometimes, it was designed by people who got a buzz out of obfuscating things.
Absolutely - spot on! Even when one eventually gets something to work, it's likely it will break again on the next major OS update. :roll:

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 5:37 pm

jahboater wrote:
Mon Oct 01, 2018 4:46 pm
It takes a clever engineer to produce a simple solution to a complex problem.
That is probably true, but unfortunately those same 'engineers' also got a kick out of choosing silly command names and obscure syntax to maximise the 'geek' factor and make it as difficult as possible for outsiders to gain access to their inner circle.

Heater
Posts: 12595
Joined: Tue Jul 17, 2012 3:02 pm

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 5:55 pm

What silly command names?

Certainly "ls", "rm", "mv", "cat", and the like are heavily abbreviated. But such abbreviations are common in all walks of life where certain terms are used frequently.

User avatar
buja
Posts: 496
Joined: Wed Dec 31, 2014 8:21 am
Location: Netherlands

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 6:23 pm

Those silly commands come from a time when it made perfect sense to be as short as possible because people used teletype terminals and slow serial connections (75 bits per second or so). Those days are gone, but we still have to deal with this legacy. And frankly, the handful of commands Heater lists are the ones I use most and they are easy to remember.
But I will admit the MS-DOS command 'dir' is a bit more descriptive than 'ls'.

On the other hand, I have seen Basic programs without spaces to save memory! :lol:

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 7:16 pm

RichardRussell wrote:
Mon Oct 01, 2018 5:37 pm
That is probably true, but unfortunately those same 'engineers' also got a kick out of choosing silly command names and obscure syntax to maximise the 'geek' factor and make it as difficult as possible for outsiders to gain access to their inner circle.
That is nonsense of course.

Your are of course welcome to type "concatenate" instead of "cat" and so on, if that's all you can understand. Not for long I suspect!

Other names such as "awk" and "grep" were deliberately chosen because there were no pre-existing commands with the same function.

If all these names are difficult for you, then a quick change to your profile:-

Code: Select all

alias dir=ls remove=rm rename=mv concatenate=cat help=man print=cat
solves your problem forever.

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 8:00 pm

jahboater wrote:
Mon Oct 01, 2018 7:16 pm
If all these names are difficult for you...
They are. Setting custom aliases isn't much help if you're trying to use somebody else's machine, or understand a published script. In fact I've never heard of 'awk' and your substitutions didn't include that; what does it do?

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 8:09 pm

buja wrote:
Mon Oct 01, 2018 6:23 pm
On the other hand, I have seen Basic programs without spaces to save memory!
Not for at least 30 years, I hope.

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 9:07 pm

RichardRussell wrote:
Mon Oct 01, 2018 8:00 pm
In fact I've never heard of 'awk' and your substitutions didn't include that; what does it do?
Awk is a pattern scanning and text processing language.
Other OS's didn't provide anything similar, not even now. That's why they chose a random name for it (the initials of its inventors), and that's why I didn't include it in the alias list - what would I put? - there is nothing comparable in DOS or Windows.

Another one is grep. This name actually has a meaning - its an extraction of g/re/p - a common editor command (print all lines in a file that match the regular expression).

Then there is yacc - Yet Another Compiler Compiler (a parser generator).

The common theme with these is that other OS's don't have similar commands - so what on earth should they call them that would be familiar to users of these other platforms?

Another thing you should remember is that the commands might look like they do something familiar but really have a more general use.
For example, "mv" can "rename" files, but really it is "moving" the file, you can for example "move" a file into a sub directory with "mv". The Windows rename command cannot do that. Calling mv rename hides its real, more general, use.

The cat command concatenates files: "cat file1 file2 file3 >outfile" does what you expect. The output is stdout which by default is the screen.
You could type "cat file1 file2 file3" and all three files would appear on the screen. Of course if there is only one file, then cat just prints it out on the screen. Why have another unneeded command called "print" or "list" ?
Last edited by jahboater on Mon Oct 01, 2018 9:24 pm, edited 2 times in total.

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 9:10 pm

After you have used one of these systems (Linux, MacOS or iOS, UNIX) for a week or so, you will get used to the commands and forget it was ever a problem - and you will appreciate the brevity if you are as bad a typist as I am!
RichardRussell wrote:
Mon Oct 01, 2018 8:00 pm
Setting custom aliases isn't much help if you're trying to use somebody else's machine, or understand a published script.
No, and most people never bother. As I say, you very quickly learn the new names.

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 9:35 pm

jahboater wrote:
Mon Oct 01, 2018 9:07 pm
The common theme with these is that other OS's don't have similar commands - so what on earth should they call them?
You're suggesting that the names were not chosen to be deliberately obscure; I find that hard to believe.
After you have used one of these systems (Linux, MacOS or iOS, UNIX) for a week or so, you will get used to the commands
If you know anything about me, you'll be aware that I am suffering from a memory retention problem. It may indeed be true that after using the commands for a while I would remember them, but it would only take a break of a few weeks or months for that to have evaporated again.

Heater
Posts: 12595
Joined: Tue Jul 17, 2012 3:02 pm

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 9:42 pm

jahboater,
For example, "mv" can "rename" files, but really it is "moving" the file,
Interestingly mv does not actually move the file data on disk. It simply relinks it to a new name in the same or other directory. Unless you are moving to a different disk/partition.

Meanwhile in Windows one moves a file from directory to directory with cut and paste operations. That actually makes copies of the files in the new location then deletes the old ones. Which is kind of brain dead because it can be very slow and if you run out of disk space it will fail.

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 9:47 pm

RichardRussell wrote:
Mon Oct 01, 2018 9:35 pm
jahboater wrote:
Mon Oct 01, 2018 9:07 pm
The common theme with these is that other OS's don't have similar commands - so what on earth should they call them?
You're suggesting that the names were not chosen to be deliberately obscure; I find that hard to believe.
I am suggesting that because its true! And why would they? What would be the point?
They were serious, competent, professional engineers producing a serious world class operating system. They didn't play about.
About the worst you could accuse them of was being lazy typists!!

I am sorry you have memory retention issues. Its hard to know what to suggest, other than some aliases so they have names you can remember,
but, as you say, you would have to do it for all your machines. Perhaps, for some of the commands anyway, if you can learn why the names were chosen, it may help you to remember.
Last edited by jahboater on Mon Oct 01, 2018 9:56 pm, edited 1 time in total.

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 9:50 pm

Heater wrote:
Mon Oct 01, 2018 9:42 pm
Interestingly mv does not actually move the file data on disk. It simply relinks it to a new name in the same or other directory. Unless you are moving to a different disk/partition.
That's right. Disassociating the physical file from its meta-data was one of the clever features of the UNIX file system. It made so many things simple and fast. You can even have two names for the same file, and so on.

Heater
Posts: 12595
Joined: Tue Jul 17, 2012 3:02 pm

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 10:03 pm

I don't see anyone going out of their way to make the basic commands, "ls", "mv", "cp", "cat", "rm" etc obscure. They are not obscure they are simple abbreviations of the word that describe what they do "list", "move", "copy", "concatenate", "remove"

Things get a bit more complicated with a command like "more" which displays text files a screen full at a time as you press space, or line at a time as you press return. As in give me more. But that could only go forwards through a file so a new version was made that could also scroll backwards. Just for fun that command was named "less". So we have "less is more, more or less".

Things get really weird with commands like "yacc". What on Earth? Well yacc is a parser generator used for building compilers. There were already many of those so it was called "yet another compiler compiler".

Of course a new improved version of yacc was created. That was called "bison". Because a bison is a kind of Yak.

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 10:22 pm

Heater wrote:
Mon Oct 01, 2018 10:03 pm
Of course a new improved version of yacc was created. That was called "bison". Because a bison is a kind of Yak.
And the new version of "lex" was called "flex" ...

"less", "bison", "flex" etc were all created much later by other engineers.

My guess is that if you are clever enough to be writing compilers with tools like yacc/bison, then the particular tools name is not going to worry you ....

User avatar
RichardRussell
Posts: 493
Joined: Thu Jun 21, 2012 10:48 am

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 11:14 pm

Heater wrote:
Mon Oct 01, 2018 10:03 pm
I don't see anyone going out of their way to make the basic commands, "ls", "mv", "cp", "cat", "rm" etc obscure. They are not obscure they are simple abbreviations of the word that describe what they do "list", "move", "copy", "concatenate", "remove"
Why even bother to abbreviate a four-letter command like 'list', 'move' or 'copy'? What's so different about Unix that it needed ultra-short commands when other contemporary OSes (e.g. VMS, which I was brought up with) didn't?
Just for fun that command was named "less".
Well, precisely! What are "serious, competent, professional engineers producing a serious world class operating system" doing choosing a command name for "fun" rather than to convey to a hapless user what it actually does?

ejolson
Posts: 3013
Joined: Tue Mar 18, 2014 11:47 am

Re: A compilable basic that uses line numbers for Pi?

Mon Oct 01, 2018 11:59 pm

RichardRussell wrote:
Mon Oct 01, 2018 11:14 pm
Why even bother to abbreviate a four-letter command like 'list', 'move' or 'copy'? What's so different about Unix that it needed ultra-short commands when other contemporary OSes (e.g. VMS, which I was brought up with) didn't?
Unix started out as a simplified version of Multics and the ls command came from there. Note that neither the VAX minicomputer nor VMS existed at the time, so they were not contemporary.

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: A compilable basic that uses line numbers for Pi?

Tue Oct 02, 2018 12:48 am

RichardRussell wrote:
Mon Oct 01, 2018 11:14 pm
Just for fun that command was named "less".
Well, precisely! What are "serious, competent, professional engineers producing a serious world class operating system" doing choosing a command name for "fun" rather than to convey to a hapless user what it actually does?
They didn't. That came much later, named by others. (as pointed out above)

jahboater
Posts: 4421
Joined: Wed Feb 04, 2015 6:38 pm

Re: A compilable basic that uses line numbers for Pi?

Tue Oct 02, 2018 1:02 am

RichardRussell wrote:
Mon Oct 01, 2018 11:14 pm
Why even bother to abbreviate a four-letter command like 'list', 'move' or 'copy'? What's so different about Unix that it needed ultra-short commands when other contemporary OSes (e.g. VMS, which I was brought up with) didn't?
Maybe the 75 baud teletypes of the day (as mentioned above).
RichardRussell wrote:
Mon Oct 01, 2018 11:14 pm
(e.g. VMS, which I was brought up with) didn't?
Aha! VMS. Yes. I used that in the past. Long gone now.

I know someone who worked on VMS, when trying UNIX they had great trouble with the word "man" for the help pages (obviously didn't know what a reference manual was).

Return to “Other programming languages”