Hacker Newsnew | past | comments | ask | show | jobs | submit | linkdd's commentslogin

Emphasis on "one per partition", which if I understand correctly as "network partition", means that in the absence of network partition, there is one leader.

I do have only a surface understanding of Raft, and I'm learning while doing yes.


In Raft state space is split into partitions. Each partition gets it leader. For example in a cluster of 3 nodes and 65536 partitions each node is a leader for 1/3 of partitions with two others acting as replicas. This way each node simultaneously leader for some partitions and replica for others.


Gotcha, thank you for the clarification.

I'd add though, that the "one leader" thing was not the only reason why I ditched Raft. The Go library hashicorp/raft was quite complex to use, and I've had a lot of situations where the cluster failed to elect a leader, and ending up with a corrupted state.

This might be a PEBKAC issue of course.


https://link-society.github.io/flowg/

It's a log management/processing software, with visual scripting.

Started out of frustration towards OpenObserve and its inability (at the time) to properly/easily refine/categorize logs: we had many VMs, with many Docker containers, with some containers running multiple processes. Parsing the logs and routing them to different storages was crucial to ease debugging/monitoring.

It was initially built in Go + HTMX + React Flow encapsulated in a WebComponent, I then migrated to React (no SSR). It integrates VRL using Rust+CGO.

It is by far easier to use than Logstash and similar tools, and in fact it aims to replace it.

Contributors are welcome :)


You should take a look at AnyIO, which unifies asyncio and Trio (it can use both event loops as a backend).

Two big deals of Trio and AnyIO are channels (similar to Go's channels), the ability to return data from starting a task in a nursery/task group:

    async def my_consumer(task_status = anyio.TASK_STATUS_IGNORED):
        tx, rx = anyio.create_memory_object_stream()
        task_status.started(tx)

        async for message in rx:
            ...

    async def my_producer(tx):
        await tx.send("hello")
        await tx.send("world")
        await tx.aclose()

    async def main():
        async with anyio.create_task_group() as tg:
            tx = await tg.start(my_consumer)
            tg.start_soon(my_producer, tx)


> Shef is a powerful CLI tool for cooking up shell recipes.

I only see a YAML DSL. Where is my "shell"?


See `command:`


I will try IntelliJ then.

Zed isn't available yet on Windows I think (at least, not prebuilt binaries?)


No, not gonna migrate to Linux.

I do work and target Windows for a few other projects.

Also, not trying to start a flamewar, but I've spent too much time tinkering on Linux in the past. There is *always* some hardware compatibility issue, or some missing drivers, and especially with GPUs. Linux works best on a server, or on a VM. At least, that is my experience (and I've been on Linux for more than a decade, be it with either Debian, Archlinux, Gentoo, or Ubuntu).


you're not trying to start a flamewar but you're spreading inaccurate info... fyi, at our company, all pc 12" to 43" dell latitude optiplex or nuc intel or custom are on ubuntu or now debian/xfce... management, sales, infographics, software development, hardware design...


for Ada, C, C++, Python: GNAT Studio, written in Ada, free software, pc mac linux, fast light powerful...


The ability to autocomplete, and navigate through the code (even my dependencies's code) by the click on a function, the popover showing the documentation/signature of the function i'm going to call. Those are Quality of Life features I'm not ready to give up on.

As said in a sibling comment, I often work on cross-language projects, I don't recall Jetbrains offering a "one size fits all" IDE.


> The ability to autocomplete, and navigate through the code (even my dependencies's code) by the click on a function, the popover showing the documentation/signature of the function i'm going to call. Those are Quality of Life features I'm not ready to give up on.

ctags did most of that decades ago. Plain vim has good autocomplete and signature popovers, along with navigating to functions and class definitions. No LSP needed. An LSP will do it better but with sometimes significant overhead.

As I noted I don't use VSCode or a JetBrains IDE. I know about them and have used them. My setup works language-agnostic, and I also work in multiple languages.

Possibly useful, at least interesting:

https://youtu.be/XA2WjJbmmoM


I don't have a lot of extensions actually, my VS Code is pretty much vanilla.

I'm on the latest version (1.97.2).

I can try the other memory settings indeed, but I think the culprit is the builtin file watcher. I've stumbled across some similar issues on Github, open for 5 years without a solution :(

Isn't IntelliJ IDEA for Java/Kotlin? I have a project which is cross-languages: Go+Rust on the backend, Typescript/React on the frontend, Hurl and Python (Robot Framework) for the test suite. And I'd rather not have one IDE per language (which is IIRC what Jetbrains do).


The underlying spirit of marshughes comment sounds on the right track, though - something changed on your system. Maybe it was VS Code, maybe it was something else, but if this is a recent change, you should troubleshoot what actually changed. If it really is VS code, then yes - find a new editor. But I'm not seeing much about what troubleshooting you've done?

Maybe you've already done this, but if I were you, I'd take note of everything that has been installed and updated in the last month. Walk back installs and updates until your problem goes away, and then you'd know exactly what is causing the problem behavior.


And it's fine. Why continue using something you don't master?

Yes you could try to master it, but it takes years. If another tool compensates your lack of mastery, why not use it?


To me the implication is that the culture at this company won't allow this team to master Go either, and in a few years there will be a post describing how they moved from Go to another language.

Many people like to write about how Golang is so simple, but the drawback of that simplicity is that many features of other languages are either covered by additional dependencies or by inflating code size. It's just as possible for Go projects to devolve into big balls of mud as for any other language.


Golang's standard library looks pretty complete to me and they will probably master it in a month.


The mindset that you can master any programming language in a month is exactly what I meant in my previous post. There's a veritable cottage industry of "golang pitfalls" blog posts out there that show there are absolutely a lot of footguns in Go.

For example, what do you think the following should print?

    values := []int{4, 8, 15, 16, 23, 42}
    for value := range values {
     fmt.Println(value)
    }
I don't think there are very many people who would guess the integers 0 to 5.

I also like the following one:

    ch := make(chan int)
    ch <- 1
    fmt.Println(<-ch)
What would this print? The only correct answer is sadly "fatal error: all goroutines are asleep - deadlock!".

Golang is a fine language and simpler than most, but sadly "simpler" is not the same as "simple".


But people here are comparing a language standard library with a framework like Spring, which doesn't make sense.

The Java standard library has a web server in it, it has JDBC. You could use those directly. That's comparable to the Go standard library. For real apps people don't do this because they want a lot more, like simplified database access or session management.

Look at this: https://pkg.go.dev/database/sql

It strongly resembles JDBC. Doing a database query with that is verbose and error prone. Compare the work needed to do a lookup query and map the results to a data structure with that to (Micronaut syntax, Spring is similar):

    @JdbcRepository(dialect = Dialect.POSTGRES) 
    interface GophersRepository extends CrudRepository<Gopher, String> {}
... and later ...

    var someGopher = gophersRepository.findById("goo");
Add the username/password/host/port to the config file and that's all you need for db access. Compare to the Go stdlib which wants you to manage drivers, connections, prepared statements, rollbacks, etc. It's a different level of abstraction.


And it misses something like Swing, which while not perfect, does the job and the best Go can hope for is Fyne, as third party.

Multithreaded collection types.

Configuring scheduling algorithms.

Pluggable services, cryptography algorithms, filesystem.

Sane way to manage dates, granted the original one was a bit clunky, but way better than parsing strings.

Sometimes I wonder if folks that criticise Java, and .NET, actually spend any time learning their standard libraries in practice.


This is why I don't buy the FP hype


There are a lot of leanings to master for Go as well which they may have not discovered.

As an example, the Go runtime does not honor container resource limits. You would think this would be one of the very first fundamental features supported out of the box by an advertised "cloud native" language.


> As an example, the Go runtime does not honor container resource limits

That’s no longer true for Go 1.19+


AFAIK, the basic issue is still open at https://github.com/golang/go/issues/33803 and https://github.com/golang/go/issues/59715.

You still need to use a helper library like https://github.com/KimMachineGun/automemlimit or https://github.com/uber-go/automaxprocs.

Go 1.19 only had this in its notes for memory changes

"...includes support for a soft memory limit. This memory limit includes the Go heap and all other memory managed by the runtime, and excludes external memory sources such as mappings of the binary itself, memory managed in other languages, and memory held by the operating system on behalf of the Go program"

Forgot to add: The JVM does this for you since JDK 17 https://developers.redhat.com/articles/2022/04/19/java-17-wh...


> ...includes support for a soft memory limit. This memory limit includes the Go heap and all other memory managed by the runtime, and excludes external memory sources such as mappings of the binary itself, memory managed in other languages, and memory held by the operating system on behalf of the Go program"

Of course it’s a runtime setting, it won’t affect other factors but you can’t say it didn’t solved anything “because there’s a GitHub issue open” Then Go runtime was unpredictable because of its ideology “CPU is unlimited but not Memory” and containers are kinda of a dynamic resource allocated but it did solve vast amount of problem dealing with kernel OOM and unpredictable GC cycles

> You still need to use a helper library like https://github.com/KimMachineGun/automemlimit or https://github.com/uber-go/automaxprocs.

I would be surprised if the Go team implemented it into the runtime, because some devs would love to have there own way of handling such settings so I don’t see it as an issue

> Forgot to add: The JVM does this for you since JDK 17 https://developers.redhat.com/articles/2022/04/19/java-17-wh...

We can’t just compare added features if don’t compare how backwards compatible the language is at that time I don’t know much about Java, but I wouldn’t say the same from upgrading from Go 1.9 to Go 1.19


Sorry, but no - putting the burden on the developer to detect whether they are running in a container or not and then determine and adjust to cgroup settings is far too high an encumbrance on the service developer. This is a demonstrative example of a fundamental responsibility that should always be delegated to the runtime as the default behavior.

Neither Go 1.19 nor any subsequent version has "solved" this issue.


> Sorry, but no - putting the burden on the developer to detect whether they are running in a container or not and then determine and adjust to cgroup settings is far too high an encumbrance on the service developer.

Because there’s no one way solution to this problem, the problem isn’t unique to only Go, but every GC language because you’re starving the program if there isn’t sufficient CPU Quota it will all eventually lead to CPU throttling, this isn’t really the problem of Go or any other GC language but at the OS layer, the inherent nature of containers

Secondly am pretty sure the Linux CFS does not strictly follow the CPU Quota, tho there could be something like a panic or warning, or switching to entirely different memory management just for what ? people who want 10ms ?


Most Jvm shops/devs I know are still on 11


That's the problem isn't it ? The Java of 8+ years ago is always compared to the Rust/Go/Python of today. (I am also guilty of this)


Upgrading from 11 is trivial though and we are at almost 24. The hardest was 8->9, or 9->11.


And many folks still code in C89, C99, C++98, Python 2, .NET Framework....

Language is not to blame for unwillingness to move forward.


Because like any shortsighted decision it can come back to bite you later.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: