Spyke

Posts

golang·Go programming language discussionbysbinet

Star-TeX v0.7.1 is out

hi there,

Star-TeX v0.7.1 is out:

After a (very) long hiatus, development of Star-TeX has resumed. Star-TeX is a pure-Go TeX engine, built upon/with modernc.org/knuth.

v0.7.1 brings pure-Go TeX → PDF generation.

Here are examples of generated PDFs:

PDF generation is still a bit shaky (see #24), but it's coming from the external PDF package we are using rather than a Star-TeX defect per se.

We'll try to fix that in the next version. Now we'll work on bringing LaTeX support to the engine (working directly on modernc.org/knuth).

https://pkg.go.dev/star-tex.org/x/[email protected]Open linkView original on lemmy.ml
1
golang·Go programming language discussionbysbinet

[ANN] peertube: a (simple) Go client for PeerTube

hi there,

just a quick message to announce my latest small pet project of the week :

A simple (and incomplete) Go client for PeerTube1 (an alternative to Big Tech's video platforms).

Right now, the client can:

  • authenticate with a PeerTube server,
  • list accounts,
  • list videos for a given account,
  • upload videos for a given account,
  • remove videos for a given accounts.

There's also a simple peertube-cli command-line program to perform the things above:

$> go install git.sr.ht/~sbinet/peertube/cmd/peertube-cli
$> peertube-cli help
peertube-cli - runs peertube-cli commands and sub-commands

Commands:

    auth-add     authenticate with a PeerTube server
    auth-ls      list the known PeerTube servers
    auth-rm      remove a PeerTube login
    video-ls     list video(s) from a PeerTube server
    video-upload upload a video to a PeerTube server

Use "peertube-cli help <command>" for more information about a command.

It's not much, but it allowed me to ease the day-to-day work of uploading audio files for a podcast I am maintaining and authoring.

hth, -s

https://sr.ht/~sbinet/peertubeOpen linkView original on lemmy.ml
9
golang·Go programming language discussionbysbinet

Preview: ranging over functions in Go

A major Go language change proposal was published earlier this week: add range over int, range over func, and there's a good chance this change will make it into a future Go release. In this post I will discuss the motivation for this proposal, how it's going to work, and provide some examples of how Go code using it would look.

https://eli.thegreenplace.net/2023/preview-ranging-over-functions-in-go/Open linkView original on lemmy.ml
7
golang·Go programming language discussionbysbinet

Go 1.22 inlining overhaul

The Go compiler’s inliner has never been particularly good. It wasn’t until Go 1.12, released in 2019, that the Go compiler supported inlining more than leaf functions, and we’ve slowly chipped away at more limitations of the inliner over the years (it started inlining functions with for loops in early 2021!). Go 1.20, released in February 2023, added support for basic profile-guided inlining, the most significant change to Go’s inlining policy since 1.12.

[...]

The rest of this document lays out a set of considerations for a redesign of Go’s inlining policy.

https://docs.google.com/document/d/1a6p7-nbk5PVyM1S2tmccFrrIuGzCyzclstBtaciHxVw/edit

Go 1.22 inlining overhaulhttps://docs.google.com/document/d/1a6p7-nbk5PVyM1S2tmccFrrIuGzCyzclstBtaciHxVw/editOpen linkView original on lemmy.ml
3
golang·Go programming language discussionbysbinet

ccgo/v4 experiment: Trying the new runtime.Pinner

tl;dr: Looking forward future Pinner.Pin performance improvements.

The upcoming Go version 1.21, scheduled for release next month, is currently available for download as Go 1.21rc2 in the "Unstable version" section here. Go 1.21 introduces a new runtime type, Pinner.

ccgo/v4, the next, also not yet released version of the C to Go transpiler, uses pinning to "freeze" addresses of local Go variables, addresses of which are passed around in the original C code. ccgo produces Go code where any C pointer points to memory not managed by the Go runtime. So ccgo simply puts such "escaping" variables in the memory not visible to the garbage collector, with stable, immovable addresses. Those are provided by the modernc.org/memory package. Otherwise a goroutine stack resizing can change the address of a local variable.

https://modern-c.blogspot.com/2023/07/ccgov4-experiment-trying-new.htmlOpen linkView original on lemmy.ml
5
golang·Go programming language discussionbysbinet

odt: an OpenOffice document parser

hi there,

I've just cut [email protected], an OpenOffice document parser, "automatically" generated from the RelaxNG specification document.

odt also provides odt2md, a command that tries its best to convert an ODT file into a CommonMark one.

$> go install sbinet.org/x/odt/cmd/odt2md@latest
$> odt2md -h
odt2md converts an ODT document into a CommonMark one.

Usage: odt2md [OPTIONS] [INPUT.odt]

Example:

 $> odt2md input.odt
 $> odt2md input.odt > out.md
 $> odt2md -o out.md input.odt
 $> odt2md < input.odt > out.md
 $> odt2md -o out.md < input.odt

Options:
  -o string
    	path to output CommonMark file

$> odt2md ./testdata/simple.odt

# Title

Hello World!

https://pkg.go.dev/sbinet.org/x/[email protected]Open linkView original on lemmy.ml
13

You reached the end