News for hackers. Stuff that matters.
Re:SwiftWasm: Run Swift in Browsers by _bxg1 on Friday May 10, 2019 @06:12PM (#19882753)
I don't know Swift that well, but this was my immediate impression when I spent a couple hours with it (and I've used C, C++, Java, C#, Python, etc.).

The array/dictionary literal syntax (especially dictionaries) was probably the main thing. Lots of languages have similar array syntax (though fewer have the auto-grow behavior), but I can't think of another C-like language with first-class, dedicated dictionary syntax.

C-likes also don't often have first-class functions/closures, or named function parameters (JS doesn't technically have the latter, but it effectively does with object destructuring; this is one of the syntax niceties Swift added).

I didn't mean to imply they had an overall similar set of features, so much that someone who's comfortable with TypeScript would have a pretty easy time warming up to Swift, which matters on the web.

Re:SwiftWasm: Run Swift in Browsers by hellofunk on Saturday May 11, 2019 @12:28AM (#19884563)
Syntax is ultimately a fairly minor aspect of languages. The reference and value semantics, the memory management, the type system, the language runtime, these are what really create a development experience in a particular language. And they are on nearly opposite sides of the spectrum between Swift and JavaScript. If you are only superficially doing something in the language, a somewhat trivial project or just experimenting, then they might seem more similar than they really are.
Re:SwiftWasm: Run Swift in Browsers by paavohtl on Saturday May 11, 2019 @09:09AM (#19885970)
> C-likes also don't often have first-class functions/closures

I think C is the only remaining C-like language not to have first-class functions. And there are compiler extensions for that too.

Re:SwiftWasm: Run Swift in Browsers by _bxg1 on Saturday May 11, 2019 @10:31AM (#19886362)
My understanding is that in cases like Java and C++, the lambdas aren't truly first-class; they come with limitations. I could be wrong.
Re:SwiftWasm: Run Swift in Browsers by hellofunk on Saturday May 11, 2019 @03:46PM (#19888028)
That's true about Java but not C++. C++11 introduced true lambdas, but Java's idea of lambdas is rather laughable by comparison and nowhere near as flexible.