Hear me out Any Forums
C with namespaces
>We can get rid of cock_function autism
>Is not OOP
>No generics, no bullshit
>Better code organization
Why don't we have C with namespaces Any Forums
Hear me out Any Forums
C with namespaces
>We can get rid of cock_function autism
>Is not OOP
>No generics, no bullshit
>Better code organization
Why don't we have C with namespaces Any Forums
Other urls found in this thread:
Try C++
Not a nigger
what's the difference between lib_function and lib::function?
C have OOP and thats where this is a bait. Learn the language firsf then talk, plus namespaces is in c.
why not just use C++ with C syntax? you'll have namespaces and have the C experience
you don't have to write lib::function every time. It's like the difference between absolute paths and relative paths.
Structs already have their own namespace, and every function that's not having its declaration put in a header file for linking with other compilation units can be declared static. For libraries I find vk_blah much nicer than vk::blah
since C++ is "C with classes" can we name this C+?
those who are not explicitly OOP languages, are doomed to emulate it. OpenGL uses objects to keep track of things in it's api. metal and directx are c++. KDE/Qt is OOP c++. even Gnome and all related programs that use it's libraries are OOP because of GObject. keep seething c fags
C has make OOP because it wasn't designed like that, and OOP is a disgrace to the human race, fucking void* shit
i did not understand a single word that you said esl user
The thing is that they don't understand the problem the hammer is trying to solve.
Show them you trying to push the nail with only fingers first then use the hammer
Something called name mangling which is as retarded as it sounds and its implementation is also on spectrum.
PROTIP: no same person touches anything which has :: written in it.
>Namespaces, but use a fucking dot
>Simply templates (not generics)
>Compile-time if's
That is all I need.
To be honest though. Nim actually does a lot of great things and compiles to C. So maybe try that.
You want to look for hare and hope it wont die a toy language harelang.org
featurewise is C for 2000, there's no language that is a better C substitute
> simple
> fast (?)
> namespaces and modules
> better error handling with tagged union and match, and ? pperator
> slice support
> testing support inside the language
It's a little too much verbose, but not actually bearable
use errors;
use fmt;
use fs;
use fs::{flags};
use io;
use os;
use strings;
export fn main() void = {
const path = os::args[1];
match (writehello(path)) {
case void =>
yield;
case let err: fs::error =>
fmt::fatal("Error writing {}: {}", path, fs::strerror(err));
case let err: io::error =>
fmt::fatal("Error writing {}: {}", path, io::strerror(err));
};
};
fn writehello(path: str) (fs::error | io::error | void) = {
const oflags = flags::WRONLY | flags::TRUNC;
const file = os::create(path, 0o644, oflags)?;
defer io::close(file);
const buf = strings::toutf8("Hello world!\n");
io::write(file, buf)?;
};
>but not actually bearable
*but not actually unbearable
D -betterC
Just don't use classes then
t. professional fizzbuzzer.
>*but not actually unbearable
*but actually bearable
It exists, it's called Zig.
you want Zig, not Nim.
No, I want Nim, because Zig is a piece of shit which depends on LLVM while Nim uses C as a portable platform.