Urgent.News

What's breaking now, across thousands of outlets.

Tech

Solod 0.4: Better C interop

Solod 0.4 brings several improvements to the subset of Go that compiles to regular C. The primary enhancements include better C interop, freestanding packages, and improved tooling.

Sobind, a tool for generating bindings, transforms .h files into Solod source files containing required structs, unions, constants, variable declarations, function pointer typedefs, and function declarations. This allows users to directly incorporate the generated types and functions into their Solod code. Many popular C libraries, such as libuv, raylib, sodium, and sqlite, now come with pre-made bindings.

A significant change in Solod 0.4 is the ability to make most packages in the standard library freestanding, meaning they are independent of any libc implementation or specific OS runtime. This update has resulted in 37 standard library packages, with 31 functioning in freestanding mode without restrictions. However, certain packages have limitations when running in this mode.

The language has adopted a new comma-ok type assertion for non-empty interfaces, simplifying code readability. The c package now supports more common C types, including a c.ConstVoid type that maps to a C const void. Cast functions like c.Bitcast and c.StringData/c.SliceData provide better control over bit-level operations and access to string or slice data.

Solod's test command now supports running multiple packages simultaneously, making the testing process faster and more efficient. The -target and -check flags enable cross-compilation and specify the target platform, respectively. The -pkg-file flag restricts the test run to specific packages listed in a file.

With v0.4, Solod can work with nearly any C library thanks to automatic bindings. This opens the door for bare metal programming and improved standard library support. The next release will focus on enhancing the standard library, adding more C library integrations, and further improving tooling for a seamless development experience.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at antonz.org →

More in Tech

Building an Interactive Excel Dashboard for E-commerce Product Analysis: A Case Study of Jumia Products

E-commerce sites like Jumia gather enormous volumes of data every day, including product ratings, prices, discounts, and customer reviews.

  • Jumia platform processes vast daily data on product ratings, prices, discounts, and reviews
  • Cleaned data structured into Excel Table tblProducts for streamlined analysis
  • Interactive dashboard reveals insights on pricing, discounts, and customer review patterns

More from Saturday 12 September →