Hacker News new | ask | show | jobs
by MBCook 646 days ago
I’d suggest looking at Swift.

Non-Apple development keeps getting better. It’s a very easy to read language with lots of safety, strong types,good standard library, await, and tons of users (thanks to Apple). Integrates easily with C/C++/Obj-C/Obj-C++, or anything else that can do C interop. Just gained neat macros and tests.

It’s probably my current “if I could pick anything” language.

On top of all the rest, it looks more like JS/Python than the pile of symbols C++ or Rust or even Obj-C can turn into.

2 comments

Ladybird browser decided to use Swift of all things. I am just confused on how can one use a ARC based language for extreme performance software like a browser . Don't you need manual memory control or custom memory paradigms like arenas ?
Now imagine using such a language for a full blown graphical workstation!

"Eric Bier Demonstrates Cedar"

https://www.youtube.com/watch?v=z_dt7NG38V4

"Project Oberon"

http://www.projectoberon.net/

"The Midori Operating System Overview"

https://www.youtube.com/watch?v=37WgsoZpf3k

https://joeduffyblog.com/2015/11/03/blogging-about-midori/

Nice, but like the extinct Dodo, these are all affectionate memorials to dead software. The web browser is still alive and kicking after 30 years. And is the world's most popular software application. And all the mainstream browsers are mostly written in C++. Even the massively hyped Servo never got adopted into Firefox.
As usual, the usual mistake to mix up technology with political mistakes, and lack of budget.

Apple and Google show on their mobile OSes how to make developers dance to the music of modern systems languages.

Swift has always been designed with the potential for more manual memory control. Recently, non-copyable types were introduced, and non-escapable types are currently being proposed. Additionally, more ownership control features are being added. While there is still much work to be done, progress is steady.
> it looks more like JS/Python than the pile of symbols C++ or Rust or even Obj-C can turn into.

I mean, maybe at a surface level. But under the covers with stuff like existential containers, opaque types, boxed types, ARC, etc it's a lot more complicated

Maybe the syntax "looks" modern like python but writing in it feels like smart pointer C++ with more safety features built in

Personally I'd rather just use C++ with a strict style guide, fewer new semantics to relearn

It's also funny that apple presents it as a "beginner friendly" language. Maybe it's possible for people to write in it without getting too far in the weeds, but like C++ it feels like a kitchen sink

Maybe all languages are like this to some degree, where there's a big gap between being proficient enough to write something and knowing it well enough to write something properly. It feels like Swift has a low barrier of entry but doing things properly has a much higher learning curve