Better HN
topnewbestaskshowjobs
Log inSign up

binary132

1,656 karma · joined Mar 24, 2014 (12y ago) · 1,717 submissions

Submissions

comment 3y ago · link · parent

I realize you have a different usecase in mind, so the following feedback might not be that useful to you. I also haven’t reviewed your API design, so perhaps you have already considered this angle.

I picked up a habit in Go package design which I now apply everywhere: one of my immediate first thoughts when evaluating a library is how it creates or uses threads.

When I see that a library wants to consume all of the available cores of my system, or uses an internal task scheduler or threading mechanism, I worry that it will compete for CPU time with the other processes, threads, etc. that my system and process are using.

On the other hand, I appreciate when a library exposes an interface for me to offer it threads or a scheduler, or even better if it offers primitives that I can use directly in my own threads or tasks.

Perhaps this is mainly a problem for high-concurrency servers and UIs, but it’s always one of my first thoughts, and Rust is an ecosystem which needs to support those usecases. Many threaded libraries, even otherwise very good ones, are not designed with this in mind and it is a problem.

comment 3y ago · link · parent

Missed opportunity to build a free alternative to Cling (“Clang-Repl” as it’s called now: https://clang.llvm.org/docs/ClangRepl.html) on GCCJIT

comment 3y ago · link · parent

I loved BASIC as a kid. C was really confusing because I was constantly committing egregious memory errors without realizing it, the spooky effects were totally mystifying to me, and I didn’t even have the reasoning tools to know where to start with debugging it. It was definitely distracting from simple logic.

On the other hand, it made me think a lot about computer memory, and it makes computer memory easy to work with. Now I’m really comfortable with memory and encodings so that’s nice. I don’t think I would have gotten that by starting with Java or Python.

comment 3y ago · link · parent

I’ve used high-fructose corn syrup in making marshmallows, it’s just corn sugar

comment 3y ago · link · parent

What limits are you willing to place on this? Majorities can and do vote for monsters.

comment 3y ago · link · parent

So what you’re saying is.... we’re going to have human-level AI, and it’s going to be incredibly stupid

comment 3y ago · link · parent

#

comment 3y ago · link · parent

maybe because it’s not in the commons

comment 3y ago · link · parent

Most companies are 100% focused on the logistics of delivering a product and only “care” about technical implementation inasmuch it will be a liability to the objective. Þe olde chicken and egg strikes again

comment 3y ago · link · parent

Nobody has to accept it. You can do it yourself today. That’s the point of my comment.

comment 3y ago · link · parent

Using a channel for something is using a mutex for it. Nobody should suggest a mutex as a solution for implementing iterators.

comment 3y ago · link · parent

I’ll cop to not having paid much attention to Go generics, but handwaving over my dubious syntax, what’s wrong with:

```

type Iter[T] interface { More() bool It() T }

type mapOver[T] struct { Iter[T]; func (T) T f }

func (m mapOver[T]) It() T { return m.f(m.Iter.It()) }

func Map[T] (it Iter[T], f func(T) T) Iter[T] { return mapOver{it, f} }

type Range { to, at int }

func (r Range) More() bool { return r.at < r.to }

func (r Range) It() (is int) { is = r.at; r.at += 1 }

func DoEach[T] (it Iter[T], f func(T) T) { for it.More() { f(it.It()) } }

// etc

iter.DoEach(iter.Range(10), fx.Stdout(fns.MultBy(2)))

// or whatever

```

Translating to English:

If you can do it just fine with the syntax you have, why do you need to add it to the core language?

comment 3y ago · link · parent

almost as if the designers knew what they were doing

comment 3y ago · link · parent

“Nonfree drivers are totally fine bro!”

comment 3y ago · link · parent

Unpopular opinion: old-style GOPATH semantics are significantly better than “package management”.

comment 3y ago · link · parent

Maybe I’m confused, but how is this different than an iron filing standing up in a magnetic field?

comment 3y ago · link · parent

Go is about as much like C as Java is.

comment 3y ago · link · parent

I think Rust and Zig are very different in principals and shouldn’t really be compared. It’s almost like comparing C and Ada.

comment 3y ago · link · parent

“Whatever you would use C for but better” roughly

I’m not really convinced because in Andrew’s livestreams he’s actively uncovered significant stdlib bugs that he is aware of and tables for later.

Hopefully those will all be gone by 1.0, but I doubt it. For now, I cannot consider it a viable alternative to anything for production software. I do hope it will be some day, because it’s a nice language, even if it has a few syntactic warts :)

that said... I feel safer choosing C89 or C99 for certain things due to its extremely wide availability and longevity.

It’s great for it to have competitors, but C and C++ are more like standards and less like one tool with a handful of people working on it.

comment 3y ago · link · parent

Obviously KPIs should be (and probably are) chosen specifically with this effect in mind.

comment 3y ago · link · parent

FWIW, one of the biggest obstacles to adoption of RPC components in our C++ codebase at work (not FB/Meta) is clean integration with our preexisting Folly + libevent scheduler. IMO, this has become a common theme across most C++ libraries that involve async IO. Rust has the same problem to a lesser extent. I think it's going to become a fundamental problem in all languages that don't have a strong opinion on, or built-in, async and schedulers.

comment 3y ago · link · parent

this is bait.

comment 3y ago · link · parent

If I’m not mistaken, Cling is an LLVM-based JIT compiler, so it really should be performing close to the same level as an ahead-of-time Clang-compiled binary executable. Perhaps what you are noticing is JIT latency (from compiling on the fly.)

comment 3y ago · link · parent

“they would have done it by skipping the Dark Ages”

well, yes, since the “Dark Age” was just the aftermath of the collapse of Roman Imperial projection of military power and law and order... this phrase is a tautology.

comment 3y ago · link · parent

I always liked the idea of capnp, but it bothers me that what is ultimately a message encoding protocol has an opinion on how I should architect my server.

FWIW, gRPC certainly has this problem too, but it’s very clearly distinct from protobuf, although pb has gRPC-related features.

That entanglement makes me lean towards flatbuffers or even protobuf every time I weigh them against capnp, especially since it means that fb and pb have much simpler implementations, and I place great value on simplicity for both security and maintenance reasons.

I think the lack of good third-party language implementations speaks directly to the reasonability of that assessment. It also makes the bus factor and longevity story very poor. Simplicity rules.

comment 3y ago · link · parent

This is very 2023 brained tbh

comment 3y ago · link · parent

the good news is it's not going to succeed

comment 3y ago · link · parent

All I really want is GNU Pass with an IPFS backend.

comment 3y ago · link · parent

Yes, the first part is what I was going for. Actually it is even worse than that, because C++ has a more limited syntax. Rust's syntax and semantics must support more features. This fundamentally limits its accessibility.

comment 3y ago · link · parent

Lots of languages have tools which reimplement package management specifically for their libraries, and this pattern has become fairly "normal", but the traditional norm is to access and provide libraries as system packages via the system's package manager. With that in mind, things like Cargo become less magical and more redundant with other tools like Make.
1
5455565758