Earlier quoted context omitted.
> The fact it does not have hipster dev approved status is also an added bonus. What are you talking about ? the hype is strong with Go. So strong devs are persuaded they need to use Go at all cost then complain Go has a garbage collector ( just go go-nuts mailing list). So strong there are countless articles on the net about "How we moved from X to Go..." just like in 2007/8 with Rails. > The minute we see a bloated…
> So strong there are countless articles on the net about "How we moved from X to Go..." Writing about Go is a great way to hit the front page of HN. I once saw 5 articles about Go on the HN front page at the same time!
Go best practices, six years in
181–190 of 207 posts
Re: Go best practices, six years in
#182Earlier quoted context omitted.
Besides being planned for Java 10, there are AOT and JIT compilers for Java that are able to convert simple Java types that follow a specific value pattern into value types. An example would be how the IBM J9 JIT converts a final Point class, just with getters and setters into a value type. Also there are language extensions from JVMs like IBM Packed Objects or Azul Object layouts that are exploring how to involve th…
If the compiler can prove that an object is final and immutable and is never used in any other context that requires reference semantics, it could potentially use that optimization. But then you also need data structures that can be parameterized to store such value objects as values. Otherwise you're back to square one.
Re: Go best practices, six years in
#183The stages of go enlightenment: 1. Holy crap, this is like coding in early Java days, what the heck were the language designers smoking?! They just ignored everything! Where's my testing framework! DI?! Build system, dependency management?! WTF. 2. Holy crap, this is like coding in the early Java days! This is awesome! I can understand all golang code I read! Everything is so simple and easy. I finally get "less is m…
And, of course, it spawned a completely useless thread litigating Java vs. Go. Perhaps that's why it's at the top of the thread --- which means voting had a perverse effect for this topic.
I don't know what to do about this tendency in language threads on HN, but it's a real problem.
Re: Go best practices, six years in
#184Earlier quoted context omitted.
Value Types are being worked on now for Java 10+. https://en.wikipedia.org/wiki/Project_Valhalla_(Java_languag... The Java language is definitely not set in stone.
No, the Java language is not set in stone. Its terrible memory usage is set in stone as long as the language doesn't have value types. If (and that's a big if) they introduce value types in 2018, it will have been almost 25 years since that fateful decision that has done so much damage.
Re: Go best practices, six years in
#185Earlier quoted context omitted.
Imagine, Java is run on your phone's SIM card. Enough? On other hand, on truly constrained embedded systems where real time is essential, no GC-based language has any business, no matter how GC is good. Even C++ is sometimes avoided.
You mean like missile radar control systems? http://www.pr.com/press-release/136232 Or do you prefer Aegis battleship Weapons System ? http://dl.acm.org/citation.cfm?id=2402699 These are my favorite examples for Java being used in life critical situations.
> The applications use a combination of Thales proprietary middleware written in C combined with Java code enabled by the Java™ Native Interface (JNI).
> AONIX has additionally delivered professional services to help PERC Ultra users at Thales optimize their applications and improve execution performance including, a customer-specific training course handled the needs of coding in Java™ with hard real time constraints.
Seems like with helping of C and Consulting on 'How to do Java right' they made it work.
> End-to-end distributed thread timing constraints measured from stimulus to response are typically under 100 ms.
Since it is slightly faster than typical (per char) typing speed on keyboard. It appears nice but terribly impressive real time Java use case.
Re: Go best practices, six years in
#186Earlier quoted context omitted.
But the Java JRE update installer wizard for Windows touts the fact that Java is "in" thousands of embedded systems -- parking meters, toasters, etc.
Imagine, Java is run on your phone's SIM card. Enough? On other hand, on truly constrained embedded systems where real time is essential, no GC-based language has any business, no matter how GC is good. Even C++ is sometimes avoided.
Not Java, not even close. JavaCard is an extremely stripped-down version of Java. I've used it and it feels like C.
From https://en.wikipedia.org/wiki/Java_Card#Java_Card_vs._Java:
> However, many Java language features are not supported by Java Card (in particular types char, double, float and long; the transient qualifier; enums; arrays of more than one dimension; finalization; object cloning; threads). Further, some common features of Java are not provided at runtime by many actual smart cards (in particular type int, which is the default type of a Java expression; and garbage collection of objects).
[EDIT] But I am not arguing with the overarching argument that Java proper can run efficiently on very constrained devices. It all depends on the implementation.
Re: Go best practices, six years in
#187Earlier quoted context omitted.
You mean like missile radar control systems? http://www.pr.com/press-release/136232 Or do you prefer Aegis battleship Weapons System ? http://dl.acm.org/citation.cfm?id=2402699 These are my favorite examples for Java being used in life critical situations.
Well 2 thing stand out for me from links you mentioned: > The applications use a combination of Thales proprietary middleware written in C combined with Java code enabled by the Java™ Native Interface (JNI). > AONIX has additionally delivered professional services to help PERC Ultra users at Thales optimize their applications and improve execution performance including, a customer-specific training course handled the…
Re: Go best practices, six years in
#188After working with .NET/Java/Node.js/Ruby/Python etc the move to Go involved a larger investment in time. I found this really informative and it's great to have the learnings condensed down.
Does anyone want to submit a best-practice Go solution?
Re: Go best practices, six years in
#189We inject a logging interface into all our methods that take a context.Context object [1]. This allows us to push contextual information onto the stack of context objects, and then when we log we can do it at the point of failure and have access to an immense amount of useful information. Check the attached gist to see an example of how this works in practice [2].
Given that the context library originated out of Google and is now part of the stdlib in 1.7, I would love to see other libraries embrace it instead of relying on much less flexible solutions.
[1] https://godoc.org/golang.org/x/net/context
[2] https://gist.github.com/justonia/f81eead323d2b23eca1c485ed8e...
Re: Go best practices, six years in
#190Earlier quoted context omitted.
Could you please provide the link?
I'm assuming they are the ones listed here: https://peter.bourgon.org/talks/