glibc VS go

Compare glibc vs go and see what are their differences.

glibc

Unofficial mirror of sourceware glibc repository. Updated daily. (by bminor)
InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
glibc go
45 2,101
1,250 120,631
3.0% 0.9%
9.8 10.0
7 days ago 6 days ago
C Go
GNU General Public License v3.0 or later BSD 3-clause "New" or "Revised" License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

glibc

Posts with mentions or reviews of glibc. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-01-09.
  • I cut GTA Online loading times by 70% (2021)
    3 projects | news.ycombinator.com | 9 Jan 2024
  • Cray-1 performance vs. modern CPUs
    4 projects | news.ycombinator.com | 25 Dec 2023
    I wonder if you’re using a different definition of ‘vectorized’ from the one I would use. For example glibc provides a vectorized strlen. Here is the sse version: https://github.com/bminor/glibc/blob/master/sysdeps/x86_64/m...

    It’s pretty simple to imagine how to write an unoptimized version: read a vector from the start of the string, compare it to 0, convert that to a bitvector, test for equal to zero, then loop or clz and finish.

    I would call this vectorized because it operates on 16 bytes (sse) at a time.

    There are a few issues:

    1. You’re still spending a lot of time in the scalar code checking loop conditions.

    2. You’re doing unaligned reads which are slower on old processors

    3. You may read across a cache line forcing you to pull a second line into cache even if the string ends before then.

    4. You may read across a page boundary which could cause a segfault if the next page is not accessible

    So the fixes are to do 64-byte (ie cache line) aligned accesses which also means page-aligned (so you won’t read from a page until you know the string doesn’t end in the previous page). That deals with alignment problems. You read four vector registers at a time but this doesn’t really cost much more if the string is shorter as it all comes from one cache line. Another trick in the linked code is that it first finds the cache line by reading the first 16 bytes then merging in the next 3 groups with unsigned-min, so it only requires one test against a zero vector instead of 4. Then it finds the zero in the cache line. You need to do a bit of work in the first iteration to become aligned. With AVX, you can use mask registers on reads to handle that first step instead.

  • Setenv Is Not Thread Safe and C Doesn't Want to Fix It
    6 projects | news.ycombinator.com | 19 Nov 2023
    That was also my thought. To my knowledge `/etc/localtime` is the creation of Arthur David Olson, the founder of the tz database (now maintained by IANA), but his code never read `/etc/localtime` multiple times unless `TZ` environment variable was changed. Tzcode made into glibc but Ulrich Drepper changed it to not cache `/etc/localtime` when `TZ` is unset [1]; I wasn't able to locate the exact rationale, given that the commit was very ancient (1996-12) and no mailing list archive is available for this time period.

    [1] https://github.com/bminor/glibc/commit/68dbb3a69e78e24a778c6...

  • CTF Writeup: Abusing select() to factor RSA
    2 projects | news.ycombinator.com | 11 Nov 2023
    That's not really what the problem is. The actual code is fine.

    The issue is that the definition of `fd_set` has a constant size [1]. If you allocate the memory yourself, the select() system call will work with as many file descriptors as you care to pass to it. You can see that both glibc [2] and the kernel [3] support arbitrarily large arrays.

    [1] https://github.com/bminor/glibc/blob/master/misc/sys/select....

    [2] https://github.com/bminor/glibc/blob/master/sysdeps/unix/sys...

    [3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/lin...

  • How are threads created in Linux x86_64
    3 projects | dev.to | 22 Sep 2023
    The source code for that is here.
  • Using Uninitialized Memory for Fun and Profit (2008)
    3 projects | news.ycombinator.com | 3 Sep 2023
    Expanding macro gives three GCC function attributes [2]: `__attribute__ ((malloc))`, `__attribute__ ((alloc_size(1)))` and `__attribute__ ((warn_unused_result))`. They are required for GCC (and others recognizing them) to actually ensure that they behave as the standard dictates. Your own malloc-like functions won't be treated same unless you give similar attributes.

    [1] https://github.com/bminor/glibc/blob/807690610916df8aef17cd1...

    [2] https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attribute...

  • “csinc”, the AArch64 instruction you didn’t know you wanted
    2 projects | news.ycombinator.com | 7 Jun 2023
    IFunc relocations is what enables glibc to dynamically choose the best memcpy routine to use at runtime based on the CPU.

    see https://github.com/bminor/glibc/blob/glibc-2.31/sysdeps/x86_...

  • memmove() implementation in strictly conforming C -- possible?
    2 projects | /r/C_Programming | 27 Apr 2023
    memmove can be very well implemented in pure C, libc implementations usually have a "generic" (meaning, architecture independent) fallback. Here is musl generic implementation and its x86-64 assembly implementation. For glibc, implementation is a bit more complex, having multiple architectures implemented, but you could find a generic implementation with these two files: memmove.c and generic/memcopy.h.
  • Fedora 38 LLVM vs. Team Fortress 2
    6 projects | news.ycombinator.com | 24 Apr 2023
    Yeah, looks like the Q_strcat(pszContentPath, "/"); is invalid, as glibc has only allocated exactly enough to fit the path in the buffer returned by realpath().

    Interestingly, the open group spec says that a null argument to realpath is "Implementation defined" [0]

    And the linux (glibc) man pages say it allocates a buffer "Up to PATH_MAX" [1]

    I guess "strlen(path)" is "Up to PATH_MAX", but the man page seems unclear - you could read that as implying the buffer is always allocated to PATH_MAX size, but that's not what seems to be happening, just effectively calling strdup() [2]. I have no idea how to feed back to the linux man pages, but might be worth clarifying there.

    [0] https://pubs.opengroup.org/onlinepubs/009696799/functions/re...

    [1] https://linux.die.net/man/3/realpath

    [2] https://github.com/bminor/glibc/blob/0b9d2d4a76508fdcbd9f421...

  • Method implementations
    2 projects | /r/cpp_questions | 15 Feb 2023
    For the actual sources you will have to look at one of the mirrors of the C standard library, such as https://github.com/bminor/glibc/tree/master/sysdeps/ieee754/dbl-64

go

Posts with mentions or reviews of go. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-06-16.
  • I've compared nearly all Rust crates.io crates to contents of their Git repos
    4 projects | news.ycombinator.com | 16 Jun 2024
    The problem is that if you clone the Git repository, or view it on GitHub, you have no assurance that you're seeing the same code that the go command or the Go module proxy saw. The author of a malicious module could change the Git tag to point to a different, benign, commit after the Go module proxy caches the malicious copy. There are other tricks an attacker can play as well: https://github.com/golang/go/issues/66653

    Ultimately, if you're doing a code audit, you have to compute the checksum of the code that you're looking at, and compare it against the entry in go.sum or the checksum database to make sure you're auditing the right copy.

  • Function fitting in Go
    1 project | dev.to | 14 Jun 2024
    must.Do proposal https://github.com/golang/go/issues/54297
  • Criando um modulo xk6 para k6
    3 projects | dev.to | 13 Jun 2024
    Go instalado
  • Orbail proposal for go error handling
    1 project | news.ycombinator.com | 12 Jun 2024
  • Swift Static Linux SDK
    14 projects | news.ycombinator.com | 11 Jun 2024
    This melding of the sync and the async is actually kinda interesting to me. I know that at least in lots of environments, the sync and async paths are effectively separate for things like I/O[1]. I wondered (and still do for some cases) how Go handles this.

    For those curious I looked at Windows and Linux, but not much else.

    Linux: no io_uring support. There's debate on even whether to use it as people are discussing security implications[2]. It looks like (from perusing this issue, but could be wrong) AIO wasn't used.

    Windows: it looks like they're using IOCP everywhere. Seems sensible enough.

    General case: there seems to be an open issue regarding this[3].

    [1]: For example, Windows has IOCPs, Linux has io_uring, FreeBSD has kqueue, POSIX has... POSIX AIO, etc.

    [2]: https://github.com/golang/go/issues/31908

    [3]: https://github.com/golang/go/issues/6817

  • Component Generation with Figma API: Bridging the Gap Between Development and Design
    2 projects | dev.to | 10 Jun 2024
    In today's fast-paced software development landscape, efficient workflows and clear responsibilities between development and design teams are crucial. One effective way to streamline these workflows is by automating component generation from design tools like Figma to code using powerful programming languages like Golang. This article will explore the process of converting Figma components to code, focusing on the clear differentiation of responsibilities between development and design teams.
  • The Functional Programming Hiring Problem
    1 project | news.ycombinator.com | 9 Jun 2024
  • A single ChatGPT mistake cost us $10k
    8 projects | news.ycombinator.com | 9 Jun 2024
    > The Go database/sql package actually executes ROLLBACK in the SQL engine.

    No: https://github.com/golang/go/blob/beaf7f3282c2548267d3c89441...

  • Go: Sentinel errors and errors.Is() slow your code down by 3000%
    7 projects | news.ycombinator.com | 31 May 2024
    Nice write-up.

    It's a shame that errors.Is is slow for general use, and at least some of that seems attributable to the Comparable change requiring reflection. Multi-errors seems to have bloated the switch. And of course the lack of a happy-path that was fixed in [1].

    Since Go already has two ways of handling exceptional state: return or panic, it does feel like a stretch to also introduce a "not found" path too. All bets are off in tight inner loops, but I think as a general coding practice, it'll make the language (de facto) more complicated/ambiguous.

    But my take away is that the question has been kicked off: can wrapped errors be made more efficient?

    1. https://github.com/golang/go/commit/af43932c20d5b59cdffca454...

  • Fast Shadow Stacks for Go
    3 projects | news.ycombinator.com | 30 May 2024
    I know that at least two engineers from the runtime team have seen the post in the #darkarts channel of gopher slack. One of them left a fire emoji :).

    I'll probably bring it up in the by-weekly Go runtime diagnostics sync [1] next Thursday, but my guess is that they'll have the same conclusion as me: Neat trick, but not a good idea for the runtime until hardware shadow stacks become widely available and accessible.

    [1] https://github.com/golang/go/issues/57175

What are some alternatives?

When comparing glibc and go you can also consider the following projects:

musl - Unofficial mirror of etalabs musl repository. Updated daily.

v - Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. Supports automatic C => V translation. https://vlang.io

cosmopolitan - build-once run-anywhere c library

TinyGo - Go compiler for small places. Microcontrollers, WebAssembly (WASM/WASI), and command-line tools. Based on LLVM.

dns - DNS library in Go

zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

0.30000000000000004 - Floating Point Math Examples

Nim - Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).

json-c - https://github.com/json-c/json-c is the official code repository for json-c. See the wiki for release tarballs for download. API docs at http://json-c.github.io/json-c/

Angular - Deliver web apps with confidence 🚀

wepoll - wepoll: fast epoll for windows⁧ 🎭

golang-developer-roadmap - Roadmap to becoming a Go developer in 2020

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured