Live data from Hacker News

Tor in a safer language: Network team update from Amsterdam

lists.torproject.org

201–210 of 254 posts

Re: Tor in a safer language: Network team update from Amsterdam

#201

Earlier quoted context omitted.

Like you, I am also down with OTP (yeah u kno me) and thats why I have to come to you with a harsh message of love: You've been bamboozled. {ok, u_no_me, {down_with, init, [State, Mod, OtherMod, Pid, SomeImportantRefIforget]}, {permanent, brutal_kill, 10000, 9999, 100000, 5, worker} Is not a genius language construct of a faraway Alien race. It's not elite. It's not even Swedish. It's just limited and unclear. (there…

I do pay attention to it. I actually host an Elixir meetup out of my own pocket... going on 2 years now. I'm ~$3000 into a labor of love helping people learn and be exposed to Elixir's various features and help them make sense of its Erlang underpinnings. Having used both Erlang and Elixir "in anger" there are a whole bunch of things that bug me about Erlang. There are a whole bunch of things that bug me about Elixir…

[deleted]

Re: Tor in a safer language: Network team update from Amsterdam

#202

Earlier quoted context omitted.

No matter how smart you are (or think you are), or how much state you can store in your head at once, if you remove some of the mental overhead of a language, then you have more time to think about other things. It's not about people needing to "dumb down" anything, it's about having a bit less mental overhead, meaning you can get a bit more done a bit easier.

No matter how smart you are (or think you are), or how much state you can store in your head at once, if you remove some of the mental overhead of a language, then you have more time to think about other things. So you use a language that makes specifying ownership (and immutability hard)? I always feel Go adds a lot of mental overhead. E.g., if you have a method that returns, say, a float32 slice. 1. If I return a s…

I agree that mutability constraints are a major weakness of Go. Interestingly, they did make string immutable and added []byte as a mutable alternative. It's unfortunate that string and []byte are so similar and yet it's impossible to treat a []byte as a string without copying (with the exception of looping over runes). This leads to massive code duplication and/or lack of functionality (byteconv where are you??). Just look at the strings, strconv and bytes packages. This whole area of the language is messy.

The funny thing about Go is that it makes up for its long list of weaknesses with essentially one single strength. You can actually read other people's code without much introduction to the concepts used in that codebase, because the number of possible meanings of any particular expression is much smaller than in other languages.

There is so much talk about Go being for dumb, second rate, corporate developers, because that's what Pike essentially said at one point (perhaps without thinking first).

But in fact, it's not the developers who are dumb. It's the process by which large corporations employ and dispose of developers. They are thrown into some project and expected to "hit the ground running". There's no time for explanation. So what they do is read code to acquaint themselves with the codebase and hopefully become productive before they move on to the next job. And that is the one task where Go really shines. Reading arbitrary pieces of code.

Of course powerful abstraction features eventually make reading code easier as well, but only after having learned the abstractions created for that particular problem and codebase and only if those abstractions are very carefully crafted.

Powerful language features help writers of code long before they help readers. And that, I believe, is essentially the dirty secret that Go exploits.

We all want to be brilliant writers of code when in fact we are often readers poking helplessly at half understood code to make something happen. We even forget our own abstractions once we haven't looked at them for a couple of months or even weeks.

The problem with Go is that it not only acknowledges this state of affairs, it also enshrines it.

Re: Tor in a safer language: Network team update from Amsterdam

#203
post #72

Earlier quoted context omitted.

So was Erlang. The language, the runtime, and the standard library were all purpose-built together to solve a real world problem... to build fault-tolerant, distributed network applications. Which makes Go's rapid popularity as a language for solving the same problem even more peculiar. Especially since Go's surrounding tracing, debugging, and online code swapping facilities are so much worse. I'm sure some component…

Golang is simpler java, and that is it's target. It even has the same perf profile as java. Erlang does have a worse perf profile.

Golang performance profile is very different from Java. It's speed is closer to C++, garbage collection optimized for latency, not bandwidth, very low startup time comparable with typical native code.

Re: Tor in a safer language: Network team update from Amsterdam

#204
post #74

Not sure why Ada is not taking off these days. It is mature and has all the safety and concurrency bells and whistles: http://www.adacore.com/uploads_gems/07_safe_secure_ada_2005_... https://en.wikibooks.org/wiki/Ada_Programming/Tasking http://courses.cs.vt.edu/cs5204/sp99/Overheads/6UP/6UPCSPand...

I looked into Ada last year. Getting a toolchain working sanely on a Mac seemed quite a lot of work; it's not in Homebrew, the MacPorts version has some weird bootstrap process, and the various random versions available for download had a murky mix of license and implementation issues that i don't remember in detail. So i read documentation instead. Ada mostly seems like a pretty sensible language. Its story on memor…

Ada allows to return from a function a stack-allocated array of runtime-dependent size. This alone removes wast number of cases when one needs to allocate memory dynamicalky in C/C++.

I always puzzled why even C++ does not provide any facilities like that out of the box.

Re: Tor in a safer language: Network team update from Amsterdam

#205
post #155

Earlier quoted context omitted.

I've... never had a problem reading Rust code. It's generally well-typed, and makes good use of "automatic" error handling constructs to ensure errors flow upwards without visually polluting the success case. Whereas with Go code, I have to filter out all the error handling (which often takes up 2/3rds of lines of code, even when it's just "if there's an error, return the error" which it almost always is), wade throu…

My problems with the readability of Rust is related to the syntax and not so much about the code structure. For example, Smalltalk has the most readable syntax I know, while I find it's code structure average. I know that error handling in Go can be tedious, but to some extent, it is also the programmer's job to utilize the features of the language to write clean code: https://blog.golang.org/errors-are-values Regard…

I tend to find that Rust's syntax warts are primarily in function headers (primarily due to lifetimes), and less so in the bodies.

> Regarding your type problem I find very few cases where I need an empty interface (mainly container types).

I've run into the issue with quite a few "generic" libraries, since Go doesn't have a generics system. For example, https://github.com/manyminds/api2go requires a few of them in common cases.

My alternative is writing the same code over and over, and hoping that I've not missed something in one instance of it.

Re: Tor in a safer language: Network team update from Amsterdam

#206

As a mere average user of computer languages, every time I play around with Go I start wondering how a language like this became so popular. It feels like it was invented in a universe where Haskell, OCaml, Erlang, Smalltalk, Lisp and so many more languages and research in languages never happened.

Don't frame the question as language X vs language Y. Think about the ecosystems instead. Golang provides a batteries included API that allows developers to rely less on third party libraries with shaky SLAs, a promise of version stability, and great tooling that has increased consistency of coding styles across projects. It's a simple language with a a low barrier to entry, and the Google brand encouraged earlier ad…

From the perspective of a user, you make some sense. From the perspective of a language designer however, great ecosystems are no excuse for crappy languages.

The Go language doesn't have to be crappy to provide batteries included API, version stability, and great tooling. No generics and no sum types? Those are no longer groundbreaking, they're the bare minimum.

Old languages like C at least had the excuse of being created a long time ago, when we possibly didn't know better (and computers were much slower). Go's creators however don't have that excuse. They screwed up, plain and simple.

Re: Tor in a safer language: Network team update from Amsterdam

#207

Earlier quoted context omitted.

No matter how smart you are (or think you are), or how much state you can store in your head at once, if you remove some of the mental overhead of a language, then you have more time to think about other things. So you use a language that makes specifying ownership (and immutability hard)? I always feel Go adds a lot of mental overhead. E.g., if you have a method that returns, say, a float32 slice. 1. If I return a s…

I agree that mutability constraints are a major weakness of Go. Interestingly, they did make string immutable and added []byte as a mutable alternative. It's unfortunate that string and []byte are so similar and yet it's impossible to treat a []byte as a string without copying (with the exception of looping over runes). This leads to massive code duplication and/or lack of functionality (byteconv where are you??). Ju…

There's no time for explanation. So what they do is read code to acquaint themselves with the codebase and hopefully become productive before they move on to the next job. And that is the one task where Go really shines. Reading arbitrary pieces of code.

Definitely. This really shines in the standard library, it consists of extremely readable code and is a good way to get up to speed on canonical Go.

We all want to be brilliant writers of code when in fact we are often readers poking helplessly at half understood code to make something happen. We even forget our own abstractions once we haven't looked at them for a couple of months or even weeks.

Definitely, but what are we comparing to? I would agree that e.g. C++ and Haskell have this property. Unless you understand the language and commonly-used abstractions, template-heavy C++ code is difficult to read. However, there are many languages that have more powerful type systems than Go, but where code is still easy to read (ML, Object Pascal, Oberon, Ada, etc.).

Re: Tor in a safer language: Network team update from Amsterdam

#208

Earlier quoted context omitted.

Finalizers help with memory management in the simple cases.

But C code may not keep a Go pointer that persists between calls (because GC). I can imagine that this is a problem for gradually converting code bases.

Sure but that's not what I was replying to? I was only talking about Go->C FFI. If someone didn't know about finalizers, then I've might be trying to insert `free` calls everywhere in their Go code, which could become quite annoying.

But yes, Go pointers in C code is bad juju.

Re: Tor in a safer language: Network team update from Amsterdam

#209
post #188

Earlier quoted context omitted.

Erlang, sure. Maybe a few. But Haskell? I doubt there are many. I bet Go's use in industry is easily 100 times that of Haskell's already and it is much younger.

Galois, Facebook and Microsoft are some examples, and all ML derived languages tend to be used for data modelling in the financial sector. https://wiki.haskell.org/Haskell_in_industry https://ocaml.org/learn/companies.html

It seems wrong to call Facebook and Microsoft "built on" Haskell, even if they are using it effectively for some important things.

Galois, of course, is very much built on Haskell. And there are certainly other examples.

Re: Tor in a safer language: Network team update from Amsterdam

#210
post #127
post #100

Earlier quoted context omitted.

When you talk about Go I think you should start with C. One of my professors used to tell us, that C was built by people who wanted to use it and didn't care about academic style. In many ways Go is just the next step of C. C did not have object orientation and even passing functions around was kinda hard. While C++ tried to bring object orientation to C (total failure) Go decided to keep the core values of C and ins…

I wish people understood this better. I'm not a Go programmer, but I have a lot of respect for it. If you're wondering "why Go"? Think of it as a modern version of C, at a slightly higher level, developed by the same people for slightly higher-level tasks. They made C for low-level stuff, and then picked up with Go for higher-level stuff. It's like C+. C has been very successful in part because it's so simple in cert…

> It's like C+

That's perfect.

Post reply on HN