4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions
comment 5y ago · link · parent
I'm also consistently impressed by the quality of comments at Ars Technica whenever I visit the site.
This convinced me to subscribe. We need more journalism of comparable quality.
comment 5y ago · link · parent
Last week I debugged an issue in a big C++ codebase, where we were getting memory corruption. Source of the issue? Compiler, linker and build system being separate things and only compiler understanding types (also, lack of modules, which is another symptom of build system being separate from the language). Namely, conditional compilation was involved, someone made a struct which had a field in it based on whether a preprocessor constant was defined or not (passed with -D to the compiler on the command line). Turned out some files were compiled with the define and some not, so some files were compiled based on the assumption that this struct is N bytes long, and some with the assumption that this struct is N+M bytes long. But the linker doesn't have any information available to it to detect this error.
And then there is the issue that to write a C++ program these days, it doesn't suffice that you just know C++. Languages you need to know:
- C++
- language of your build system, which is always handicapped, yet Turing-complete
- Python
- if something goes wrong, and you need to debug something: Make with its custom shell-language
- shell
It's a tower of babel. For all the whining on users of other languages for using libraries, C++ users have a lot of complexity hidden in their build systems.
In Zig and the not-yet-released Jai, you only need to know the language you write your program in. The "if" in your language of choice is perfectly suitable for expressing conditional compilation. Structs in your language of choice are perfectly suitable for expressing declarative configuration.
comment 5y ago · link · parent
comment 5y ago · link · parent
Floating point implementations can vary not only between languages, but also between different CPUs, if the language relies on the hardware implementation (which is the smart thing to do in most cases).
As a side note: Python's implementation of FP isn't standard-compliant. E.g. when you divide by 5.0 by 0.0, the standard says you should get a +inf. In Python you get an exception.
comment 5y ago · link · parent
[1]: <https://github.com/dwmkerr/hacker-laws#kernighans-law>
comment 5y ago · link · parent
"It's possible" is a rather low bar. It's also "possible" in C. Is it easy though? I wouldn't say so. Not if you push lambdas over queues to be invoked in another thread, or in the same thread, but later. Not if you take references to elements of std::vector. Not if you use std::vector<bool>. Not if you use operator[] on std::vector/std::array without tweaking some macros, because C++ committee in 2021 is still not convinced that bounds-checking is a reasonable default.
It's very easy on the other hand to write perfectly idiomatic "modern C++" which is memory-unsafe. Well... Easy if you figure out which one, among a dozen, is the right way™ to initialize a variable. (And then go and read code which initializes std::vector in all those different ways and try to guess which one does what.)
comment 5y ago · link · parent
So GP may not be "an unprofitable long tail". GP may in fact be "a profitable typical long tail for whom Google Search is frustratingly unhelpful".
comment 5y ago · link · parent
2. Searching for open3A in duckduckgo brings me to a page that spits out PHP errors and doesn't give me anything.
3. The only way that I now know where the zip file is, is because another commenter linked to it.
4. We've seen companies disguise something as open-source, when it wasn't.
5. Open source is commonly hard-to-sell.
So no, it wasn't 10 seconds to verify and the author didn't make it particularly easy to do so. My doubts are completely natural, given past news in "open-source". Are you commenting in bad faith?
comment 5y ago · link · parent
From "The Open Source Definition"[1]:
> The license shall not restrict any party from selling or giving away the software as a component of an aggregate software distribution containing programs from several different sources. The license shall not require a royalty or other fee for such sale.
[1]: <https://opensource.org/osd>
UPDATE: it seems it is licensed under AGPLv3. So it is open source. Interesting.
comment 5y ago · link · parent
comment 5y ago · link · parent
Not really, since approximations, no matter how accurate, don't preserve algebraic properties. You only get to know what it's bigger/smaller than.
comment 5y ago · link · parent
> In mathematics and computer science, an algorithm (/ˈælɡərɪðəm/ (About this soundlisten)) is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of problems or to perform a computation.
Newton's method is finite too. You perform finitely many iterations. It doesn't calculate roots. It calculates their approximations.
comment 5y ago · link · parent
Thinking of multiplication as repeated addition also won't explain anything about it. It's a separate operation. Deal with it. For similar reasons, you can't calculate x-th power of a number, when x is irrational, by decomposing it into exponentiation and roots.
This metaphor is just training wheels. At some point you should lose it.
Together with the notion that "multiplication is repeated addition" comes the notion that numbers are quantities. Only some of them are, and this isn't really what makes them numbers. Now what exactly gets repeated, when you don't have quantities?
comment 5y ago · link · parent
"Dynamic vs lexical scope" doesn't have anything to do with "Lisp-1 vs Lisp-2". "Lisp-1 vs Lisp-2" is about whether function values are distinguishable from "defun"-defined functions. "Dynamic vs lexical scope" is about whether variable name-resolution is done based on the lexical scope stack, or the call stack.
You can enable lexical scoping in Elisp files by starting them with:
;; -*- mode: Emacs-Lisp; lexical-binding: t; -*-
That's how my ~/.emacs.d/init.el starts.comment 5y ago · link · parent
Is this what Twitter is doing? Is this why Ctrl+F almost never works there?
comment 5y ago · link · parent
Modula inspired ML in this regard: <https://dl.acm.org/doi/10.1145/773473.178245>
ML modules alone don't provide separate compilation.
comment 5y ago · link · parent
> I’ve believed in it much so I joined sourceforge joined a team, also started a project myself even.
> Their founders built an MVP and took money from VCs and then had to responsibly return their money 10x. They eventually all cashed out and now driving luxury sports cars.
What a ramble.