News for hackers. Stuff that matters.
Re:You can't make C++ not ugly, but you can't not try (2010) by TheOtherHobbes on Wednesday February 26, 2020 @08:31PM (#22429496)
Market share, maybe.

Mindshare - Lisp has its zealots. C++ is tolerated rather than adored, because it's more of a Katamari Damacy of stray CS than a language with a coherent focus.

How many other languages have a Turing complete sublanguage built into them just to handle templating?

Re:You can't make C++ not ugly, but you can't not try (2010) by nineteen999 on Wednesday February 26, 2020 @08:44PM (#22429561)
> How many other languages have a Turing complete sublanguage built into them just to handle templating?

On the bright side, C++ doesn't have obscure keywords like "cdr" and "car" that refer to specific hardware elements of an obsolete computer built in 1954.

Re:You can't make C++ not ugly, but you can't not try (2010) by praptak on Thursday February 27, 2020 @04:39AM (#22431937)
Car and cdr are a shallow critique of Lisp, the equivalent of "omg, significant whitespace" critique of Python.
Re:You can't make C++ not ugly, but you can't not try (2010) by kazinator on Friday February 28, 2020 @02:22AM (#22441116)
Significant whitespace is more of an issue than what two functions should be called.

Significant whitespace means that we can't reliably use a traditional whitespace-insensitive diff to to compare changes in Python code that seriously change its meaning, such as change how many statements are in the scope of an if.

Re:You can't make C++ not ugly, but you can't not try (2010) by nineteen999 on Thursday February 27, 2020 @05:24AM (#22432124)
I was aiming for funny and accurate, not deep. Sad, for some, I guess that its heyday is long past, and that it will never ever rise to compete even with C/C++ commercially again, no matter how hard some people kick the dinosaur corpse.
Re:You can't make C++ not ugly, but you can't not try (2010) by msla on Friday February 28, 2020 @02:36PM (#22445621)
No, C++ has obscure keywords like << which mean vastly different things, and can change, based on some invisible context.
Re:You can't make C++ not ugly, but you can't not try (2010) by ridiculous_fish on Thursday February 27, 2020 @01:45AM (#22431186)
Nope, only trap representations, in case you are using an Itanium for some reason.
Re:You can't make C++ not ugly, but you can't not try (2010) by nineteen999 on Thursday February 27, 2020 @02:01AM (#22431266)
Trap representations are an abstraction though, even if IA64 is one of the very platforms where they are used. CAR and CDR are literally named after CPU registers of the IBM 704.
Re:You can't make C++ not ugly, but you can't not try (2010) by hannofcart on Wednesday February 26, 2020 @09:13PM (#22429723)
"...because it's more of a Katamari Damacy of stray CS than a language with a coherent focus"

This is the funniest and most accurate description of C++ that I have ever heard. +100 for the game reference.

Re:You can't make C++ not ugly, but you can't not try (2010) by WalterBright on Thursday February 27, 2020 @12:34AM (#22430797)
> How many other languages have a Turing complete sublanguage built into them just to handle templating?

D does. It's just that nobody uses it for that, because CTFE (Compile Time Function Execution) is so much better.

https://dlang.org/spec/function.html#interpretation

Re:You can't make C++ not ugly, but you can't not try (2010) by adev_ on Thursday February 27, 2020 @03:48AM (#22431711)
> Mindshare - Lisp has its zealots. C++ is tolerated rather than adored

“There are only two kinds of languages: the ones people complain about and the ones nobody uses.” ― Bjarne Stroustrup

A language does not need to be adored, it just need to do the job and have users.

Every language has its quirks, if they are not obvious enough, it just means your language is too young for now.

Languages/Frameworks with their zealots, evangelists and fanatics are generally the ones that will probably disappear in less than 10 years.

"coherent focus" (often mean dictator driven) never survives the test of time.

Re:You can't make C++ not ugly, but you can't not try (2010) by AnimalMuppet on Thursday February 27, 2020 @12:27AM (#22430774)
I don't know about templating, but... is Haskell's Hindley-Milner type identification system Turing complete? For that matter, Lisp's macros are definitely Turing complete, and they are... a templating system on steroids, maybe?

About mindshare: Lisp has zealots, but they are few, even if they are loud, and they are on HN more than many other places. C++ is perhaps not loved, but in some circles it is very well respected, the way a chef respects a very sharp knife. The value lies precisely in the sharpness.

Re:You can't make C++ not ugly, but you can't not try (2010) by gpderetta on Thursday February 27, 2020 @06:11AM (#22432301)
> is Haskell's Hindley-Milner type identification system Turing complete?

I'm out of my depth, but I'm pretty sure HM is not Turing complete by design as otherwise it wouldn't be able to guarantee that inference completes. An HM type system is about as powerful you can get without being Turing complete.

There are extensions to the type systems of languages that use HM making them Turing complete, but when using those extensions inference is not guaranteed or doesn't work at all.

Re:You can't make C++ not ugly, but you can't not try (2010) by Munksgaard on Thursday February 27, 2020 @04:30AM (#22431884)
The beauty of Lisp's macros are that they're specifically _not_ expressed in a separate language: They're ordinary Lisp expressions that work directly on the AST.
Re:You can't make C++ not ugly, but you can't not try (2010) by lispm on Thursday February 27, 2020 @05:00AM (#22432011)
Even better, they don't need an AST - they work with arbitrary s-expressions and thus in many cases simple list processing operations can be used for code transformations.
Re:You can't make C++ not ugly, but you can't not try (2010) by kccqzy on Thursday February 27, 2020 @01:31AM (#22431117)
> C++ is tolerated rather than adored

For lower-level programming, while my favorite is Rust, if I cannot use Rust for some reason (say the team against it) I'd use C++.

To be sure, what I mean is I would use my favorite subset of C++, and I adore that subset. The parts of C++ outside of my chosen subset are merely tolerated.

Re:You can't make C++ not ugly, but you can't not try (2010) by tomnj on Thursday February 27, 2020 @12:59AM (#22430935)
I haven’t understand the details, but supposedly Java generics are also Turing complete: https://arxiv.org/pdf/1605.05274.pdf