deleted by creator
- 0 Posts
- 60 Comments
anton@lemmy.blahaj.zoneto Programming@programming.dev•Daniel Stenberg is awarded as Developer of the year by Developers Bay5·17 days ago* Swedish developer of the year
Don’t get me wrong, he does great work, but your post should mention it somewhere.
Rust doesn’t allow type inference in function signatures, c++ does with auto. IIRC, they recommended against using it, because of -you guessed it- compile time.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Yes, I did spend time on this21·26 days agoYou could save 0.64 bit per char more if you actually treated you output as a binary number (using 6 bits per char) and didn’t go through the intermediary string (implicitly using base 100 at 6.64 bits per char).
This would also make your life easier by allowing bit manipulation to slice/move parts and reducing work for the processor because base 100 means integer divisions, and base 64 means bit shifts. If you want to go down the road of a “complicated” base use base 38 and get similar drawbacks as now, except only 5.25 bits per char.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Yes, I did spend time on this5·26 days agoUnless you only copy and compare you have to decode it, or implement more complicated logic for everything from searching to concatenation (which is normally just memcopy).
anton@lemmy.blahaj.zoneto Programming@programming.dev•I just created an experimental Node.js Framework.41·1 month agoThe standard xkcd on making another thing:
https://xkcd.com/927On frameworks specifically, I recommend the song:
We’re gonna build a framework,
cause we wanna use one,
but don’t wanna choose oneWe’re gonna build a framework
We didn’t like the others,
So we’ll write another
I never understood why they don’t add just a little syntactic sugar. You don’t need much to take it from a mess of brackets to something comprehensible.
It was in the original design, but not the first implementation. By the time someone got around to it, people where used to S-expressions.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•I got to avoid memory management for quite some time3·1 month agoI can’t comment whether learning C first improves your rust, but it certainly makes you appreciate what the rust compiler does.
Also learning rust improved my C.
C++ already has much more of the required language constructs, which is why there is already an attempt to add borrow checking to C++ called circle. Until that standardizes, I wouldn’t expect it in C.
anton@lemmy.blahaj.zoneto Programming@programming.dev•Handling of unlikely syscall errors2·2 months agoI think you should make the overwhelmingly likely case crash in a controlled way, but provide a way to handle it for people who truly want to keep going in such strange conditions.
In rust I would panic in
now()
, but also provide a alternative call that returns a result named something liketry_now()
, similar toVec::with_capacity
andVec::try_with_capacity
.
In languages that provide them, you could also throw a runtime exception that can be ignored and just bubbles up to main unless explicitly caught.
anton@lemmy.blahaj.zoneto Programming@programming.dev•We Asked 100+ AI Models to Write Code. The Results: AI-generated Code That Works, But Isn’t Safe7·2 months agoIf a system was made to show blogs by the author and gets repurposed by a LLM to show untrusted user content the same code becomes unsafe.
As if a white space sensitive language protects from this fuckery.
- How many thin spaces are one level of indentation?
- Will anyone notice a hair space?
- Who can tell the difference between a space and a figure space? they are the same size in a mono spaced font
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Replication of Quantum Factorisation Records with an 8-bit Home Computer, an Abacus, and a Dog8·2 months agoAnyone able to find the prime factors of 35 in their head is able to outperform state of the art quantum computers.
anton@lemmy.blahaj.zoneto Programmer Humor@programming.dev•Something something history is a flat circle1·2 months agoRust has monomorphisation like C++ and every function has the aliasing guarantees of restrict, a keyword rarely seen in C code bases use and C++ doesn’t even support.
This means you can get more optimisations while writing in an intuitive style, where C/C++ requires some changes to the code.On the other hand rustc has some hiccups with argument passing and rvo. One could argue that that’s just the compiler while the aliasing problems are part of the language in the C/C++ case, but while there is only one rust compiler its performance is the languages performance.
For most use cases they are about equally fast.
anton@lemmy.blahaj.zoneto Programming@programming.dev•How thorough is this testing and review process? Am I understanding this correctly that they only review portions of the code, on top of function & security testing?4·3 months agoIts probably the usual closed source, but maybe not, I can’t take more of the abbreviation soup.
The other big danger is a attacker from the inside, and unless they have a amazing solution in their confidential jira, they just declared it not a problem.
anton@lemmy.blahaj.zoneto Programming@programming.dev•How thorough is this testing and review process? Am I understanding this correctly that they only review portions of the code, on top of function & security testing?4·3 months agoThis is how I read it:
They did a review of some of the tests, but ran all.
The source code was reviewed in its entirety.
They found vulnerabilities, but because “[…] these potential vulnerabilities would be exploitable only by a vendor insider attack.
No open issues remain for this area of review.”
Problems and discrepancies they found are in an attachment to another report and in jira, both of which are confidential.
anton@lemmy.blahaj.zoneto Green Energy@slrpnk.net•Can somebody please explain why the world hasn't gone nuclear yet?1·3 months agoWhy would we need to store energy for more than an day? We only need to smooth out the difference between supply and demand.
The mayor advantage of the European grid is the disconnectedness over long distances. There are always enough places where the sun shines or the wind blows.
anton@lemmy.blahaj.zoneto Green Energy@slrpnk.net•Can somebody please explain why the world hasn't gone nuclear yet?3·3 months agoI am not arguing that nuclear should have been phased when it was, as that resulted in more coal and gas, but that clinging to it now is a mistake.
Building a new nuclear power plant in Germany would take a decade if things went well. Until then grid battery storage can mature and demand adjustment projects can be rolled out. It’s probably also easier to convince germans to accept pumped hydro where they live over nuclear.
anton@lemmy.blahaj.zoneto Green Energy@slrpnk.net•Can somebody please explain why the world hasn't gone nuclear yet?4·3 months agoWith the same amount of money you can build so much more renewable generation and storage than nuclear.
This doesn’t change it to a png, but your image viewers recognize it as webp. You should just associate .wepb with your image viewer in the OS.