Go to advanced search

by jahboater
Fri Apr 26, 2019 5:20 am
Forum: C/C++
Topic: g++ compiler can't find include files
Replies: 21
Views: 14914

Re: g++ compiler can't find include files

Different problem that perhaps should be in a new thread. I've had the same problem for months now. Raspberry doesn't seem to like C. C works just fine on the PI (and C++). After all, most of it is written in C. Some help please? and maybe some explaining why some things work without "Includes"? I t...
by jahboater
Wed Apr 24, 2019 7:17 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

As you have pointed out, however, using those specialized instructions obscures the inner working of the algorithms. Why does that matter? I just trust them to work and get on with making sure the rest of my application is correct. Ditto for standard library functions. Code re usability. Hardware i...
by jahboater
Tue Apr 23, 2019 10:30 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

Like I said, rather than writing: a = b + c you might have to write: bigAdd(a, b, c) Maybe that is "trivial" for you in simple cases but I think you have to admit it makes things more verbose and obscure than need be. Of course. Agreed. There are perhaps four levels. (1) at the top we have in an ex...
by jahboater
Tue Apr 23, 2019 7:17 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

For example. The C and C++ languages have a notion of integer types. 16 or 32 or 64 bits. Whatever your architecture supports. If you want to do maths on arbitrarily big integers the languages do not support that and you have a lot of work to do. No - you don't have a lot of work to do. You just us...
by jahboater
Tue Apr 23, 2019 1:42 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

GMP has a heavily optimized function:-

mpz_fib_ui( result, 4784969 );

that does it in one go.
The million digit fibo computes in 39ms on my old PC.
by jahboater
Tue Apr 23, 2019 1:32 pm
Forum: Arch
Topic: Manjaro dropping ARMv7 support
Replies: 44
Views: 832

Re: Manjaro dropping ARMv7 support

the spreading of the myth that one needs a 64-bit architecture to use larger memory sizes, that one can't access more than 4GB RAM without moving to a 64-bit architecture. Without some kind of horrible address mapping thing in hardware, how can a 32-bit address access more than 4GB? Well, the simpl...
by jahboater
Tue Apr 23, 2019 12:34 pm
Forum: Arch
Topic: Manjaro dropping ARMv7 support
Replies: 44
Views: 832

Re: Manjaro dropping ARMv7 support

hippy wrote:
Tue Apr 23, 2019 11:12 am
the spreading of the myth that one needs a 64-bit architecture to use larger memory sizes, that one can't access more than 4GB RAM without moving to a 64-bit architecture.
Without some kind of horrible address mapping thing in hardware, how can a 32-bit address access more than 4GB?
by jahboater
Tue Apr 23, 2019 12:31 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

hippy wrote:
Tue Apr 23, 2019 10:06 am
I think we would all agree that any language calling "gmp", or anything equivalent to that, will pass the challenge.
Except for for poor old C. Even though GMP is written in C and intended for use in C, its not considered acceptable.
by jahboater
Tue Apr 23, 2019 9:22 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

bensimmo wrote:
Tue Apr 23, 2019 9:12 am
*with python many parts are there as standard but you still need to import them, so import maths, is that allowed ?)
Python has no proper standard (e.g. ISO or ECMA) so its not clear how to proceed.
"de-facto" standards (such as using GMP in C) are not permitted.
by jahboater
Tue Apr 23, 2019 8:21 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

Actually, I'm not sure what you mean by "as if it were a variable".  No assignment needed. Use the results (as a string or a number) in its intermediate state. I think whats meant is "n = fibo(a) + 42 + fibo(b)" or some such - using the result of the function directly in an expression. In C you wou...
by jahboater
Mon Apr 22, 2019 7:06 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

I found the interesting statement Intel Nehalem can do 3 additions every cycle, but only 1 addition with carry every two cycles (carries cost a factor of 6!) That's interesting. But isn't C the only HLL that can use the carry flag directly? ... and that's a compiler extension. The delay for the car...
by jahboater
Mon Apr 22, 2019 5:44 pm
Forum: Beginners
Topic: Selecting text automatically copies it - how to stop
Replies: 7
Views: 180

Re: Selecting text automatically copies it - how to stop

I get the same behavior but only in terminal or nano from a SSH session. In an ssh terminal window it only writes to the clip board when I do "edit/copy" from the terminal emulator's drop down menu. What happens when you select some text with the mouse then right click on the next line? I have to r...
by jahboater
Mon Apr 22, 2019 1:17 pm
Forum: Beginners
Topic: Selecting text automatically copies it - how to stop
Replies: 7
Views: 180

Re: Selecting text automatically copies it - how to stop

klricks wrote:
Mon Apr 22, 2019 1:09 pm
I get the same behavior but only in terminal or nano from a SSH session.
In an ssh terminal window it only writes to the clip board when I do "edit/copy" from the terminal emulator's drop down menu.
by jahboater
Mon Apr 22, 2019 12:28 pm
Forum: Python
Topic: python to binary file from ubuntu
Replies: 6
Views: 169

Re: python to binary file from ubuntu

Although technically both Ubuntu and Raspbian are Linux operating systems, the target hardware is dramatically different. Ubuntu runs on a 64 bit x86 architecture while Raspbian runs on a BMC SOC which is ARM-based, but Raspbian currently uses 32-bit architecture. You can run Ubuntu on the Raspberr...
by jahboater
Mon Apr 22, 2019 7:43 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

Your name will be remembered alongside Babbage, Lovelace, Dikstra, Knuth ...
by jahboater
Sun Apr 21, 2019 6:56 am
Forum: The MagPi
Topic: Errors in An Introduction to C & GUI Programming.
Replies: 13
Views: 411

Re: Errors in An Introduction to C & GUI Programming.

Sorry, yes, bad choice of example!

Code: Select all

static bool
integer( const double x )
{
  return trunc(x) == x;
}
is much safer and produces the same code.

The only slight problem is that you cant check the function versions with static_assert().
by jahboater
Sat Apr 20, 2019 9:11 pm
Forum: Debian
Topic: Headless install
Replies: 5
Views: 142

Re: Headless install

Yes, my power supply works. I already checked that, as it looks like the most common issue. Same supply worked for more than a year, when powering a C.H.I.P. with an external HDD. How did you check that it works? Just because it powered something else means nothing. Try this vcgencmd get_throttled ...
by jahboater
Sat Apr 20, 2019 7:40 pm
Forum: Debian
Topic: Headless install
Replies: 5
Views: 142

Re: Headless install

BurningShadow wrote:
Fri Apr 19, 2019 8:00 pm
And, does Debian actually work, or is it just more of the same?
You wont gain anything by using Debian, Raspbian is based on Debian.
I have had many Pi's over many years, with five running 24/7, and Rasbian does not trash my SD cards.
by jahboater
Sat Apr 20, 2019 6:42 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

ScriptBasic wrote:
Sat Apr 20, 2019 6:03 pm
I would like to suggest we limit the Fibonacci range to floating point 64 bit maximum to prevent strolling into Python's unlimited digit integer emulation.
:) You get one more term in a proper language that supports unsigned integers :)
fibo(93) succeeds, fibo(94) fails in C.
by jahboater
Sat Apr 20, 2019 4:07 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

Brilliant!
by jahboater
Sat Apr 20, 2019 4:03 pm
Forum: The MagPi
Topic: Errors in An Introduction to C & GUI Programming.
Replies: 13
Views: 411

Re: Errors in An Introduction to C & GUI Programming.

My biggest gripe with C is macros, part of the language which can modify your source code before it gets compiled. Though at least nowadays gcc gives fairly decent warnings when it sees potential problems with the changes that they make. Also their usage is declining I think. enum's replace many #d...
by jahboater
Sat Apr 20, 2019 7:35 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

No offence taken. There is a free version with some limited functionality available from the 8th web site. I pay happily a few bucks from a good product and support the developer. That's fine. The trouble is, the Pi comes as standard, pre-installed, with a number of powerful languages completely fr...
by jahboater
Sat Apr 20, 2019 7:28 am
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

Heater wrote:
Sat Apr 20, 2019 6:19 am
In reality the Pi was "engineered" to run Java:
I think that's Jazelle which is the J in the name.
arm1176jzf-s

Its only in there now with "trivial" support.
by jahboater
Fri Apr 19, 2019 6:41 pm
Forum: Off topic discussion
Topic: Why Avoid BASIC on RPi?
Replies: 2072
Views: 76342

Re: Why Avoid BASIC on RPi?

Hippy, Interesting results So one could say that we're not actually benchmarking the algorithm or the language at all, mostly timing how long it takes some in-built library to output a big number. Its certainly true that the conversion to decimal and the print out is costly. That's why the hand writ...
by jahboater
Fri Apr 19, 2019 10:53 am
Forum: Bare metal, Assembly language
Topic: Low level RPI programming
Replies: 6
Views: 240

Re: Low level RPI programming

There is also plain "as" the gnu assembler that comes with the Pi.
The compiler outputs assembler and uses as to assemble it (so it is fast and extremely well tested!).
It supports just about everything and has great diagnostics.

The compiler has a flag "-ffree-standing" that might be useful.

Go to advanced search