People can be very rust-centric, but compilation of Rust (or Crystal) can take forever. The fast compilation of this "language" makes running scripts be like a scripting language, like Perl.
Will it be hard for me to find people who want to go in this direction?
I hope not.
This could handle all of your problems, and if you change your mindset a little bit to be willing to use this and to contribute to this project, all of your major programming difficulties might be solved. (And lets be honest, performance ALWAYS matters. Running a script in 5 hours vs 15 hours DOES matter, maybe not to your employer, but to you, it should.)
The simplest solution is a preprocessor. The original founders of C made one, probably because they needed it. But adding another lightweight one is simple. C++ has bloat. Compilation time can be slow.
I realize that this is radical, but if people could work with me on this, this could solve all your problems, no really, it could solve all your problems. And if it can't solve all your problems yet, then modify it to
C is a fantastic language. C compiles insanely fast, is the fastest language there is, is very clear, is native to all systems, and is useful for all purposes.
Some people, e.g., Bjarne Stroustrup, consider that C is `not good enough`, and make languages like C++ or D (or thousands of others)
This is not necessary.
There is no reason to use Python instead of C for `simple scripting tasks`
Some functions can be used as methods
Makes for an excellent `scripting language` (which is really just native C without things making it slow)
1 String Interpolation "String interplation like this #{foo} " Calls the join() function (talked about below to join strings, delim is a static global in each module called `sep`. Make sure you free() the string after. The string is stored in a static global variable called `last`.
So you could do puts(...); free(last);
2 ew i.ew "Foo", a.ew "bar" | char ends with another char?
3 sw i.sw "Foo", a.sw "bar" | char* starts with another char*?
4 == Comparison of strs, "foo" == "bar"
5 strip Returns pointer to string that was stripped, in place
6 chomp void function, chomps end of string of spaces, i.chomp or chomp(i), in place
7 gsub Just like ruby, there is a gsub function.
The preprocessor detects if you use and adds -lpcre2-8 to the link flags if you use it. Use $" for substitutions in argument 3 gsub(a, b, c)
8 join Joins an array of strings, to split(), use C's strtok (very fast)
9 Lightweight regexes are added, almost 15 times as fast as C's built in regex. They are very simple, they only have bracket expressions, like [a-z].
To use it, you need to pass a buffer of the size of the expansion of the regex. Foo[a-fA-F] would be Foo[abcdefABCDEF]. That would be stored in a buffer.
From testing, 15x times faster than C's regex POST COMPILATION, if compilation keeps happening, it might be hundreds of times faster.
Uses static inline functions, NO HEAP MEMORY unless you malloc before().
10 print Like old python print "Hello"(fputs);
11 print_int prints a number and returns the
number, can be chained
12 each_line, Perlish, different names, by_line(s) or each_line(s), iterate over all lines, free after
13 NOTE You can use open_memstream() on UNIX to easily concatenate strings.
asprintf() is another useful function which is UNIX-centric. open_memstream() could be an alternative to std::string.
It works very well with each_line or by_lines (see above)
These features seem simple, but they can make C programming much, MUCH easier
Will it be hard for me to find people who want to go in this direction?
I hope not.
This could handle all of your problems, and if you change your mindset a little bit to be willing to use this and to contribute to this project, all of your major programming difficulties might be solved. (And lets be honest, performance ALWAYS matters. Running a script in 5 hours vs 15 hours DOES matter, maybe not to your employer, but to you, it should.)
Thank you.