7 ms·
Fil-Qt: A Qt Base build with Fil-C experience
- rubymamis 10mo agoThis is awesome. Would love to see if it catches some of the Qt bugs I found but haven't been resolved yet[1]. [1] https://qt-project.atlassian.net/browse/QTBUG-122658 https://qt-project.atlassian.net/browse/QTBUG-122658
- cristianadam 10mo agoI only tried to get Qt Base up and running. But Qt Declarative will be next, after Qt Base.
- rubymamis 10mo agoThat would be awesome (:
- yjftsjthsd-h 10mo agoDepends in which sense you want it to "catch" the bugs. As this readme notes/quotes, > All memory safety errors are caught as Fil-C panics. If your problem is a memory-based bug causing a crash, I think this would just... catch the memory-based bug and crash. Like, it'd crash more reliably. On the other hand, if you want to find and debug the problem, that might be a good thing.
- dafelst 10mo agoSure, if the memory error is an immediately crashing one like a null per deref, but if is (for example) a memory corruption (e.g. an out of bounds write or a write-after-free) then this would be super helpful in exposing where those are happening at the source.
- wat10000 10mo agoThat’s what “catch” means here. As in, catch it in the act. Tools that make bugs crash more reliably and closer to the source of the problem are extremely valuable.
- jacquesm 10mo agoHalf a second's worth is a lifetime of debugging at today's clock rates so the closer to the fault the crash happens the sooner you can fix it.
- jcelerier 10mo agoeh, I daily-drive a -fsanitize=address -fsanitize=undefined build of Qt and actual memory bugs are almost never a thing - I think the only time I had some were in tooling executables such as qmllint, but not in the framework itself. Most of the bugs by large are more "behaviour" bugs.
- adrianN 10mo agoI’m impressed that QT runs clean enough under ubsan for daily use.
- jcelerier 10mo agoubsan definitely has some warnings due to a few "technically UB" patterns used as optimizations in Qt as they are known-working on every target platform under the sun, but yeah, no crashes :) I'm only using this configuration for the software I develop though (+ libc++ debug mode) as it's painfully slow, but it exercises the Qt codebase in depth.
- fransje26 10mo agoGood to know! Which version of Qt are you using?
- jcelerier 10mo agoI regularly update, right now 6.10.1 + a few patches
- rubymamis 10mo agoHere is another bug that led to crush thatt I reported while developing my block editor: https://qt-project.atlassian.net/browse/QTBUG-124572 https://qt-project.atlassian.net/browse/QTBUG-124572
- SkiFire13 10mo agoAFAIK Fil-C does not catch all memory safety bugs, for example some use-after-free are just not bugs but work as intended (you still access the original data/allocation). This means that it's not a sanitizer and code that runs fine on Fil-C may show UB when run normally.
- aw1621107 10mo ago> for example some use-after-free are just not bugs but work as intended (you still access the original data/allocation) That doesn't sound right? For example, from the Fil-C GC docs [0]: > If you call `free`, the runtime will flag the object as free and all subsequent accesses to the object will trap. Additionally, FUGC will not scan outgoing references from the object (since they cannot be accessed anymore). [0]: https://fil-c.org/fugc https://fil-c.org/fugc
- jacquesm 10mo agoAny use after free is a bug. There is no way you can use that area without ownership.
- deleted 10mo ago[deleted]
- rowanG077 10mo agoI thought the point of Fil-C was to be a drop in safe replacement of C. This project existing implies it isn't. What's going on?
- meibo 10mo agoIt's not done yet.
- g-mork 10mo agoSure fooled me. I follow his Twitter account and there isn't much he hasn't got building with it at this point. UX comes later. Amazing it's the random work of one person
- vlovich123 10mo agoI don’t think so much is fil-c itself, but from the looks of the diff it’s a new platform essentially. That can require porting existing software generally which you can read from the posted diff
- jitl 10mo agoThe author wrote WebKit’s allocator and worked on JavaScriptCore for over a decade. I really enjoyed his posts on the WebKit blog over the years like this one on the concurrent garbage collector (2017) https://webkit.org/blog/7122/introducing-riptide-webkits-retreating-wavefront-concurrent-garbage-collector/ https://webkit.org/blog/7122/introducing-riptide-webkits-ret...
- wat10000 10mo agoMost large C code bases aren’t really written in C. They’re written in an almost-C that includes certain extensions and undefined behavior. In this case, it uses inline assembly (an extension) and manipulating pointers as integers (undefined behavior).
- throwaway17_17 10mo ago
- dayli 10mo agoInteresting to see Fil‑C used with a large framework like Qt. The fact that it compiles with minimal changes says a lot about the compatibility layer and the InvisiCaps approach.
- wewewedxfgdf 10mo agoI believe much more in making C/C++ safer than using something as complex as Rust. SafER is better than deeply complex and unable to be understood except by Rust experts.
- timschmidt 10mo agoIn my experience (20+ years with C/C++, and about 4 years with Rust), Rust is significantly less complex than C++, while being similarly capable. The extra syntax that throws off so many C++ devs is almost exclusively about data types and lifetimes, which I find very useful for understanding my own code and others', and which I wish I had in C++.
- wewewedxfgdf 10mo agoThe real answer should have been a new language that has memory safety without all the extra conceptual changes and orthogonal subsystems that Rust brings. The core value of safety did not need the reinvention of everything else with the accompanying complexity and cognitive load. For example Zig which instead of introducing a new metaprogramkming language, it uses...... Zig - imagine using the same language instead of inventing a new additional language with all the accompanying complexity and cognitive load and problems. Rust is for those who revel in complexity. And traits - traits and extra complexity not needed for safety. And result and option and move by dedfault - none of these things were needed but they all add up to more complexity and unfamiliarity and cognitive load. And when you add it all together and intertwine it you end up with something so unfamiliar that it no longer looks like "ordinary programming" it looks like something from the Cambrian period.
- LexiMax 10mo agoAs a C++ developer, my experience with learning both Rust and Zig is that they're both good languages, and any reasonably skilled C++ developer could learn either language if they put their mind to it. If you forced me to pick between Zig and Rust for a long-running project though, I'd pick Rust 10/10 times for the simple fact that it has been stable for more than a decade and already has momentum and funding behind it. Zig is a cool language - one that I've actually written more of than Rust - but it hasn't hit 1.0 yet and still has significant churn in both the language and standard library.
- VadimPR 10mo agoVery cool, thanks! I will try this with Mudlet.
- jacquesm 10mo agoIt would be nice to have one thread about Fil-C without it becoming about Rust.