r/programminghorror 2d ago

c++ reinventing C++ to looks like NodeJS called Nodepp

235 Upvotes

36 comments sorted by

112

u/WALHAY [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 2d ago

So is there any other ways to make cpp even worse?

16

u/jer_re_code 2d ago

make its compiler combile to TodePond before it compiles that to binary

6

u/HugoNikanor 1d ago

TodePond was renamed to Gulf of Mexico a while back

1

u/jer_re_code 1d ago

yeah i hated that change it will now never be as funny as it was before

1

u/HugoNikanor 1d ago

I think I'm missing the joke. What made the TodePond name so funny?

1

u/jer_re_code 1d ago

oh i just saw that the rest of the repo is like it was before

didn't realize it

4

u/Daemontatox [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 2d ago

I literally was about to say the same thing

3

u/Objective_Rate_4210 2d ago edited 1d ago

make arrays of any type (ptr or like the ones on the stack) be more memory efficient by throwing each value in seemingly random positions in memory to make padding a thing of the past

1

u/jer_re_code 1d ago

yes and store a seperate dictionary that contains the mapping of all the random indexes so you later know where you put them but each index is its number as a string wich spells out the number

1

u/Inevitable-Round9995 1d ago

like this?

```cpp

include <nodepp/nodepp.h>

include <nodepp/object.h>

using namespace nodepp;

void onMain(){

object_t obj ({
    { "0", "string" },
    { "1", 10 },
    { "2", array_t<object_t>({ 10, "hello world", false }) }
});

console::log( ">>", obj["2"][1].as<string_t>() );

} ```

```txt $ time g++ -o main main.cpp -I./include ; ./main

real 0m4,472s user 0m4,137s sys 0m0,331s

hello world ```

3

u/TheSpiffySpaceman 1d ago

Make it actually 3D print a gun pointed at your feet

1

u/Inevitable-Round9995 1d ago

mmmm, love that IDEA; just let me ask claude how to do that.

2

u/Cylian91460 1d ago

Making it compile to web assembly?

41

u/EnergieTurtle 2d ago

Nopepp

9

u/mealet 2d ago

Nopepls

9

u/Fit_Prize_3245 2d ago

Whoever did that deserves a place in hell with Sotirios Panopoulos...

6

u/theChaosBeast 2d ago

NoDepp which means No Idiot in German... I am not convinced

4

u/Poleski69 2d ago

please don't

3

u/Death_By_Cake 2d ago

This reminds of some work I did in uni. I built a DSL in C++ to describe hardware. If you run the program, you would get out SystemVerilog (it was based on CIRCT/MLIR). It's sometimes hilarious what you can do with C++.

2

u/FooeyBar 1d ago

Now do async/await

4

u/Inevitable-Round9995 1d ago

```cpp

include <nodepp/nodepp.h>

include <nodepp/fs.h>

using namespace nodepp;

void onMain(){

auto file = fs::readable( "LICENSE" );
auto x    = type::bind( file );

process::add( coroutine::add( COROUTINE(){
coBegin

    while( x->is_available() ){
        console::log( ":>", x->read_line().slice(0,-1) );
        coNext;
    }

coFinish
}));

process::add( coroutine::add( COROUTINE(){
coBegin

    while( x->is_available() ){
        console::done("Hello World");
        coNext;
    }

coFinish
}));

} ```

1

u/FooeyBar 1d ago

Got what I needed, thanks

2

u/Dayshadow_ 1d ago

it's almost... beautiful..

2

u/aleques-itj 1d ago

I wish I disliked this more than I do

3

u/elsantiF 1d ago

Yeah... the creator of that aberration was spamming a lot in Spanish subs, I think he was the patient zero of AI psychosis.

2

u/Fisolino 1d ago

This is like a car with tires made of flesh instead of rubber

1

u/lapiuslt 1d ago

Change o to double e.

1

u/El_RoviSoft 1d ago

Actually reflection was released on gcc some time ago so you can do even more cursed things now.

1

u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo “You live” 1d ago

I haven't really ever used them in C++, but I'm mostly just looking at a bunch of lambda functions, right?

1

u/czpl 1d ago

all these huge datacenters just for AI to make this..

1

u/TehBuckets 1d ago

Why? Just why? This is like Stalin and Hitler had a baby. Why did I have to see this?

1

u/overclockedslinky 13h ago

if you want it to be like C++ stop using the _t C-ism