Hacker News new | past | comments | ask | show | jobs | submit login

> The thing that makes this work in Swift is the concept of Progressive Disclosure. One of the main tenants of the language is that it should be possible to be productive with a small, high-level subset of the language

"Progressive Disclosure" is an interesting idea for PL research, but IME Swift doesn't do a very good job at it. There's a million cases I've seen where people trying to do simple things run into a pandora's box of complexity (e.g., the infamous "Protocol 'P' can only be used as a generic constraint because it has Self or associated type requirements"). There isn't really a "small subset" I've found that's usable for anything but the absolute simplest programs. Even the fundamental types like Int and String have a lot of not-entirely-hidden complexity in Swift.

> Because it's a relatively un-opinionated language

It seems awfully opinionated to me. There is a clear preferred way to write almost anything. Ask online about how to do things differently, and you'll be told to do it in a more "swifty" way.

> because of the powerful type/protocol system, it can really feel like you can carve out a DSL for each specific use-case

I'll have to see if the new features in the latest versions of Swift (used for SwiftUI) enable this more readily, but as of 4.2, anyway, writing DSLs in Swift is moderately limited and painful.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: