3 ms·
Kotlin is very easily adoptable in existing Java systems and is much safer (although not guaranteed safe) Zig is fairly easy to adopt in existing C systems and
by jitl 1y ago
Kotlin is very easily adoptable in existing Java systems and is much safer (although not guaranteed safe)
Zig is fairly easy to adopt in existing C systems and is guaranteed null safe (although not use after free safe)
Rust, although quite safe, bears a fairly high adoption cost as existing code often cannot be ported directly.
Borgo (https://github.com/borgo-lang/borgo https://github.com/borgo-lang/borgo) is a nil safe language that compiles to go, so is easily adoptable in existing Go systems.
- paulddraper 1y agoJava Optional is just as safe as Kotlin Option (and predates it by a couple years). Scala, Kotlin, Java you just can’t get away from null :/
- jitl 1y agoThe important distinction for me with Kotlin's system is that the compiler guides developers to write null-safe code by default because it's built into the language itself. Whereas Optional in Java requires extra effort in instantiating Optional.of(...) all over the place. Java Optional is opt-in, similar to (but weaker than) SQL `NOT NULL` - easy to forget, rather than Kotlin opt-out. Even in safe languages like Rust, you can still introduce errors with the same semantics in application code as null pointer error: doing `some_optional.unwrap().someMethod()` will crash your program just as much as `someNullableObject.someMethod()` in Java.
- tpm 1y agoNull-restricted types will be available soon I hope.
- saltypal 1y agoI would only partially agree that Kotlin is "much safer." As one example, I just learned (by way of a nasty production app crash) that Kotlin chose to make all checked exceptions silently unchecked. Kind of a stunning own-goal for a language from 2010.
- jitl 1y agoOof, that feels like a blunder for Java interop, although I've never encountered use of checked exceptions in my admittedly limited Java experience. In everyday Kotlin code, I see either a sealed class or Result for cases where you'd find checked exceptions in Java, and otherwise normal unchecked exceptions from `require`, `check`, precondition assertions.
- adsharma 1y agoVlang is a much more active go variant with nil safety. But it gets a lot of hate in PL circles for reasons I don't completely understand.
- mirashii 1y agoThere's plenty of reasons in this article and the comments here: https://news.ycombinator.com/item?id=39492680 https://news.ycombinator.com/item?id=39492680. My tl;dr: The vlang team has repeatedly made false promises and assertions about what the language can do, ranging from a "we put things that are on our roadmap in our features list" to "we've promised something that is outright impossible". Analyzing how this has changed over the years, the only reasonable conclusion is that they're grifters who are okay with lying. In addition, they regularly engage in flamewars about it on this site, and their moderation practices of silencing any sort of criticism in their own spaces and calling anyone who dares question it idiots are well known and documented.
- hitekker 1y agoYeah, vlang's deception comes up a lot on HN. https://news.ycombinator.com/item?id=27441848 https://news.ycombinator.com/item?id=27441848 https://news.ycombinator.com/item?id=39503446 https://news.ycombinator.com/item?id=39503446 I'm not even for or against vlang-- I just find their behavior and imagination rather bizarre.
- baranul 1y agoA lot of the hate or controversy is very artificial, where it's orchestrated and manufactured by vlang's adversaries. It's easy to see that people from all over the world are contributors to the project (785 at last count) and enjoy using it (36,500 stars). Along with numerous good reviews[1][2][3]. Clearly, those people are making no concerted effort to do anything sinister, other than continuous development or enjoying vlang. As common sense will tell us, the only people likely to be upset about the language's consistent progress, are those who feel its a personal threat, have an axe to grind, or swallowed misinformation. Regular folks would not be worried or care, except about what they are using or working on. At the end of the day, it's a programming language, that we can choose to use or move on in life. It's really not or need not be anything more complicated than that. [1] https://www.slant.co/topics/15491/~general-purpose-programming-languages https://www.slant.co/topics/15491/~general-purpose-programmi... (vlang on top) [2] https://www.youtube.com/live/puy77WfM1Tg/ https://www.youtube.com/live/puy77WfM1Tg/ (Anthony GG Review) [3] https://www.youtube.com/watch?v=b_voaf4Qw4w/ https://www.youtube.com/watch?v=b_voaf4Qw4w/ (Antono2 Review)
- baranul 1y agoBorgo has a lot of weird things going on with it. There are only 2 contributors, don't see a license, and is very inactive. Of the other choices given, I think people shouldn't underestimate Kotlin.