Google I/O 2017 keynote in 10 minutes

Anything stand out to you?

1 Like

Today? Today. :wink:

… also that Google wants to increase their consumption of my data, particularly in tying it to the social interactions associated with it, and that is not something I think is good for the world in general.

That said … Kotlin on Android -> niiice.

1 Like

Google finally have a non too shitty language on their stack. That is all. And even is Kotlin is nice, it is still quite Java.

(for those that wonders, the official Google languages were Java, C++, Go, Python and Dart. Python is not too bad, but outside of that…)

2 Likes

Dart and Golang are better than any other languages in the world.

…and why do you think that? Or perhaps the question should be why did you feel the need to register to say so :lol:

Great question @sgon0000. You have no examples of why, no reasons of why, nothing backing up the phrase?

Hmm, let’s take an example from the official documentation examples of each, recursive fibonnaci:

Dart:

int fibonacci(int n) {
  if (n == 0 || n == 1) return n;
  return fibonacci(n - 1) + fibonacci(n - 2);
}

Go:

func fib(n uint) uint {
    if n == 0 || n == 1 {
        return n
    } else {
        return fib(n-1) + fib(n-2)
    }
}

So immediately, lots of braces, flow control does not exit at end of function but rather at annoying returns. The if conditionals do not seem to return their last value in each, that is irritating… Etc…

Rust:

pub fn fibonacci(n: i32) -> u64 {
	match n {
		1 | 2 => 1,
		_     => fibonacci(n - 1) + fibonacci(n - 2)
	}
}

Well still has annoying braces, but conditionals return their last values and it propogates upwards, no surprising early returns.

Elixir:

  def fib(0), do: 0
  def fib(1), do: 1
  def fib(n), do: fib(n-1) + fib(n-2)

Braces (and other delimiters like do/end) are gone, it pattern matches in the head, very readable, etc… Though a more direct conversion should probably be this:

  def fib(n) when n==0 or n==1, do: n
  def fib(n), do: fib(n-1) + fib(n-2)

Though that is less elixir’y.

OCaml:

let rec fib = function
  | n when n=0 || n=1 -> n
  | n -> fib (n-1) + fib (n-2)

Or perhaps also:

let rec fib = function
  | 0 -> 0
  | 1 -> 1
  | n -> fib (n-1) + fib (n-2)

So the syntax of many others is immediately better.
Rust compiles to faster code with more simple code (Go can often get about as fast as rust, mostly, but it requires significantly more code to do the same tasks).

Just a couple things immediately on mind, got a dozen others while typing this out too, but eh, more data points than the original post. ^.^

/me has fun with language comparisons, they are a junk-shoot, but still fun. ^.^

3 Likes

First, thanks a lot for replying me to show my existence. Normally, I just speak to myself, nobody cares. To answer your question, It’s because I hate java and kotlin. I hope java to die for many and many years. But now, kotlin tries to save java’s life by changing the name. How funny is that! Google now can bypass oracle by simply changing the language’s name. LOL. Apple creates its own language, swift, and get all other people very excited and use it. Compared the history of swift to dart and golang, how stupid is google! Dart and Golang could be more successful than swift. Flutter could be more successful than react native. Google never push its own language hard. I was google lover and apple hater. Now, I hate google more and more everyday. I can’t wait to see fuchsia kills android. Stupid android team! They will pay for choosing kotlin instead of dart. Finally, thank you very much for replying me again. I think I will just shut up here and won’t post any further comments, otherwise, people may think I am even more crazy. PS: I knew there were differences btw kotlin and java, but they are still the same language and using jvm after all.

Yeah I worked with a lot of java in my last job and for last hobbies for over 5 years, that was hell, it is such a poorly designed language… >.>

I tried swift but could not really get in to it, it ‘felt’ wrong in a few ways, mostly in the API’s…[quote=“sgon0000, post:7, topic:5126”]
Flutter could be more successful than react native.
[/quote]

Flutter is quite an interesting API! I’ve been messing with it in my spare time the past 2 weeks. I’d prefer an actually decent language instead of Dart for it, but it is not bad as an API at all!

Uhh, Fuschia is Google’s. ;-)[quote=“sgon0000, post:7, topic:5126”]
They will pay for choosing kotlin instead of dart.
[/quote]

Dart has runtime performance hits that Kotlin does not have though, they both rather suck, but for different reasons. :wink:

Yep, Kotlin is just a fresh layer on java, just like Elixir is a fresh layer on Erlang, same language, different syntax, some macro’ing abilities in both. ^.^

And using Intelij IDE you can easy auto convert any java code to Koltin, so portability is perfect as IDE support what I can’t say about Scala (ide support can be poor with more complicated code).

“We will be partnering with Google to create a non-profit foundation for Kotlin. Language development will continue to be sponsored by JetBrains, and the Kotlin team (over 40 people and second largest team at the company) will operate as usual. Andrey Breslav remains the Lead Language Designer, and Kotlin will be developed under the same principles as before. We’ll keep our design processes open, because your feedback is critical for us in moving Kotlin in the right direction.”

1 Like

That’s because most of the APIs were written with Cocoa / Objective C in mind :wink: The actual language is pretty neat—just reading through a description may make it seem like it has a kitchen sink of features, but I think it enables lots of interesting paradigms in a thoughtful, pragmatic way, taking plenty of nice features from lots of other languages.

That description sounds like Scala. :wink:

Well, Scala has more… so much more… >.>

guiltily glances over at the half-read copy of Programming Scala on the shelf

Hehe, I have a dozen scala programs and libraries around on my SVN server, soooo… >.>

For a JVM language it is awesome. Aren’t they building a native compilation back-end too now?

I mean, the type features are cool, but the implicit stuff is a little annoying. As far as functional languages go, I find it much less clear than e.g. Haskell or OCaml. I think it’s all the square brackets making my eyes water. I’ll agree that if you have to use the JVM it’s great, but what kind of a life is that :stuck_out_tongue: It does seem they are, sounds interesting!

Incidentally, I did some contract work in Scala on a Play web app a few years back. I implemented some service or other with Akka, not knowing at all how actors are supposed to work. Now that I’ve got some experience with Elixir, I cringe at the fact I got paid for writing that >.>

1 Like

Ooo that is cool!

I actually found there was not a lot of implicit stuff other than implicit variables (which are pretty well opt-in anyway), or are you referencing something specific?

Hehe, Akka is not bad, there is an Akka.net now too.

3 Likes

I hate Scala implicit hell and prefer Kotlin function extension :slight_smile:

Scala

object Helpers {
 implicit class IntWithTimes(x: Int) {
   def times[A](f: => A): Unit = {
    for (i <- 1 to x) {
     f
    }
  }
 }
}
Then later in the code you can do:

import Helpers._
5.times(println("Hello")) 

Kotlin

fun Int.times(f: ()->Unit) {
  for (i in 1..this) {
    f()
  }
}
 
5.times {println("Hello")}

from

Wonder how many of the announced services Google will kill in a year or two.

2 Likes