15,497 karma · joined Jun 8, 2017 (9y ago) · 4,691 submissions
comment 1d ago · link · parent
comment 1d ago · link · parent
C is not memory safe and will never be
On the contrary, C is far more easily made memory safe than C++, because it's a much simpler language with almost entirely explicit control flow. You have fil-c, CMBC, TIS that all work today, not to mention the profusion of annotation-based tools that have existed for years. Galois is working on C2Rust and other tools, though they're not fully safe/general yet.Your options for C++ essentially amount to sanitizers, less-accurate static analysis work, and paying experts like TIS for manual verification. C++ is also choosing to actively make the problem worse when it deliberately refrains from adopting C's verifiability improvements, like prohibiting time-traveling UB. It's not like this is solely a problem of legacy standards either. std::span could have been safe (as gsl::span is), but the decision was made to deliberately sacrifice safety for other considerations.
comment 2d ago · link · parent
comment 5d ago · link · parent
Optimizing deeply enough will eventually make any abstraction leaky though, so you'll never fully escape mechanical sympathy.
comment 6d ago · link · parent
comment 1w ago · link · parent
I'm still surprised there aren't more implementations out there, because it's a very useful class in application programming. For example, gameplay tags in unreal engine are queries in this class [0], and Intel ships a library using them for binary message parsing. It can also be done almost completely in SIMD, which is the route my shitty library takes. If you add recursion on top, you get queries that can express regular languages / monadic datalog.
My library quickly bottlenecked on memory bandwidth though. It doesn't seem like you're ordering joins by selectivity or a bitmap index to avoid reading unnecessary memory, so is this a direction you plan to explore more in the future?
[0] https://dev.epicgames.com/documentation/unreal-engine/using-...
comment 1w ago · link · parent
But yeah, none of these papers discuss interval arithmetic and frankly I've only rarely met anyone using it. Kahan has a blog post somewhere about how unums encounter most of the same issues with monsters, and it came up during the Kahan/gustafson debate iirc.
comment 1w ago · link · parent
Regarding delay, area, and power, under the same precision the posit arithmetic units are not competitive against their floating-point counterparts.
That paper was followed by a paper [1] published this year finally showing a posit variant implementation somewhat competitive with a mediocre float implementation, hurray. In order to achieve that, it had to give up most of the properties that Gustafson liked about posits and it only maintains a better precision than floats up to 2^10, at the cost of absolute relative precision.We even have systems that improve upon posits at the things they're good for, like takums [2]. And just for fun, a couple of papers comparing floats and posits:
On the other hand, 32-bit posit are not exhibiting spectacular improvements in terms of efficiency over FP32. While they achieve the same or higher accuracy and can speedup the execution when the program has multiplications and divisions, they need around 30% more FPGA resources and use 6% more power compared to FP32. [3]
The results confirm posit arithmetic’s strong performance at low precision, with takum following closely behind. Posits show stability issues at higher precisions, while OFP8 formats are unsuitable and bfloat16 underperforms compared to float16 and takum. [4]
[0] https://dl.acm.org/doi/pdf/10.1145/3772284[1] https://arxiv.org/pdf/2603.01615
[2] https://arxiv.org/pdf/2404.18603
comment 1w ago · link · parent
They get a few things right like eliminating NaNs, but the reality is just so underwhelming compared to Gustafson's grandiose claims.
comment 1w ago · link · parent
I find the inefficiencies of the old system more manageable.
comment 1w ago · link · parent
comment 1w ago · link · parent
comment 1w ago · link · parent
Unification is a bit different, but not that important here. It's more important to note that a datalog program will compute the same results in prolog and thus, my previous statement that datalog is essentially prolog without function symbols.
comment 1w ago · link · parent
comment 1w ago · link · parent
comment 1w ago · link · parent
Who's the customer that wants an exotic architecture on an old process node running a custom programming language half a decade from now?
comment 2w ago · link · parent
comment 2w ago · link · parent
Moreover, the months I've used anthropic/OAI exclusively my API token costs are in the hundreds (or sometimes thousands). With DS flash as the first agent I reach for, I rarely exceed $40/mo.