Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by danielvaughn on Wednesday January 11, 2023 @04:37PM
(#34345288)
Forgive me, is swift not in the c family? I could have sworn that it was, but I'm not overly familiar with it.
[ Parent
| on HN ]
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by kibwen on Wednesday January 11, 2023 @04:46PM
(#34345401)
Lots of languages, including Java and Javascript, have been described as being "in the C family", but this papers over a whole lot of important details. Swift is a low-ish-level imperative-ish language with C-ish syntax.
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by obliquely on Wednesday January 11, 2023 @05:00PM
(#34345589)
You could just as plausibly say that Swift is a high-ish-level functional-ish language with a modern syntax. Whereas C blows up at runtime, Swift nags-and-whines at compile time - in that way it's very unlike C. All that said "in the C family" is highly ambiguous at best...
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by BuckRogers on Wednesday January 11, 2023 @05:20PM
(#34345865)
When I hear that C family languages are no longer to be utilized, I’m assuming they mean memory unsafe options. C & C++.
Everything else is just as good of an idea as the next. C family is the most successful language paradigm in the history of software. Abandoning those constructs would be suicide. Nothing would get done.
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by pyth0 on Wednesday January 11, 2023 @04:50PM
(#34345452)
I would think it is. It runs on the Objective-C runtime and has interop with it and C.
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by SimDeBeau on Wednesday January 11, 2023 @05:11PM
(#34345746)
It was built to interop well with obj-c which is a c superset, but it’s not a c-family language more than something like c# or kotlin
Re:Apple Announces Full Swift Rewrite of the Foundation Fram...
by jcranmer on Wednesday January 11, 2023 @07:21PM
(#34347181)
As I would use the terminology, the C family of languages generally corresponds to languages that follow C's general syntactic rules, such as how you represent operators (particularly = is assignment and == is equality), curly braces for blocks, and to lesser degrees, making distinction between statement/expression, or having types precede variable names.
"C-like", by contrast, is a language whose semantics follow closely to C, and in particular, the C-with-extensions languages like C++ or Objective-C are usually going to fall into this category.