You're right about reference counting being able to pause. But that's something you're more able to control. If you're doing game dev, you can say "I won't assign to references that might be big" during frame critical code.
With garbage collection, you're more or less "Run the gc before, hope it doesn't trigger during that critical spot." or the alternative of fiddling with the gc/manually firing it off so it doesn't stop your world when it's a bad time to stop the world.
Why should the swift syntax be considered the default now? "My name is $blah." has been the de-facto standard for ages.
Personally I like interpolation sigils since in most cases you don't actually use it, and languages like Scala allow you to define custom sigils with custom behaviour. For example, Slick defines a sql"SELECT * FROM table WHERE username=$username" syntax that does not cause SQL injection issues.
In fact, it's the first time that I've seen interpolation with round parentheses, rather than curly braces (which are used in javascript with $ (es2015 template literals), python, bash with $, ruby with #, groovy with $, etc... )
> LoL. Refcounting can lead to just as long pauses as GC
He didn't say more performant, he said consistent
You're both wrong. String interpolation is just a very thin syntactic layer. It's easy enough to write
printf("Half of %f is: %f5.2", someVal, someVal * 0.5)
instead of print("Half of $someVal is: ${someVal * 0.5}")
and a lot easier for a programming language to parse, without needing to feed the parser into the lexer. And you also get easy formatting of the decimal (e.g. %f5.2), whereas string interpolation (in Swift, Apache Groovy, etc) requires a separate call, e.g. print("Half of $someVal is: ${format(someVal * 0.5, "%f5.2")}")https://msdn.microsoft.com/en-us/library/dn961160.aspx#Ancho...
$"Name = {name}, hours = {hours:hh}"
var s = $"hello, {name}"
System.IFormattable s = $"Hello, {name}"
System.FormattableString s = $"Hello, {name}"
$"{person.Name, 20} is {person.Age:D3} year {(p.Age == 1 ? "" : "s")} old."(2) It's only consistent if you always know what your pointers are pointing at, and whether your pointers are the last reference to it... but then you can just use delete, right?
gcc -Wall -x c - <<EOF
#include <stdio.h>
int main(){ printf("\(hi"); }
EOF
So it's perfectly reasonable to write it and not mean interpolation (maybe they meant "\\(", but that's another matter)(2) A sequence can be sorted without you knowing which elements are inside it, A computation can be known to terminate without you knowing (yet) which value it will yield.
Similarly, you don't need to have internal knowledge of your code to know that you'll be able to rely on RC consistency in the future (otoh I guess that something consistent is not necessarily the same as something predictable)
Even if it’s accepted it’s not valid, at least in the C99 standard.
Laughing out loud is fine I guess but it adds nothing to this discussion as that paragraph would easily stand on its own or even be better without.
> Reference counting has the benefit of giving consistent, and more easily measured performance. There's no fear of the garbage collector suddenly leaping into action right at the worst time, or having to tune the collector to minimize pauses.
LoL. Refcounting can lead to just as long pauses as GC, if your reference is the last reference to a huge object graph.