Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Currently looking in to groovy for android dev precisely based on this observation - it has optional static typing (and it gets compiled to equivalent Java bytecode if you provide it not striped out like Dart) but it's dynamically typed and seems to be expressive enough to make the glue code succint. I figured since we need to learn it for the build system why not see if we can reuse it - looks promising so far.

I feel like whenever you have complex data hierarchies static typing just makes the whole thing manageable (recently wrote 2k loc python exporter for blender and prototype to consume it in C# - the C# is much more managable for this kind of thing, c++ is still kind of tedious because of shitty tools, build/module system and it's fairly verbose due to low level nature)



> I figured since we need to learn it for the build system

Most gradle build scripts are fairly short (e.g. 30 lines) and only use a minute subset of the Groovy grammar, so you don't really need to learn it. Any problems with the build script are far likely to be with the Gradle vocab than the Groovy grammar, e.g. the names of variables you're assigning to, or whether you've included them all.


> Currently looking in to groovy for android dev precisely based on this observation

You should look at Kotlin, I can't imagine any good reason to use Groovy on Android with Kotlin around.


I've seen Kotlin - few issues :

* it isn't 1.0 yet (guaranteed to have breaking changes)

* I don't see it as a dynamic/prototyping language - I see it more as a C# than as Python, frankly for the front end code that I want to write the python style of development is much faster and Groovy seems to have an answer if the performance of dynamic typing ends up being an issue. Most of the complex datastractures are in C++ anyway and will have a simple/clean interface to the front end

* it's an extra language to learn - not only me but by my coworkers as well. We already took on Groovy with Grails and we have a decent amount of build automation in it (and will have more)

I've learned a lot of languages so far (C++, Python, C#, Java, Clojure, JavaScript and I've played with Rust, F#, TypeScript, Objective C) - frankly the value of having as few languages as possible to share the actual code/tools/knowledge between different areas is huge and in order to introduce a new language to the mix it better have a significant benefit over the ones already used.


That's fair.

There are a few pros, though, one of which being that JetBrains is fully behind Android, and as a consequence, the Kotlin runtime is very small. Do you know how many methods Groovy's is?

I think you will also find out that Groovy's performance is going to be a problem on Android, but maybe it will be fast enough for you.


> Groovy seems to have an answer if the performance of dynamic typing ends up being an issue

What answer is this? Groovy's statically type compilation mode? You're better off from a QA perspective just using Java code.




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

Search: