KEEP
swift-evolution
Our great sponsors
- Onboard AI - Learn any GitHub repo in 59 seconds
- InfluxDB - Collect and Analyze Billions of Data Points in Real Time
- SaaSHub - Software Alternatives and Reviews
KEEP | swift-evolution | |
---|---|---|
59 | 120 | |
3,183 | 14,666 | |
1.5% | 0.7% | |
0.0 | 9.4 | |
15 days ago | 8 days ago | |
Markdown | Markdown | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
KEEP
-
Unchecked Java: Say Goodbye to Checked Exceptions Forever
Most other languages agree that checked exceptions are not good by not having them.
As for alternatives, Try/Result and similar monads have decent adoption even in Java, but personally I quite like the Kotlin philosophy [1] to not have generic error containers and either use runtime exceptions or make failures of the return type.
[1] https://github.com/Kotlin/KEEP/blob/master/proposals/stdlib/...
- Is runCatching in use in any of your projects ? My team is abusing it
-
More on OOP: Polymorphism this time
The nitty-gritty is in the KEEP. They show in the end how they considered to add type classes, and then discarded the idea.
-
Making Lenses Practical in Java
Lenses work today. And I think the value class feature will be awesome.
https://github.com/Kotlin/KEEP/blob/master/notes/value-class...
-
Adding Coeffect System to Java with Project Loom
Seems like Kotlin Context Receivers then (https://github.com/Kotlin/KEEP/blob/master/proposals/context-receivers.md).
-
Rust: A Critical Retrospective
Kotlin has value classes. Here's a good overview of how they work in Kotlin: https://github.com/Kotlin/KEEP/blob/master/notes/value-class...
That document is a few years old now and was intended as a design document. But Value classes shipped with Kotlin 1.5. Apparently they are compatible with the project Valhalla value objects that will be added to the JVM at some point. So, this stuff is coming.
I had to look it up because even though I write Kotlin a lot, value classes are not something I have used at all. Looks useful but not that big of a deal and doesn't really solve a problem I have. Data classes and records (in Java) are a bigger deal IMHO.
In practice, the way you deal with immutability in Kotlin is to keep most of your data structures immutable by default unless they need to be mutable. E.g. there's a List and a MutableList interface. Most lists are immutable unless you create a MutableList. Same with val vs. var variables. Val variables can't be reassigned and you kind of use var only by exception when you really have to. The compiler will actually warn you if you do it without good reason. A data class with only vals can't be modified. Java is a bit more sloppy when it comes to mutability semantics. It has records now but all the fields have setters by default. It has var but no val assignments (you can use final to force this but few people do). And so on.
Semantically this is not as strong as what Rust does of course but it's good enough to make e.g. concurrency a lot easier. Mostly, if you avoid having a lot of mutable shared state, that becomes a lot easier.
You could imagine a Kotlin like language with much stronger semantics implementing borrow checking instead of garbage collection. It wouldn't be the same language of course but I don't think it needs to be very different. Using it would not be a massively different.
-
Java record pattern matching in JDK 19
I'd be very interested in a comparison between scala 3 using/given and Kotlin new context receivers https://github.com/Kotlin/KEEP/blob/master/proposals/context...
- Why no one recommends the use of the standard library's Result class but a custom sealed class approach?
-
[Question][Kotlin] Dexter Runtime Permissions development has stopped, whats the alternative?
This will be furthermore simplified with multiple receivers coming very soon
-
Java 20 looks like it may be one of the biggest updates in years
Tfw no pattern matching. :(
swift-evolution
-
Crafting Self-Evident Code with D
No, it's not. Refcounting CAN be a garbage collection algorithm, but in Swift it's deterministic and done at compile time. Not to mention recently added support for non-copyable types that enforces unique ownership: https://github.com/apple/swift-evolution/blob/main/proposals...
-
Swift Ownership Manifesto
> It's super easy to cause its type check to timeout, which is something I haven't seen when using Rust.
Yeah, the operator overloading design makes it too easy to construct an exponential search space.
> For instance, Swift doesn't have the orphan rule, so it's possible that 2 packages implement the same protocol for the same type, and when this happens currently there are no solutions;
There's now a warning about this: https://github.com/apple/swift-evolution/blob/main/proposals.... What other solutions can there be other than making it a hard error? It seems like an inherent drawback of typeclasses over first-class modules.
> there is this strange design decision that classes and structs should be different things and each have their own set of random limitations
structs in Swift are the same as structs in Rust, and a class is a heap-allocated reference counted box, like an Arc>.
> and there is SwiftUI, which hacks on the syntax itself, making statements no longer mean what they are supposed to mean
Result builders are a language feature and not part of SwiftUI: https://github.com/apple/swift-evolution/blob/main/proposals...
Just last week owning and borrowing parameters got accepted as well. https://github.com/apple/swift-evolution/blob/main/proposals...
It’s been the focus for a while especially after the concurrency work. It’s probably the final major feature before Swift 6
Swift 5.9 dropped at WWDC, and with it came with noncopyable value types:
https://github.com/apple/swift-evolution/blob/main/proposals...
as well as a way to explicitly move types:
https://github.com/apple/swift-evolution/blob/main/proposals...
I haven’t read either in-depth, though!
-
SwiftData
They actually can figure that out, though [0]. I hope this can solve some of it because their deployment model is the dumbest fucking thing. I'm glad they figured out how to backport async/await, it's just impossible to use in a serious library otherwise.
[0] https://github.com/apple/swift-evolution/blob/main/proposals...
-
Is there a web site I can go to if I want to find the SwiftUI roadmap?
https://www.swift.org/swift-evolution/ is where the discussion and planning of the evolution of Swift takes place.
- Experienced developers, would you recommend learning backend rather than doing side projects in iOS?
-
This is how an important Linux kernel patch cover letter SHOULD be written, please read
Sure, here’s the most recent Swift Evolution proposal as an example: https://github.com/apple/swift-evolution/blob/main/proposals/0395-observability.md
-
x = x + 1
There’s a pretty good write up by Chris Lattner from when they originally removed it, and I tend to agree with his explanation.
-
Understanding SwiftUI in depth
This is an opaque result type as introduced by SE-0244 and is available in Swift 5.1 with Xcode 11. This behaves like a “reverse generic”. In a traditional generic function, caller decides what types get bounded to callee’s generic arguments. But with opaque result type, the return type is chosen by the callee and comes back to the caller as abstracted.
What are some alternatives?
KorGE - KorGE Game Engine. Multiplatform Kotlin Game Engine
compose-multiplatform - Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
foundationdb - FoundationDB - the open source, distributed, transactional key-value store
kotlinx-datetime - KotlinX multiplatform date/time library
okio - A modern I/O library for Android, Java, and Kotlin Multiplatform.
PeopleInSpace - Kotlin Multiplatform project with SwiftUI, Jetpack Compose, Compose for Wear, Compose for Desktop, Compose for Web and Kotlin/JS + React clients along with Ktor backend.
swift-algorithms - Commonly used sequence and collection algorithms for Swift
kotlin-wrappers - Kotlin wrappers for popular JavaScript libraries
swift - The Swift Programming Language
kotlinx.serialization - Kotlin multiplatform / multi-format serialization
kotlindl - High-level Deep Learning Framework written in Kotlin and inspired by Keras