3,924 karma · joined Sep 20, 2017 (9y ago) · 757 submissions
https://www.deusinmachina.net/
comment 5mo ago · link · parent
1. https://youtu.be/U46fJ2bJ-co?t=2780
and Ryan asked Bjarne about memory safety. Bjarne brushes it off and says that in almost all cases where we see memory safety issues, they are either
1. Being written in C style C++ and not using "Modern C++" 2. Being written in C
He then goes on to say say that Modern C++ and where it is necessary, hardened libraries, go a long way to making these problems non issues. I'm not a C++ guy, so how much of this is true? What do the C++ developers think about this?
I've postd the whole message if people would like to read. It's about 46minutes into the video
Ryan: One thing that I think C++ is uh infamous for is kind of like memory safety issues or kind of foot guns that exist there.
Bjarne: I'm so tired of that. Um I haven't had those problems for years. Um, and somebody did a a study of the obvious problems with buffer overflows and um people hacking in using that kind of stuff and uh almost all of the uh these cases when people writing C style code or in C and uh Herb Server has a a talk with with actual numbers and they they are quite significant. It's it's sort of that kind of problems more than 90% are for people that don't write modern C++. They they use raw pointers to pass things around without um the number of elements. No fat pointers, no spans. um you you have them in C++. You can use them. You can use uh vectors. We have hardened libraries. Everybody has hardened libraries that that does the runtime checking. Uh Apple has it. Google has it. Microsoft has it. It's just not standard till now. C++ 26 has a hardened option that are standard. uh and the work I'm doing on profiles will give you a way of guaranteeing that you don't do the stupid things. Um so anyway, uh fundamentally theoretically the problem was solved many years ago and people just do what they've always done and get the problems they've always had. And uh that makes me sad and uh it's one of the things that makes me work on uh coding guidelines and on enforced profiles and on education. I mean education is one way to solve the problem. Is there a way to get the compiler to just prevent people from doing all those risky things? And is that enabled by default in modern C++ today? No, but it should be. I'm proposing that for C++ 29. Uh the simpler versions of that should have been in in in uh C++ 26, but there are still a lot of people even in the C++ standards committee that are very devoted to uh their old code and their old ways of doing things. Um there's people who says you should only standardize what is common in industry. But when the bugs are common in industry, you should do something else. The standards committee is a a topic I
comment 6mo ago · link · parent
It's running slow so I profile it and I see my math function in pure Dart (or whatever language you are writing in) is the hot spot, and pressures the garbage collector too much, so I rewrite the function in a lower level language that doesn't have as much overhead, to speed things up. Then I just call it from the higher level language through the FFI.
The benefit of Zig is the syntax is simple, and the build steps are simple, so it doesn't slow down app development too much
comment 6mo ago · link · parent
So unless you work in another domain where you do a lot of low level programming, then every time you drop down you will be out of practice. This favors using a simpler low level language, with low friction for integration. Rust and C++ don't handle being used infrequently, but C with it's simpler standard library and syntax fits this nicely. But it doesn't have things you expect for a modern programming language, and it is also has a lot of dangerous footguns that are easy to forget if you are out of practice
In comes Zig. It's low level, comes with it's own toolchain that makes it pleasant to work with, easy to cross compile, has more safety features built in that C, but is not overly complicated. The code tends to be more verbose, but also more straightforward. So it's a perfect language to pair, when you know you won't be able to do everything in a high level language.
For me that's what seals the deal. I'd argue that Odin has a nicer syntax, but there is a reason that tools like cargo-zigbuild^1 exists. The fact projects not related to Zig are willing to ship Zig toolchains to make lives easier is a testament to how seriously Zig takes this.
comment 6mo ago · link · parent
> At some point, execution speed starts to matter more than the elegance of the code.
This sentiment has been with us for a long time, and AI has only made it worse. Many people have experienced the damaging effects that focusing on execution speed have had on our lives, and you would think if AI makes us 10x faster, we could spend half that time actually making programs more performant and secure. But all of the gains always funnel into speed, when we have the golden opportunity to make things better.
Then there are the players that make it. Casey Muratori recently did a video called "It just Happened" where Eric Schmidt gives a commencement speech and washes his hands of the negative things that have happened in it, even though his decisions at Google and the technology he helped create made a lot of that happen. A quote from Casey's Video
> This is a case where someone who had direct decision-making authority during the time period when the very worst most dystopian parts of the technology business model were developed, perfected and entrenched. And he is giving this commencement speech to a group of students who have known nothing but that their whole lives. They're not like me. They didn't know a time before all of this. They didn't experience technology in the 80s or something like this.
One of the most important things in that quote is that there are people who have known nothing but a predatory, privacy invasive technology world. When that is your baseline, new technology that could advance that at 10x speed does not feel great. And now it requires only a couple bad actors and a subscription to make that happen.
At work we are mandated to use AI. That feels bad for a lot of reasons. But one of the worse is having to review AI generated code. I have never liked reviewing other peoples PRs, and now with the speed AI code is created, I could spend the whole day just doing that. So now my job is worse because I have to do more of the part I like the least.
Next, I've been thinking a lot about "the human scale of things". To me that means slowing down, and not consuming things faster than my lizard brain can understand. While I might be able to go 10x faster, unless I'm doing something I've done a million times before, I will not be able to keep that much code in my head. So I quickly lose understandings of projects, and I have to fight hard to rebuild my knowledge.
Lastly, as someone who has "vibecoded" an app, It feels completely impersonal. Yea I had the idea, and yea I had to type the prompts, but producing a whole mountain of code over the course of weeks or months (I've done both) just leaves me feeling empty on the inside. There is still a selfish human component to the programming that I and I suspect others do, and AI takes away from that
I'm not sure what the solution is though. Do we say, if you don't want to take ownership over the bad things that happen then we will down play your part in the good? Do we try to set up organizations that persecute those accountable? Should Eric Schmidt be in jail? Should he be fined? Do we as developers try to use the tools "for good?" I don't know, and I'd love to know what other people have to say on this
comment 6mo ago · link · parent
I’m sure I wouldn’t be the programmer I am without that experience, but I am Not sure I would have willingly put myself through that if LLMs existed at that point
comment 6mo ago · link · parent
This makes Cpp and Rust harder to use then say C, so C becomes the default for me. But C is not without its issues of which we are aware. But Zig feels like it could fill that sweet spot really well, being simple enough that it's easier to pick up after a long break, but still coming with a lot of modern tooling that makes programming easier.
comment 6mo ago · link · parent
> This is a case where someone who had direct decision-making authority during the time period when the very worst most dystopian parts of the technology business model were developed, perfected and entrenched. And he is giving this commencement speech to a group of students who have known nothing but that their whole lives. They're not like me. They didn't know a time before all of this. They didn't experience technology in the 80s or something like this.
I think this is hugely important context. New technologies are not being built in a vacuum. It's not like we haven't seen the negative side effects of these new technologies play out already, and like Casey said, many of the people who are voicing their concerns have only gotten to live through the bad parts.
> It didn't just happen because the tool was let loose on the public and it just happened. People built the bad parts of it. They did that.
There is a JFK quote that I think accurately sums up the issue
> Victory has a hundred fathers and defeat is an orphan.
People just don't want to be associated with bad things. Billionaires don't want to be associated with the negative parts of capitalism, CEOs don't want to be associated with the terrible things their companies do, and businesses that do wrong want to settle out of court, with no public statement of blame.
I'm not sure what the solution is though. Do we say, if you don't want to take ownership over the bad things that happen then we will down play your part in the good? Do we try to set up organizations that persecute those accountable? Should Eric Schmidt be in jail? Should he be fined? Do we as developers try to use the tools "for good?" I don't know, and I'd love to know what other people have to say on this
comment 6mo ago · link · parent
Speaking purely about the cli dart devtool (flutter and debugging) dart compile (More options but the big one is JavaScript transpilation) dart info (outputs diagnostic information about installed dart toolchain)
> which isn't particularly fast
Against other programming languages that are also garbage collected Dart compares favorably, though it's implementations of things typically aims for user accessibility over maximum performance. For example a Dart Isolate is much more heavy weight than a goroutine due to it's higher startup cost and additional memory per worker. The advantage is that it has its own memory, own event loop, and communicates with other isolates only by message passing, so it's much harder to mess up.
But where Dart shines for me is in two instances. The first is as a Python programmer that wants to work in a statically typed, ahead of time compiled language. Dart fits the bill here, and covers a weakness many programming languages have which is user facing GUIs. I would argue nothing comes close to Flutter when it comes to slapping together cross platform GUIS that just work. Dart is also very good on the front and backend (with more emphasis on the frontend) of web development, and can be integrated into an existing project very well through it's ability to compile into JavaScript. Typescript definitely eats Dart's lunch here, and Go more so for the backend, but very few languages can do Webdev in a way that feels natural and due to many design decisions of the past Dart is better than most. So Dart is good for packaged user facing apps.
This also makes it a strong contender as the higher level language to pair with a lower level language. You mentioned Rust, and Dart has a Flutter Rust Bridge^1 which allows you to write normal Rust code that automatically has the glue code generated. The native code interaction story gets even better through Dart's Hooks^2, Which allow you to integrate and compile or download native assets into your Dart projects directly through Darts build interface.
> doesn't have the library ecosystem or vast training data of Rust, Go etc
LLMs are better at handling niche languages than they have ever been. And the fact that Dart is not applied broadly, in the same way Python is, means you don't need a million examples to cover the most common use cases.
1. https://pub.dev/packages/flutter_rust_bridge 2. https://dart.dev/tools/hooks
comment 6mo ago · link · parent
comment 6mo ago · link · parent
What matters more is if it does what you want it to do, and is well maintained.
comment 6mo ago · link · parent
Having never been in this situation, I wonder how difficult it is to bend a garbage collected language to behave like a non garbage collected one
comment 6mo ago · link · parent
comment 7mo ago · link · parent
comment 7mo ago · link · parent
comment 8mo ago · link · parent
In the year 2000, there were just less products and services then there are now. And the products that did exist were generally more durable and repairable than today. And in many cases, products that exist now but didn’t back then have reasonable substitutes (like renting or buying movies, since you don’t have Netflix).
I would even take it one step further and say that the ways you had to interact with those substitutes were healthier and more social than what we have now.
comment 8mo ago · link · parent
1. https://gitlab.com/canvasui/canvasui-engine/-/blame/main/exa...
2. https://gitlab.com/canvasui/canvasui-engine/-/blob/main/exam...
57.
Markiplier discovering the value of On Premise Servers [video](youtube.com ↗)
1 points · by Decabytes · 9mo ago · discuss
comment 9mo ago · link · parent
The GPL’s significance was that it changed the default outcome. At a time when software was overwhelmingly proprietary, it created a mechanism that required improvements to remain available to users and developers downstream.
Gcc was a massive deal for the reasons why compilers are free now today for example