← Back to context

Comment by jitl

2 days 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) is a nil safe language that compiles to go, so is easily adoptable in existing Go systems.

Borgo 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.

I 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.

  • Oof, 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.

Vlang 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.

  • I don’t think vlang compiles to Go

    • Vlang has a Go to V translation project (Go2V)[1]. Usually vlang compiles to C (possibly aiming for a smaller and safer subset). This was a project focus[2] years before particular competitors, thus another hidden point, from which some of the drama springs from.

      Additionally, vlang has other backends (ability to compile to other languages), such as JavaScript, WASM, native (in development), etc... There were contributors proposing having Pascal (Free Pascal variant) and Go as backend options too. There have already been discussions and experiments around creating V2Go libraries. Various developers appear to be waiting for the language to become a bit mature.

      [1] https://github.com/vlang/go2v

      [2] https://github.com/vlang/v/discussions/7849

  • There's plenty of reasons in this article and the comments here: 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.

  • A 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-programmi... (vlang on top)

    [2] https://www.youtube.com/live/puy77WfM1Tg/ (Anthony GG Review)

    [3] https://www.youtube.com/watch?v=b_voaf4Qw4w/ (Antono2 Review)

Java 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 :/

  • The 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.