What Go devs think about issues described by Daniel Lemire in article "The Go compiler needs to be smarter"?

251 views
Skip to first unread message

Igor Yemelianov

unread,
Jun 4, 2020, 3:35:02 PM6/4/20
to golang-nuts
Link to the article.

The question is - is it possible that the issues described in the article can be solved in for example next major version?

Thanks.

Ian Lance Taylor

unread,
Jun 4, 2020, 3:59:38 PM6/4/20
to Igor Yemelianov, golang-nuts
On Thu, Jun 4, 2020 at 12:34 PM Igor Yemelianov <cybe...@gmail.com> wrote:
>
> The question is - is it possible that the issues described in the article can be solved in for example next major version?

Yes, it is possible.

As Go is an open source project, you or anyone can make that much more
likely to happen by doing the work and contributing the changes.

Thanks.

Ian

Robert Engels

unread,
Jun 4, 2020, 4:03:11 PM6/4/20
to Igor Yemelianov, golang-nuts
The author either doesn’t know Java or had significant editing errors - Java determines uses the runtime processor type to optimize - it is not done at compiler time. It has different implementations based on processor - like Go - and it does JIT optimizations based on processor as well. 

More importantly, these micro benchmarks with fractions of a percent are meaningless. All powerful systems are distributed to scale, not micro optimized. 



On Jun 4, 2020, at 2:34 PM, Igor Yemelianov <cybe...@gmail.com> wrote:


Link to the article.

The question is - is it possible that the issues described in the article can be solved in for example next major version?

Thanks.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/7aef8f47-8834-4cd3-9ba0-67e51728a110o%40googlegroups.com.

Andy Balholm

unread,
Jun 4, 2020, 4:21:00 PM6/4/20
to Robert Engels, Igor Yemelianov, golang-nuts
I think by “at compile time” he means at JIT time (when converting bytecode to machine language).

Andy



Michael Jones

unread,
Jun 4, 2020, 5:17:45 PM6/4/20
to Andy Balholm, Robert Engels, Igor Yemelianov, golang-nuts
When he writes "you expect a good, optimizing compiler to..." he is implicitly stating that he wants more  than good optimizing compilation, he wants (understandably, but let's be explicit) iterated compile-time evaluation -- he wants fun() to be an integer value of 60. 

It is true that the gc Go compiler lacks this. I like it as a feature, it is like invoking "reduce()" in a symbolic algebra system. I hinted at it a while back by asking if Go should notice when a function returns a pure value and do substitutions -- clearly "x := math.Sqrt(4)" suggests "x := 2.0" or "const x = 2.0" depending on context. But this is a non-trivial step from compilation in the direction of metaprogramming via Turing-complete macro processors. It will make the compiler bigger and slower, and intellectually larger. 

It is an open issue decision wise, and a great deal of work implementation wise.



--
Michael T. Jones
michae...@gmail.com
Reply all
Reply to author
Forward
0 new messages