unmaintainablecode
gmpwasm
Our great sponsors
 InfluxDB  Collect and Analyze Billions of Data Points in Real Time
 Onboard AI  Learn any GitHub repo in 59 seconds
 SaaSHub  Software Alternatives and Reviews
unmaintainablecode  gmpwasm  

58  37  
9,804  12  
    
0.0  10.0  
over 2 years ago  almost 3 years ago  
C  
  GNU General Public License v3.0 only 
Stars  the number of stars that a project has on GitHub. Growth  month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
unmaintainablecode
 How to make intentionally bad code?

Show HN: Spaghettify – A VSCode Extension to make your code worse with AI
Two thoughts:
* This is ridiculous. Why would you do this? Which made think of this quote: "Which is ridiculous and unnecessary but when has that ever stopped programmers?" from one of my favorite Tom Scott videos: https://www.youtube.com/watch?v=gocwRvLhDf8
* How to Write Unmaintainable Code: https://github.com/Droogans/unmaintainablecode
 i litterally died what was my friend tryiing to do here????
 Koje knjige/dokumente preporučujete

how to justify foo and bar;
How to Write Unmaintainable Code is basically a mustread for any programmer in my opinion, even so many years later.

I wrote the leastC C program I could
Oh my the defines. What is language and semantics?
Very ugly, illdefined, uncodified democracy. No one tells you when you vote, no one counts up the votes, there are no official results.
When you speak or communicate with someone else, you are voting with them. "I vote this word means X, for a poor/crude/coarse agreement of what X is the first place."
And this is propaganda at its finest. Evil doublespeak: say one thing, and it actually is another. Snuck in.
Fantastic.

How do you make code unnecessarily obscure?
May I antirecommend (i.e. suggest you read so as not to follow the advice of it) this wonderfully written guide here on unmainable code.

Bad variables
How To Write Unmaintainable Code
gmpwasm

A Linear Algebra Trick for Computing Fibonacci Numbers Fast
There are "bignum" implementations for every language. Though I never tested the performance impact on closedform Fibonacci when a defined double precision >64bit is used.
Your code has an accidentally quadratic runtime (instead of linear). Since the array is appended to, the code regularly increases the memory region and has to move all the previous data over.
You could preallocate the memory as n is known ahead.
 The GMP library's website is under attack by a single GitHub user

Hardware acceleration
The GMP library is useful https://gmplib.org/

What's everyone working on this week (4/2023)?
I recently released Malachite 0.3.2, which includes new support for small prime generation, primorials, and binomial coefficients. How many primes can be represented by a u32? The answer is 203,280,221, and on my machine it takes 6.13 seconds to generate and count them using an iterator created via Malachite's Primes trait: u32::primes().count(). Alternatively, I can get the answer even faster, in 3.85 seconds, using u32::primes_less_than_or_equal_to(&u32::MAX).count()). The first iterator keeps creating larger and larger prime sieves as it goes, whereas the second creates a prime sieve of the right size immediately. It's the same tradeoff as between Vec::new and Vec::with_capacity. As usual, I followed GMP's implementations for primorials and binomial coefficients. The binomial coefficient implementation is pretty elaborate, using 6 algorithms depending on the input size. Some of the variable names in the GMP code are in Esperanto, just to make life a little more difficult. I did not carry this quirk over to Malachite. The next Malachite version will be 0.4.0, and will finally include (initially very limited) support for arbitraryprecision floats! Don't expect much arithmetic yet; I am first focusing on conversion to and from other numeric types (with correct rounding), and on comparison. I am ensuring that all operations give the same results as those implemented by MPFR, by very thoroughly testing against rug::Float.

How to calculate large factorial number in C ?
Because, depending on the architecture, your unsigned long might not be long enough to hold 19!. A 64bit unsigned long would be sufficient, but a 32bit would not be. You could try uint64_t instead (use #include ), or, if that isn't sufficient, use an arbitraryprecision library like GMP.
 i litterally died what was my friend tryiing to do here????
 How to convert a large decimal number in string form to base 2^16 in C?

Working with extremely large numbers?
If you don't want to deal with doing things by yourself, you could try GMP. It has a C++ interface and being GNU you can count on Cygwin to provide a .dlll (cyggmpxxversion.dll is the name) if you don't want to build it yourself.

I'm implementing a vectorbased lisp
I definitely suggest implementing fixnums with pointer tagging. It's fun and useful. To begin with, just signal an error on overflow, and then move on to actually implementing bignums once the basics work. Unless you specifically want to have zero dependencies, I'd use gmp for bignums, as it can be pretty tricky to implement by hand.

How are infinitely large numbers represented and used like Python’s int class and Haskell’s Integer type?
In C, the GMP library (aka GNU MP Bignum library) is the most wellknown library in the domain. It offers unparalleled performance for arithmetic, at the cost of being fairly big.
What are some alternatives?
snesapu  A Super Nintendo audio unit emulator.
COBOL.now  Now is the time to COBOL!
kona  Opensource implementation of the K programming language
Monocypher  An easy to use, easy to deploy crypto library
iocccobfuscatedccontest  IOCCC International Obfuscated C code contest entries
FuckIt.py  The Python error steamroller.
Nginx  An official readonly mirror of http://hg.nginx.org/nginx/ which is updated hourly. Pull requests on GitHub cannot be accepted and will be automatically closed. The proper way to submit changes to nginx is via the nginx development mailing list, see http://nginx.org/en/docs/contributing_changes.html
libnest2d  2D irregular bin packaging and nesting library written in modern C++
Random  Repository of Random, Useful, or Novel Functions
hardened_malloc  Hardened allocator designed for modern systems. It has integration into Android's Bionic libc and can be used externally with musl and glibc as a dynamic library for use on other Linuxbased platforms. It will gain more portability / integration over time.
readinglist  List of books for software developers 📖
RustCAS  Rust Computer Algebra library