News for hackers. Stuff that matters.
Re:Go port of SQLite without CGo by icholy on Friday April 07, 2023 @11:13PM (#35490133)
In addition, a lot of optimizations (like loop unrolling) are left on the table to preserve Go's fast compile times.
Re:Go port of SQLite without CGo by pjmlp on Saturday April 08, 2023 @01:08AM (#35490726)
Gccgo is the answer here.
Re:Go port of SQLite without CGo by Patrickmi on Saturday April 08, 2023 @08:06AM (#35492475)
Gccgo at its core may be fast but when it comes to how the go frontend interpret it to gcc ir that pales in comparison than just straight up optimizating the Go compiler

There’ll more opportunities for more optimizations since they move to SSA ir since 1.5 and in turn compile time will definitely go down

Re:Go port of SQLite without CGo by 59nadir on Saturday April 08, 2023 @03:23AM (#35491306)
I was surprised with the announcement that Go's standard compiler had register allocation for function arguments[0] added to it. This seemed like table stakes for a very long time but it really illustrated just how Go's compiler is much, much simpler than most in many areas.

On one hand it makes you wonder how much could be squeezed out of Go and how many basic things they're still leaving out of the compiler. On the other it tells part of the story of why Go compiles fast with the backdrop that despite this lack of work by the compiler people use Go productively all day and deliver services they are happy with from a performance perspective.

[0] - https://go.dev/doc/go1.17#compiler (2021-08)

Re:Go port of SQLite without CGo by zimpenfish on Saturday April 08, 2023 @04:05AM (#35491505)
I wonder if they'll ever switch to a "normal = fast compile, low optimisation; release = slow compile, high optimisation" model like Rust. Although I suppose other languages already have the "high optimisation" parts covered (rust, julia, python+numpy, etc.) which might make it a fool's errand.
Re:Go port of SQLite without CGo by Mawr on Saturday April 08, 2023 @06:35PM (#35498320)
It goes to show the impact of optimizing from top-down instead of bottom-up can have. Go was designed with performance in mind ("mechanical sympathy") as opposed to most other GC languages for which performance was an afterthought.

Structs instead of objects, value types, exposed pointers, straightforward allocation semantics.

Do these machine-optimized constructs impede productivity? Yes, but by maybe 20%, whereas the performance gain is 80%.