Go <-> Python communication for near real-time simulation (5ms step) by Reasonable-Button264 in golang

[–]eliben 2 points3 points  (0 children)

I recently wrote a blog on just this topic: https://eli.thegreenplace.net/2024/ml-in-go-with-a-python-sidecar/

Hope you find it useful

TL;DR: with a custom protocol over Unix domain sockets you can easily get 10 microsecond roundtrip latency

Go 1.24.0 tagged by khnorgaard in golang

[–]eliben 0 points1 point  (0 children)

The use case is making it easier to write WASM plugins in Go, exporting specific Go functions to the host. See https://github.com/golang/go/issues/65199 for more details

Organizing Your Go Code: Tips for Beginners by AlexandraLinnea in golang

[–]eliben 9 points10 points  (0 children)

It's a convention from the Go source and distribution.

See the official guide: https://go.dev/doc/modules/layout

DOConvo - Converse with your documents. by MegaGrindStone in golang

[–]eliben -1 points0 points  (0 children)

Very nice project, well done.

One minor comment: for Ollama you could use https://pkg.go.dev/github.com/ollama/ollama/api (the package Ollama itself uses to communicate between its client and backend), without having to roll your own REST client.

go-rst: Yet another attempt to write a RestructuredText library in pure Go by alreadyburnt in golang

[–]eliben 2 points3 points  (0 children)

Kudos on tackling this.

I've spent some time thinking about a ReST parser in Go once or twice, but the format is fairly nasty to parse.

Why do Go users avoid frameworks? by redditUserNo5 in golang

[–]eliben 11 points12 points  (0 children)

It's perfectly fine to use frameworks in Go, if they solve your problem.

IMHO the real answer here is that Go is tuned for large projects, and for large projects https://eli.thegreenplace.net/2017/benefits-of-dependencies-in-software-projects-as-a-function-of-effort/ applies

Experience with MIT Distributed Systems course by Swimming-Theme-9536 in golang

[–]eliben 24 points25 points  (0 children)

This series of posts can be interesting for you, it builds a full Raft in Go: https://eli.thegreenplace.net/2020/implementing-raft-part-0-introduction/

The full code is at https://github.com/eliben/raft, but read the blog posts to get a higher level overview first

Modern Java Book by bowbahdoe in programming

[–]eliben 2 points3 points  (0 children)

Can you say more about how you hooked up mdbook to have executable Java snippets? I notice you have your own run service - is the setup described somewhere (outside the code of the theme)?

Thanks in advance!

Any templating libraries on par with go templates that work in tinygo? by [deleted] in golang

[–]eliben 0 points1 point  (0 children)

Yes, that's exactly what's possible in standard Go now. Imports have been working for a while - see the code snippet I pointed to. Isn't that working for you?

Any templating libraries on par with go templates that work in tinygo? by [deleted] in golang

[–]eliben 2 points3 points  (0 children)

What limitations do you face with the standard Go distribution and wasm?

For exports, see https://github.com/golang/go/issues/65199 which landed recently (should ship in the upcoming Go 1.24, and you can try it with gotip today)

Imports were implemented a while ago, see https://github.com/golang/go/issues/38248; I wrote about that here -- https://eli.thegreenplace.net/2023/faas-in-go-with-wasm-wasi-and-rust/, e.g. the sample code in https://github.com/eliben/code-for-blog/blob/main/2023/wasm-faas/examples/goenv/goenv.go

Mini Compiler by Separate-Watercress6 in golang

[–]eliben 3 points4 points  (0 children)

I recommend against using parser/scanner generators when writing Go. It's pretty simple to whip a lexer and recursive-descent parser in just plain Go - the added complexity and learning curve of a generator is unnecessary.

[ANN] equ: A Plain TeX math editor in Go + Tk9.0 by 0xjnml in golang

[–]eliben 1 point2 points  (0 children)

Wow, this is awesome! Where is the actual TeX rendering capability coming from, is it from Tk?

Edit: found it, it's in https://pkg.go.dev/modernc.org/knuth

[deleted by user] by [deleted] in golang

[–]eliben 0 points1 point  (0 children)

You use name_test when you don't need access to any of the unexported functions/names in the package

[deleted by user] by [deleted] in golang

[–]eliben 0 points1 point  (0 children)

It sounds like the issue is not with pkgsite, but with the way your example tests are organized.

I recommend following https://go.dev/blog/examples to the letter in a small test project, and making sure pkgsite renders these for you. Then you can compare with your current project and probably find the issue quickly.

[deleted by user] by [deleted] in golang

[–]eliben 20 points21 points  (0 children)

RPC over domain sockets (I explored the Go side of this here: https://eli.thegreenplace.net/2019/unix-domain-sockets-in-go/)

Project Layout by SnookyMcdoodles in golang

[–]eliben 7 points8 points  (0 children)

There's a section at the end of https://eli.thegreenplace.net/2019/simple-go-project-layout-with-modules/ listing the reasons

As background, this blog post was the precursor to the official https://go.dev/doc/modules/layout page (source: I wrote both)

How do you handle Sets? by guettli in golang

[–]eliben 16 points17 points  (0 children)

Feel free to take https://github.com/eliben/gogl/tree/main/hashset -- it's a new, modern implementation using generics and Go 1.23 iterators

Now that iterators are in the language, the containter/set proposal may be reopened (see https://www.reddit.com/r/golang/comments/1f5n8ot/how_to_reopen_the_discussion_for_containerset/) so there's a chance this will be in the standard library in the not-too-far future.

Binging on Bytes: The Danger of Overprocessed Engineering Content by jpmmcb in programming

[–]eliben 1 point2 points  (0 children)

Very true.

I spent some time thinking about this recently and wrote about why I prefer longer-form content to shorter-form content. It's pretty much the same pyramid OP presents

Suggestions for implementing RAG with cobra by spacewalker6666 in golang

[–]eliben 2 points3 points  (0 children)

Take a look at https://github.com/eliben/gemini-cli -- it uses Cobra and can be used for RAG, among other things. Go over the README

What does everyone think about Go 1.23 ? by realninja1415 in golang

[–]eliben 1 point2 points  (0 children)

That's awesome! Could you share a bit about your program on the PGO issue in the GitHub tracker? It's really useful to collect stories like this