Go to advanced search

by jahboater
Thu Oct 03, 2019 8:13 pm
Forum: Bare metal, Assembly language
Topic: What can i really make in ARM Assembly
Replies: 18
Views: 1738

Re: What can i really make in ARM Assembly

If you use GCC then you get all the C start up stuff included (and a different entry point "main" instead of "_start"), and a dependency on libc. If you use "as", then whats in the executable is just your code. Doesn't matter much unless your are trying for a really minimal executable! And the C pre...
by jahboater
Thu Oct 03, 2019 5:19 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

Too many high-end C compilers rely on undefined behaviour for them to be able to do their optimisations. What happens is this: Undefined behavior cannot happen in a correct C program. Therefore if a compiler can detect the UB, its free to delete the code. This is commonly seen with badly designed a...
by jahboater
Thu Oct 03, 2019 4:32 pm
Forum: Bare metal, Assembly language
Topic: What can i really make in ARM Assembly
Replies: 18
Views: 1738

Re: What can i really make in ARM Assembly

That is indeed true.Whilst it has been quite some time since I needed to do any assembler programming, its still important to have some knowledge in order to do debugging at a fairly low level. I agree with this. This book should get you started: https://www.amazon.com/ARM-A32-Assembly-Language-32-...
by jahboater
Thu Oct 03, 2019 3:27 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

I thought all unsigned arithmetic was defined. The problem is if int is larger than 16 bits then the code snippet isn't unsigned arithmetic, it's conversion to int, followed by signed arithmetic, followed by conversion back to uint16_t . OK, if the original operand fits in a signed int then that's ...
by jahboater
Thu Oct 03, 2019 3:01 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

Sal55, (ETA: this still leaves the print-format problem unresolved, especially calling printf-family functions from another language. What format code to use for your genuine (ie. not bolted-on to int or long) int32 and int64 types?) You also have the problem of 64-bit literals. In 64-bit modes the ...
by jahboater
Thu Oct 03, 2019 2:52 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

plugwash, Unfortunately the C99 typedefs don't fully solve the problem because of C's boneheaded promotion and overflow rules, consider for example. I thought that was to accommodate processors which cannot do arithmetic on types smaller than int - like the Pi's ARM CPU's. The Pi can load a byte or ...
by jahboater
Thu Oct 03, 2019 2:40 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

Sal55, The common memory model for 64-bits is LP64 - that is L ongs and P ointers are 64-bits. For 32-bit mode, the memory model should be ILP32 that is I ntegers, L ongs and P ointers are all 32-bits. Windows uses LLP64 which is L ong L ong and P ointers are 64-bits Long remains 32-bits the same as...
by jahboater
Thu Oct 03, 2019 2:10 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

POSIX implementations mandate 8 bits. Yes, that's what I thought. And its near 40 years since I used a machine without 8 bit bytes. :) I am sure Peter O has some working computers in his museum with some other sizes :) On a related note, I believe there are no longer any known computers where the i...
by jahboater
Thu Oct 03, 2019 12:36 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

When is that? I've just glanced at the ScriptBasic sources (it was mentioned a few posts above) and they seem to use 'long' extensively. Which means that when long is 64 bits, and the hardware is 32 bits, it will now be wasting time doing unnecessary 64-bit ops. (And if it expects long to be 64 bit...
by jahboater
Thu Oct 03, 2019 11:51 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

John_Spikowski wrote:
Thu Oct 03, 2019 11:41 am
ScriptBasic (ANSI C) ported to 64 bit and ARM with nothing more than a gcc command line addition.
I think that's rather impressive.

I'd like to know what that command line option was ???
by jahboater
Thu Oct 03, 2019 11:42 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

Whereas more modern languages that have ranges of fixed-width types have standardized on widths of 8, 16, 32 and 64 bits, including Rust. Precisely what C did 20 years ago ... C99 introduced exact width types and others such as int_fast and int_least. Forget about what they may map onto, it is of n...
by jahboater
Thu Oct 03, 2019 9:33 am
Forum: General discussion
Topic: Raspi4 first usage
Replies: 11
Views: 507

Re: Raspi4 first usage

Dear Forum I just got my raspi 4 and I am just shocked This board really terrible, it does not work at all I used to work with raspi starting from model 2 and seems this one is the worst among all. After setting up the image it opened up the desktop and asked for update, I pressed okay and my monit...
by jahboater
Thu Oct 03, 2019 9:16 am
Forum: Troubleshooting
Topic: Raspberry Pi cannot to linux vua putty
Replies: 3
Views: 100

Re: Raspberry Pi cannot to linux vua putty

Hi,there i want to connect to raspberrypi 1 A+ using putty in linux (ubuntu) via ssh connection but i got error as access denied whenever i try to login the raspberry pi via putty . If you are using ubuntu, then you don't need putty. Just use ssh directly. You can copy files to and from the Pi with...
by jahboater
Thu Oct 03, 2019 8:28 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

If you drop that code into the Godbolt Compiler Explorer, here: https://godbolt.org/z/8PJ72Q it shows all the generated assembler. If you click on the source line you are interested in and hit Cnt-F10 it takes you to the appropriate assembler lines, nicely highlighted in blue. Godbolt is amazing. I...
by jahboater
Wed Oct 02, 2019 10:43 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

Sal55, I've had the same problems. Then I might put special markers in the code that will hopefully be easy to find, eg. an assignment involving the constant 123456 or 0x123456 (or both). In the above example, perhaps change the 42 to a bigger magic number (may need to change the array element type)...
by jahboater
Wed Oct 02, 2019 10:31 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

Where did you read that? The guys in the presentation I linked to said it was not in GCC but they would be happy to help with the GCC devs if they want to adopt the object lifetime analysis code. That presentation was only days ago. In the GCC dev list. There was quite a lot of talk about it a few ...
by jahboater
Wed Oct 02, 2019 10:24 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

paddyg wrote:
Wed Oct 02, 2019 9:34 pm
But talk about needles in haystacks! I've put the results online if you want to look at all 37,000 lines of disassembled code.
37,000 lines !!!!!! Eek.
For the C version, GCC removed everything and just did the return zero from main (2 instructions).
by jahboater
Wed Oct 02, 2019 5:26 pm
Forum: General discussion
Topic: What is a good replacement for Etcher (ads and ignores privacy)
Replies: 83
Views: 4766

Re: What is a good replacement for Etcher (ads and ignores privacy)

After writing do "sha256sum" of the SD card and compare wih sha256sum value on Raspbian download site. Can you do that? I thought the published checksum was for the zip file. I use "cp" by the way instead of "cat". Two characters less to type :) Does cat actually work with sudo? Otherwise you could...
by jahboater
Wed Oct 02, 2019 4:56 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

Heater, The compiler does know the provenance of the pointers it creates. It can trace the ownership of those pointers through your source at compile time. It can therefore tell from your source that the pointer is never null or pointing at something invalid. Of course at run time there is a malloc ...
by jahboater
Wed Oct 02, 2019 4:53 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

Heater wrote:
Wed Oct 02, 2019 2:19 pm
1) As of Clang 10 and new MSCVCC there is object lifetime analysis in C++.
And GCC. Though I am not sure its in a released version yet.
by jahboater
Wed Oct 02, 2019 4:46 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

jahboater, Perhaps its turned off by default like integer overflow checks, or perhaps the array dimensions and indexes are known, or deducible, at compile time (my guess). Nope. Checked at run time in debug and release builds: $ cat src/main.rs fn main() { let my_array = vec![0, 1, 2, 3, 4]; printl...
by jahboater
Wed Oct 02, 2019 11:13 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

Said project is a major reason I'm getting into Rust just now. If you are talking about installing the latest GCC, I find it far far easier than Clang/LLVM. On the Pi4, just start a simple script, wait for about 3 hours, and its all done. All the dependencies are automatically dealt with. And of co...
by jahboater
Wed Oct 02, 2019 10:36 am
Forum: C/C++
Topic: Running C/C++ on Raspberry Pi
Replies: 32
Views: 3025

Re: Running C/C++ on Raspberry Pi

The best optimization I can get is with gcc or with Visual Studio? GCC is pre-installed and ready to use. Clang is an alternative that may be installed if desired. The optimization done by GCC is class leading. You can easily examine the assembler code emitted. If you are familiar with assembler, y...
by jahboater
Wed Oct 02, 2019 9:49 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

The fft_bench program is of course dominated by array access. The fact that the Rust and C versions run at the same speed rather demonstrates the point. Perhaps its turned off by default like integer overflow checks, or perhaps the array dimensions and indexes are known, or deducible, at compile ti...
by jahboater
Wed Oct 02, 2019 9:46 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10415

Re: The Rust debate.

In the past I have had to use "j=1" when making large C++ programs on the Pi else it runs out of memory as it tries to compile too many things at the same time on all those cores. Get a Pi4 4GB! No need to mess with extra swap, for any sized compilation, even the monstrous build of the GCC compiler.

Go to advanced search