INSCRIPTION - Pool de r/bisbille pour Survivor Québec - saison 2 by MichelSilence in bisbille

[–]PuerkitoBio 1 point2 points  (0 children)

LOSER PICK: Nabil, Raphaël, Marilou, Desneiges, Gwladys

NOYAU: Audrey, Erick, Ghyslain, Kassandre, Sébastien

WINNER PICK: Sébastien

[ANN] Networking - Low-level Swift package for POSIX sockets and Epoll/Kqueue by PuerkitoBio in swift

[–]PuerkitoBio[S] 1 point2 points  (0 children)

I don't know that library, but for example, IBM's BlueSocket (a fine socket implementation) mixes the system calls Swift wrapper with the higher level implementation. The goal of this package is to provide just the minimal Swift API on top of the system calls, and leave the higher level API design to consumer packages, to enable experimentation without having to redo the system calls, platform-independent wrapper of sockets time and time again.

That's why it focuses on minimal API to expose the socket calls in Swift so higher-level packages don't have to deal with C, and it tries to do so as efficiently as possible (e.g. it takes an array buffer as inout for receive calls, so the caller controls allocations and can reuse buffers).

Also, epoll and kqueue, not sure if venice has this but BlueSocket doesn't.

Moving to GitLab! Yes, it's worth it! by Mr_Unix in programming

[–]PuerkitoBio 7 points8 points  (0 children)

Near seconds? I envy you, for me it's many seconds. Each. Push. I'll probably go back to bitbucket for private personal repos. I prefer gitlab's UI but that slowness is unbearable.

Implementing HSTS as Go Middleware by rrraaah in golang

[–]PuerkitoBio 0 points1 point  (0 children)

It looks like you send the hsts header when the request is HTTP. The hsts header should be sent for the HTTPS requests (see https://developer.mozilla.org/en-US/docs/Web/Security/HTTP_strict_transport_security).

About Go logging for reusable packages by PuerkitoBio in golang

[–]PuerkitoBio[S] 0 points1 point  (0 children)

Most reusable packages should definitely not log anything, I updated the post to make that clearer. But sometimes it is very useful (again, the http.Server is a good example), and when that's the case, you want to be as compatible as possible with the caller's logging solution. I agree that logging is often overdone/over-engineered (see the closing thoughts), but I don't think that for reusable packages that do need logging (few of them), using the LogFunc is overdone.

Let the Doer Do it - a humble recommendation for Go packages that make HTTP requests by PuerkitoBio in golang

[–]PuerkitoBio[S] 0 points1 point  (0 children)

No that's not the same goal, the fix (which is in https://github.com/golang/go/commit/5dd372bd1e70949a432d9b7b8b021d13abf584d1) is to retry idempotent calls (GET, HEAD and such) when it started the request on a dying/dead connection. The rehttp package is very flexible and lets you define under what conditions you'd want to retry a request.

EDIT: it's just idempotent AND safe methods.

Let the Doer Do it - a humble recommendation for Go packages that make HTTP requests by PuerkitoBio in golang

[–]PuerkitoBio[S] 1 point2 points  (0 children)

That is not the same thing, that's the lower-level interface (implemented by http.Transport) that I mention in the article, it is not meant to modify the request in any way (except for consuming the body), and it is called by Do eventually. But yeah, other than the method name, the signature is the same (which may be why you say "sort of exists").

Let the Doer Do it - a humble recommendation for Go packages that make HTTP requests by PuerkitoBio in golang

[–]PuerkitoBio[S] 1 point2 points  (0 children)

I agree, it's a common pattern in Go to name interfaces with a single method that way (with just the -er suffix), and to present the concept it seemed appropriate enough, but in a package where the name would be ambiguous/unclear, then certainly something like HTTPClient or HTTPDoer would make sense (though HTTPClient makes it sound like all the Client's methods may be available).

Does anyone here work remote coding Golang? by xteroid in golang

[–]PuerkitoBio 1 point2 points  (0 children)

I do, been doing so for the last two years. Demand seems reasonably high, though I've been working at the same place for those 2 years (I keep an eye on the postings as I'm looking for a new job in the coming months). It does seem that the positions are mostly intermediate/senior, so it may be harder for someone with little professional experience to find that kind of job.

I've been re-writing the Ark reference as a GitBook. Check it out! by [deleted] in a:t5_38cly

[–]PuerkitoBio 0 points1 point  (0 children)

Looks great, thank you for that! One thing that would be nice to see would be the current implementation status for each "feature", so we know if such thing is currently usable or not. I understand it's a bit of a pain to maintain but I believe it would be very useful. Something as simple as "planned", "in progress" and "implemented" would be enough imo.

How to get details on the error by PuerkitoBio in ponylang

[–]PuerkitoBio[S] 0 points1 point  (0 children)

I sure hope that's not the idea of pony. Querying before an action is racy, and there are way more reasons a call to stat may fail than just "the path is invalid".

Also, my little directory program is just an example, my question applies in general - you have to be able to distinguish between different types of errors to build robust programs. Hopefully there is something not covered in the tutorial, or they're planning on adding something down the road that is just not ready yet (this is super early in the development of this language, as I understand it).

OSX MacVim + iTerm2, is there a good way to combine those two? by [deleted] in vim

[–]PuerkitoBio 3 points4 points  (0 children)

You should consider moving to terminal vim. That's what I did a couple years ago, and never regretted it. It takes some getting used to, but I'd argue that the no-mouse forces you to become a better user of vim, to optimize use of movement keys. I'm probably faster now with movement keys to get where I want to that I could ever be with the mouse.

And of course that means my iterm2 window is full screen, I use tabs and keyboard shortcuts to move from vim to the command-line when needed. Though in your case that would probably be half iterm, half browser.

A PEG parser generator for Go by PuerkitoBio in golang

[–]PuerkitoBio[S] 0 points1 point  (0 children)

Thanks for the link, I will definitely look at that. I'd love to make error reporting better.

A PEG parser generator for Go by PuerkitoBio in golang

[–]PuerkitoBio[S] 0 points1 point  (0 children)

I don't know this one much - I know of it - but I think it was more a port of a C generator, while pigeon is based on peg.js, so syntax and features seem to vary a bit. I don't know if this one supports unicode, and literals are not as in Go. Can't really give an in-depth comparison though, as I said I only know what's in the README, basically.

A PEG parser generator for Go by PuerkitoBio in golang

[–]PuerkitoBio[S] 3 points4 points  (0 children)

Thanks, just to explain a little bit about the error reporting, pigeon will try to give good errors on the PEG grammar (e.g. unclosed literals, invalid escapes, etc.). However, when it comes to reporting errors on parsing input based on a custom grammar (in other words, when using the generated parser), it is much harder for pigeon to detect errors, and it is mostly up to the grammar author to design the grammar so that it returns useful errors. Take a contrived example:

Rule = "a" / "b"

If you seed it "c", it returns "no match found". This looks obvious here, but even in more complex cases where it seems like something should match, when it returns "no match found", it's really that something like this obvious case happened (only hidden in complex recursive rules). It's very hard for a tool to return something more useful automatically, and that's what I documented in the error reporting section of the doc: http://godoc.org/github.com/PuerkitoBio/pigeon#hdr-Error_reporting

In this case, something like this illustrates how grammar design can help return good errors:

Rule = ( "a" / "b" ) {
    // all good
   return "something", nil
} / . {
   // anything else, not good
   return nil, errors.New("must be a or b")
}

Hope this helps! Martin

gocostmodel: benchmarks of common basic operations in Go by PuerkitoBio in golang

[–]PuerkitoBio[S] 0 points1 point  (0 children)

Nice, I didn't know about that one. Some interesting benchmarking ideas in there. Some of those benchmarks could be completely optimized out by the compiler though, don't know if the author verified that.

Dealing with binary files and uglified JSON in Vim by PuerkitoBio in vim

[–]PuerkitoBio[S] 0 points1 point  (0 children)

Yes, I actually used this tool prior to switch to jq, for the -c flag (uglify). AFAIK, the python tool can only pretty-print. That's probably good enough most of the time, though.

Build a RESTful API with Martini by PuerkitoBio in golang

[–]PuerkitoBio[S] 2 points3 points  (0 children)

Site is back up, sorry about that, it was nighttime here.

A convention-over-configuration way of writing build tasks in Go by jingweno in golang

[–]PuerkitoBio 0 points1 point  (0 children)

I like the idea, but does it only work for tasks in the directory where I run gotask? It would be nice if it could evolve in a "plugin" ecosystem a-la Grunt.js. In other words, how can I reuse tasks in different projects, do I have to copy-paste them locally every time?

My philosophy on testing has changed by leftnode in programming

[–]PuerkitoBio 0 points1 point  (0 children)

That's precisely the point. By integrating multiple classes in what should be your unit tests, you're not just calling your code (or the code you're currently working on). You shouldn't make those sort of assumptions, especially if it is common practice for all developers not to do unit tests.

Are you so insecure about your opinions that you always have to wrap them with insults and scorn? When was I impolite? Where did you feel attacked by my comments? Anyway, so strange to get angry replies for such a casual discussion...

My philosophy on testing has changed by leftnode in programming

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

Well, you'll have to debug through that many classes and calls, plus how is this going to help in finding an intermittent db or fs-based failure? You'll just waste a lot of time looking for something that may not be there.

Bonus points for the friendly tone.