Live data from Hacker News

A Universal I/O Abstraction for C++ (2020)

cor3ntin.github.io

41–50 of 88 posts

Re: A Universal I/O Abstraction for C++ (2020)

#41
post #10
post #9

Earlier quoted context omitted.

Nah, that place I leave for C, the number one reason we keep having memory corruption issues during the last 50 years of computer history, and having taited every language that has some level of compatibility with it.

This kind of comments are forgetting all the good that C did bring in the last 50 years of computer history. Too bad those shitty engineers in the 70s didn't think of Rust...

Like the Go designers ignored generics, they ignored the safer systems programming languages developed as ALGOL and PL/I variants during the 60s.

https://www.bell-labs.com/usr/dmr/www/chist.html

Re: A Universal I/O Abstraction for C++ (2020)

#42
post #10

Earlier quoted context omitted.

This kind of comments are forgetting all the good that C did bring in the last 50 years of computer history. Too bad those shitty engineers in the 70s didn't think of Rust...

They thought many ideas of it (see Lisp, Smalltalk) but computers where not powerful enough for complex compilers. Instead, the burden of ensuring correctness had to be left as the cognitive burden for the developer for decades to come.

See Burroughs B5500, created in 1961 with ESPOL/NEWP, 10 years before C was even an idea.

Re: A Universal I/O Abstraction for C++ (2020)

#43
post #21

Earlier quoted context omitted.

No one can seriously argue that C's language design was inherently advantageous over, say, Pascal. If Lisp, ML, Simula, Algol, or Ada received the amount of optimization and porting investment that C did, history would be very different. C succeeded because a.) Unix, and b.) there were a zillion platforms with a zillion different compilers that could process something like C. They all did weird things and you couldn'…

That portability to a zillion platforms was part of the language design, though. 'Portable assembler' and all that.

All high level languages are portable, and many already were before C came to be.

Just marketing speak.

Re: A Universal I/O Abstraction for C++ (2020)

#44
post #27
post #9

Earlier quoted context omitted.

Nah, that place I leave for C, the number one reason we keep having memory corruption issues during the last 50 years of computer history, and having taited every language that has some level of compatibility with it.

Have been programming in C (and then C++), like, forever. Hardly any memory corruption issues. Yes, you have to be a little more disciplined and pay attention to things. Being distracted certainly does not help.

If powerhouses like ARM, Apple, Google, Microsoft and even Linux kernel admit not being able to, now even pushing for hardware memory tagging as the only remaining way to fix C and its influence on C++/Objective-C, you are indeed a top expert.

Re: A Universal I/O Abstraction for C++ (2020)

#46
post #29
post #12

Earlier quoted context omitted.

> Too bad those shitty engineers in the 70s didn't think of Rust... True, Rust didn't exist back then, and yes, some (few!) features in Rust weren't invented and worked out then, like the ownership model. OTOH the corollary to that statement isn't that C was some shining beacon of good design taking advantage of the then state of the art programming language knowledge. See e.g. https://pastebin.com/UAQaWuWG

Actually, computer science in general and the theory of programming languages in particular were already very advanced back in the 60s. It’s just people thought little of languages that would have needed gigabytes of memory (or days of run time) for the compiler to do its job.

That's exactly the point the pamphlet I linked to makes. C was far from the state of the art when it was invented, it's only major redeeming quality was that it worked on the shit low-end computers that were available to the inventors back then.

The tragedy wasn't that C was invented, it was fit for purpose then. The tragedy was that as HW evolved beyond the PDP-11 level, unix programming remained stuck at C.

Re: A Universal I/O Abstraction for C++ (2020)

#47
post #23
post #19

Earlier quoted context omitted.

The late pioneer in compiler optimization--Frances Allen--agrees. 2006: "..but something else had happened--and that was back in 1973--[something] which I was very, very unhappy about--and that was the advent of C! It derailed, as far as I was concerned, the advances that I foresaw in compilers. One cannot let the user play with the addresses, and use procedures, and play with pointers--which is pointing to the data-…

> One cannot let the user play with the addresses, and use procedures, and play with pointers--which is pointing to the data--and be able to understand how one can transform the program to run more optimally." Well 50 years on we still haven't seen any of these "sufficiently smart compilers", at best they can outsmart C compilers in a few cases with things like generics, so the idea that higher level languages would…

Funny, I remember when there were books like The Zen of Assembly programming, because C compilers just generated junk code.

I also happen to remember languages like Fortran and Ada do exist.

Re: A Universal I/O Abstraction for C++ (2020)

#48
post #14
post #12

Earlier quoted context omitted.

> Too bad those shitty engineers in the 70s didn't think of Rust... True, Rust didn't exist back then, and yes, some (few!) features in Rust weren't invented and worked out then, like the ownership model. OTOH the corollary to that statement isn't that C was some shining beacon of good design taking advantage of the then state of the art programming language knowledge. See e.g. https://pastebin.com/UAQaWuWG

That pastebin leaves out the fact that C's spartan approach and extreme simplicity allowed C to become the most popular programming language in the world already in the time of K&R, a book still renowned for it's clarity and low mental baggage required to onboard onto a programming language. The pastebin also left out that Bjarne Stroustrup developed C with classes, and the C, as a backward compatible superset of C t…

> However, it feels a kin to rewriting history to depict C as a subpar language that was poorly designed and had little to no redeeming qualities, when facts speak for themselves.

It was subpar compared to the state of the art then. It's redeeming quality was that it worked on the PDP-11, whereas the better languages required mainframe level resources. The tragedy isn't that C was invented, it fitted it's niche back then. The tragedy is that as HW evolved the world remained stuck with C rather than switching to better languages.

Re: A Universal I/O Abstraction for C++ (2020)

#49
post #28
post #22

Earlier quoted context omitted.

C was not extremely simple. Lisp was extremely simple.

Problem was, real world programming in Lisp was not simple.

Just like real world programming in C is hardly memory corruption free, and only around 10% of survey answers keep asserting to use any kind of memory assurance tooling.

Re: A Universal I/O Abstraction for C++ (2020)

#50

In the end the overall design looks like a semi-reified asynchronous dataflow programming API based on coroutines. I think that it would be useful to consider the existing (very very very large) body of research on dataflow PL and APIs; e.g. check this paper from 1982 which talks about dataflow, coroutines, for handling file operations: - https://scholarship.claremont.edu/cgi/viewcontent.cgi?articl... More recent pap…

Hum, in principle you can do arbitrary compile time transformations to the datagraph before submitting it via metaprogramming. If you really want you could even convert the graph (fully or partially) to a runtime representation. The core of the proposals are not about specific classes or functions other than some default algorithm implementations. Instead they are mostly about defining concepts and protocols so that…

> Hum, in principle you can do arbitrary compile time transformations to the datagraph before submitting it via metaprogramming.

I would find that to be great, but I don't understand how.

In e.g.

    while(i) {
        co_await sch.schedule(std::chrono::milliseconds(100));
        co_await w.write(--i);
    }
how can you get a meaningful "graph" object out of that, e.g.

[wait 100] -> [write 9] -> [wait 100] -> [write 8] -> ...

without actually "running" the code first to go through the co_await, which are the only way to acquire the information of what is to run ?

for instance, let's say that I want to compute "statically" (not in the "at compile time" sense but in the "after knowing the inputs to the program and before actually running the scheduler") how many [write] calls there are to schedule (assuming no cycles / infinite loops).

Post reply on HN