Hacker News new | past | comments | ask | show | jobs | submit login

Bonuses questions: do they other libraries stem from the java root client too or did they evolve separately (even out of house)? Why did you choose Java to port from? Are there interesting lessons in the commonality / differences between the language implementations?



RavenDB is written in C#. At first, it was Windows only but now is cross-platform database engine (Windows / Linux / Mac OS).

As a result, the original and most featureful client is for C# / .NET.

Java client is a port of C# client, done in house by Hibernating Rhinos (the creators of RavenDB).

As far as I can tell, other clients (Python / Node.js and the Go client that I wrote) were contracted to outside people.

The company suggested starting from Java code base. It makes sense because C# client heavily uses LINQ, which is unique to C# (neither Java nor Go has LINQ-like capabilities).

I didn't dig much into non-Java clients so can't speak much to that.

Overall, I was surprised how similar I was able to make Go code to Java code.

Changing from exceptions to errors was pervasive but a simple, mechanical transformation.

Porting functions using generics was the biggest hurdle.

Porting functions that use overloading was easy but annoying.

That being said, a Java code base that heavily used virtual functions and deep inheritance hierarchy would be more challenging to port to Go. Lucky for me, this code wasn't.


> neither Java nor Go has LINQ-like capabilities).

Not true since Java 8, with the introduction of streams and functional interfaces, which keep being improved with each release.

What Java doesn't have are expression trees, which are convenient but not a requirement for LINQ like features.


Expression trees are a requirement if you're writing a database client library.




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

Search: