foundationallib
Finally, a cross-platform, portable, well-designed, secure, robust, maximally-efficient C foundational library โ Making Engineering And Computing Fast, Secure, Responsive And Easy.
- Enables better Engineering Solutions and Security broadly and foundationally where Software Creation or Development or Script Creation is concerned - whether this be on a local, business, governmental or international basis, and makes things easier - and Computing in General. Don't Reinvent the Wheel - Use Good Wheels - Be Safe And Secure.
- Enables a free-flowing dynamic computer usage that you need, deserve and should have, simply because you have a computer. With full speed and with robustness. You deserve to be able to use your computer wholly and fully, with proper and fast operations.
- Enables flexibility and power - makes C accessible to the masses (and faster and more secure) with easy usage and strives to bring people up, not degrade the character or actions of people. This is a fundamental and unequivocal philosophy difference between this library and many subsections of Software Engineering and the mainstream engineering establishment. For instance, in Python, you cannot read a file easily โ you have to read it line-by-line or open a file, read the lines, then close it. With this library, you can efficiently read 10,000 files in one function call. This library gives power. Any common operation, there ought to be a powerful function for.
We should not bitch around with assembly when we don't want to; we should also have full speed. Some old "solutions" deliver neither, then culturally degrade programmers because their tools are bad - actually, it just degrades programmers, and gives them bad tools. COBOL is an example ...
Human technology is about empowerment โ people must fight for it to be empowerment, we don't have time to have AI systems kill us because we want to have bad tools and be weak. We must fight.
- โCross platform - works perfectly in embedded, server, desktop, and all platforms - tested for Windows and UNIX - 64-bit and 32-bit, includes a 3-aspect test suite, with more to come.
- โBug free. Reliable. Dependable. Secure. Tested well.
- โZero Overhead - Only 1 byte due to the power of the error handling, can be configured will full power.
- โStatic Inline Functions if you want them (optional) - Eliminating function call overhead to 0 if you wish, for improved performance.
- โCustom allocators - if you want it.
- โCustom error handling - if you want it.
- โSafe functions warn the programmer about NULL values and unused return values. Can be configured to not compile if not Secure. Optional null-check macros in every library function. Does not use any of
"gets", "fgets", "strcpy", "strcat", "sprintf", "vsprintf", "scanf", "fscanf", "system", "chown", "chmod", "chgrp", "alloca", "execl", "execle", "execlp", "execv", "execve", "execvp", "bcopy", "bzero"
. You can configure it to never use any unsafe functions. - โPortable - works on all platforms, using platform specific features (using #ifdefs) to make functions better and faster.
- โMultithreading support (optional), with list_comprehension_multithreaded (accepts any number of threads, works in parallel using portable C11 threads)
- โNetworking support (optional), using libcurl - making it extremely easy to download websites and arrays of websites - features other languages do not have.
- โVery good and thorough Error Handling and allocation overflow checking (good for Security and Robustness) in the functions. Allows the programmer to dynamically choose to catch all errors in the functions with a handler (default or custom), or to ignore them. No need to ALWAYS say "if (.....) if you don't want to. Can be changed at runtime.
- โPublic Domain so you make the code how you want. (No need to "propitiate" to some "god" of some library).
- โMinimal abstractions or indirection of any kind or needless slow things that complicate things - macros, namespace collision, typedefs, structs, object-orientation messes, slow compilation times, bloat, etc., etc.
- โNo namespace pollution - you can generate your own version with any prefix you like!
- โRelies minimally on C libraries - it can be fully decoupled from LIB C and can be statically linked.
- โVery small - 13K Lines of Code (including Doxygen comments and following of Best Practices)
- โNo Linkage Issues or dependency hell
- โThorough and clear documentation, with examples of usage.
- โNo licensing restrictions whatsoever - use it for your engineering project, your startup, your Fortune 500 company, your personal project, your throw-away script, your government.
- โMakes C like Python or Perl or Ruby in many ways - or more easy
- โEasy Straightforward Transpilation Support - to make current code, much faster - all without any bloat (See transpile_slow_scripting_into_c.rb).
In many cases, there is now a direct mapping of functions from other languages into optimized C. See the example script in this repository. This makes optimizing your Python / Perl / Ruby / PHP etc. script very easy, either manually or through the use of AI.
About Foundationallib
Foundationallib Features
Functional Programming Features - map, reduce, filter,
List Comprehensions in C and much more!
Expands C's Primitives for easy manipulation of data types such as Arrays, Strings, Dict
, Set
, FrozenDict
, FrozenSet
- and enables easy manipulation, modification,
alteration, comparison, sorting, counting, IO (printing) and duplication of these at a very comfortable level -
something very, very rare in C or C++, all without any overhead.
More comfortable IO - read and write entire files with ease, and convert complex types into strings or print them on the screen with ease.
A powerful general purpose Foundational Library - which has anything and
everything you need - from replace_all()
to replace_memory()
to find_last_of()
to
to list_comprehension()
to shellescape()
to read_file_into_string()
to
string_to_json()
to string_to_uppercase()
to to_title_case()
to read_file_into_array()
to read_files_into_array()
to map()
to reduce()
to filter()
to list_comprehension_multithreaded()
to frozen_dict_new_instance()
to backticks()
- everything you would want to make quick and optimally efficient C programs, this has it.
Helps to make programs hundreds of times faster than other languages with similar ease of creation.
Easily take advantage of CPU cores with list_comprehension_multithreaded().
You can specify the number of threads, the transform and the filter functions, and this will transform your data - all in parallel. Don't have a multithreaded environment? Then disable it (set the flag).
You don't want to be reinventing the wheel and hoping that your memory allocation is secure enough - and then failing. Security Is Paramount.
a day for an operation to complete when it could take less than an hour.
You don't want to be waitingThis library is founded on very strong and unequivocal goals and philosophy. In fact, I have written many articles about the foundation of this library and more relevantly the broader context. See the Articles folder - for some of the foundation of this library.
This library is an ideal and a dream - not just a Software Library. As such, I would highly suggest that you support me in this mission. Even if it's different from the status quo. Are you a Rust or Zig fan? Then make a Rust or Zig version of this ideal. Let's go. Give me an email.
No Copyright - Public Domain - 2023, Gregory Cohen <[email protected]>
DONATION REQUEST: If this free software has helped you and you find
it valuable, please consider making a donation to support the ongoing
development and maintenance of this project. Your contribution helps
ensure the availability of this library to the community and encourages
further improvements.
Donations can be made at:
https://www.paypal.com/paypalme/cfoundationallib
Note: The best way to contact me is through email, not social media. Please feel very free to email me if you want to express feedback, suggest an improvement, desire to collaborate on this free and open source project, want to support me, or want to create something great. Complacency and obstructionism and whining are not tolerated. I desire to make this library the best theoretically possible, so please, let us connect.
Mirror Links
Blog - https://foundationallib.wordpress.com/
Github - https://github.com/gregoryc/foundationallib
Ruby Gem Mirror - https://rubygems.org/gems/foundational_lib
Ruby Gem Mirror - https://rubygems.org/gems/foundational_lib2
Library Instagram - https://www.instagram.com/foundationallib
Google Drive Mirrors
ZIP - https://drive.google.com/file/d/1bK2njCRsH4waTm4LP16sloPQawk7JIR5/view?usp=sharing
TAR.GZ - https://drive.google.com/file/d/1RCA1yy9R3cEqI_X9Lv0fxqh-zgNCK005/view?usp=sharing
TAR.BZ2 - https://drive.google.com/file/d/1ljdlI_fEnMS_X5WmuhI1qavhgseWlD5j/view?usp=sharing
This code is in the public domain, fully.
You can do whatever you want with it.
See docs.html for API reference.