Go to advanced search

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: 4846

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: 10435

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: 10435

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: 10435

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: 10435

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: 3032

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: 10435

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: 10435

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.
by jahboater
Wed Oct 02, 2019 7:53 am
Forum: C/C++
Topic: Running C/C++ on Raspberry Pi
Replies: 32
Views: 3032

Re: Running C/C++ on Raspberry Pi

nick8967 wrote:
Wed Oct 02, 2019 7:19 am
or I should do "tricks" and result in doing nothing?
Interesting to know what these "tricks" are ?
by jahboater
Wed Oct 02, 2019 7:39 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

I do sometimes worry about the slow build times of Rust and the amount of memory it takes. So far that is nowhere near being a show stopper for me. The Cargo build system only recompiles modules that have been modified, turn around time is quite comfortable for normally sized modules. I wonder if i...
by jahboater
Wed Oct 02, 2019 7:33 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

On my ubuntu i7 laptop, if I tell the compiler to ignore unused stuff (#[allow(dead_code)], #[allow(unused_variables)], #[allow(unused_assignments)] Those features are one of things I actually like about Rust. I wouldn't turn those off. Deleting dead code, unused variables and assignments, goes a l...
by jahboater
Tue Oct 01, 2019 3:14 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

Heater, My answer above deliberately avoided the thin ice! Even the same language translated by two different compilers may run at different speeds. Interesting discussion. There is just the simplistic comparison we can do with a basic example like your z = x + y A fast language like Fortran or C, w...
by jahboater
Tue Oct 01, 2019 8:31 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

Different compilers .... Could Clang/LLVM be used for the C/C++ version? Otherwise its all meaningless. Not really. Clang does better on this benchmark, but that's not always the case. It doesn't matter which compiler does better. The fact is they are different and therefore you are not just compar...
by jahboater
Tue Oct 01, 2019 6:57 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

Different compilers ....
Could Clang/LLVM be used for the C/C++ version?
Otherwise its all meaningless.
by jahboater
Mon Sep 30, 2019 8:24 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

You have skipped over a very important detail there. The keyword "unsafe". when the unsafe keyword is used with function definitions, code blocks and elsewhere. See: https://doc.rust-lang.org/reference/unsafe-blocks.html Aah OK, I misread it. I took this: Rust code is incorrect if it exhibits any o...
by jahboater
Sun Sep 29, 2019 11:24 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

Heater, I thought your problem with C was the possibility of undefined behavior? See this list in the Rust doct: https://doc.rust-lang.org/reference/behavior-considered-undefined.html The list for C is longer, but it is complete and definitive (and is included in the ISO standard). The Rust list (th...
by jahboater
Sun Sep 29, 2019 9:09 pm
Forum: General discussion
Topic: What is a good replacement for Etcher (ads and ignores privacy)
Replies: 83
Views: 4846

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

Etcher is a easy to use tool, with a GUI, some handholding, and data validation. Plus it is easily installed on Windows and MacOs. Totally makes sense to recommend it to new folks. If you are comfortable with Linux, you likely did not need to ask since the easily found instructions make sense. I ju...
by jahboater
Sun Sep 29, 2019 8:59 pm
Forum: General discussion
Topic: SD Card power failure resilience ideas
Replies: 31
Views: 2124

Re: SD Card power failure resilience ideas

Even if you provide a mechanism to ensure the current block write completes successfully, it doesn't solve the problem that the operating system probably has a huge amount of cached filesystem changes that won't be written to SD card. While the card may be logically intact following a loss of power...
by jahboater
Sun Sep 29, 2019 8:44 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

I don't think Rust allows you to turn off array bounds checking, at least you couldn't the last time I fought with rustc. There is significant overhead to checking every indexed access. Compare a Rust coded 2-D FFT with one coded in C. I believe there is a space overhead too - needed in some cases ...
by jahboater
Sun Sep 29, 2019 7:50 pm
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

Traditionally languages did not use the same compiler. ALGOL was compiled by an ALGOL compiler, Fortran by a Fortran compiler. Same for PL/M, Coral and a ton of others. Yes. Long ago Fortran was popular for running benchmarks and comparing mainframes. So the manufacturers made sure their Fortran co...
by jahboater
Sun Sep 29, 2019 10:53 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

Of course the extra strict compile time checking of Rust would make such changes immediately apparent and prevent undefined behaviors. Yes. And that's fine, the safe option. Better than Python 2/3. New features in C are introduced in such a way that existing code will still compile. Starting with C...
by jahboater
Sun Sep 29, 2019 10:43 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

But, they can have been "enhanced" to the point where they have diverged from their original roots (Yes, I'm looking at you C++ :-) ) Take a look at "modern" Fortran. If you grew up with Fortran IV like I did, you wont see much that is familiar. C seems to be ultra stable, presumably because of the...
by jahboater
Sun Sep 29, 2019 10:32 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

It difficult to compare two languages for speed. Only if both languages are supported by the same compiler is it reasonable. I am skeptical about claims that xxx safe language is faster than C. Sure certain language features might allow static checks, but that is still no faster than C which by defa...
by jahboater
Sun Sep 29, 2019 10:11 am
Forum: Other programming languages
Topic: The Rust debate.
Replies: 151
Views: 10435

Re: The Rust debate.

Some general points.... I think it's important to remember that when you compare languages one key question to bear in mind is "How long have they existed?". It's unfair to judge a new language in the same way you would an mature one. New ones can change since they don't yet have the inertia of a l...
by jahboater
Sat Sep 28, 2019 9:25 pm
Forum: General discussion
Topic: Raspberry Pi 4 constantly crashes and is overheating
Replies: 15
Views: 1679

Re: Raspberry Pi 4 constantly crashes and is overheating

pcmanbob wrote:
Sat Sep 28, 2019 9:22 pm
A common cause of rebooting like you are experiencing is a power supply that is not suitable for the pi, so what are you using as a power supply ?
+1

Sorry I didn't think of that.

Use the "official" Raspberry Pi PSU, they are well known to be problem free (and are cheap!)

Go to advanced search