Oh no. You said it. Now I gotta link to it. The spoof. I swore I saw him load it up by accident on stage one time. Reaction was priceless. I just can’t find that link.
Over the course of using only Go at work for the last year-ish, my opinion went from:
Go has some weird opinions and safety rails, but the advantages are still nice
to:
I love Go’s restrictiveness and can’t imagine any other way
Not sure if it’s stockholm syndrome by now but it’s definitely grown on me.
For example, I tried adapting some C++ code to Go last week, and the person was doing mystring[len(mystring)] and it worked with no out of bounds errors :(
From the onset I’ve been viewing Go as the better C I needed. It did take me time to get used to the fascist gofmt, though. Today I mostly have gripes with the standard library, debugging and trying to get away from thinking in the event loop model (that took me so much time to internalize). Still enjoying the language and the tools.
I think the fascism of gofmt is great. After using go for a while, I miss a similar tool for other languages. I get by with clang-format for C, but it requires quite a bit of configuration, and still doesn’t get some things right.
University finished, so I have a bunch of free time to work on personal projects. This week I’m continuing work on a container runtime built from scratch. So far it’s been fun playing with the various low level linux APIs (namespaces, cgroups, overlayfs etc). Right now it can pull and ‘boot’ docker images, but work needs to be done around populating /dev and using cgroups properly.
I don’t think this sort of thing is specific to JavaScript runtimes. Do you know what algorithm is used by the standard library sort function of $language?
Knowing the algorithm tells you the asymptotic behaviour but that can be surprisingly useless - the constant factors from e.g. cache usage patterns can easily end up being multiple orders of magnitude (and you simply can’t understand those without understanding the details of the hardware - reasoning about the abstract Haskell/Ruby machine won’t tell you anything)
Not personally. I would imagine that database implementations (including key-value stores) are the only software that needs to do this, these days. Knuth has an entire chapter on external sorts, optimized for different situations involving data that doesn’t fit in memory, but in the modern era we no longer write one-off storage backends with that level of complexity. I guess it’s nice to remember that computing can make real advancements sometimes…
I’ve occasionally had that case (constrained data, sorting is a bottleneck), though not often. The last time I remember it was when I was doing some stuff with the Netflix Prize dataset, which is a giant set of movie ratings, each of them an integer 1-5. For some machine learning algorithms (e.g. decision trees), sorting the data by an axis is a bottleneck. Although even in that case, careful fiddling with data representation to be more cache-friendly made a much bigger difference to my runtime than radix sort did.
You should probably test this before throwing out the stdlib sort, though.
These days most, if not all, standard libraries use smarter versions of quicksort to eliminate the O(n^2) case, or at least make it a lot harder to hit. A lot of them don’t even use quicksort any more, but other algorithms (like timsort) with similar performance and guaranteed worst case O(n log n) behavior.
I know python, my go-to language, uses timsort. Timsort is complex enough that I don’t really know what is is doing under the covers at any point in time, however.
Freeside/Milliways all week
Associated talk: https://streaming.media.ccc.de/asg2019/relive/164
Hmm, reminds me a bit of “Pizza Hut”, which isn’t necessarily the best association.
Oh?
I actually liked that it reminded me of Pizza Hut. Hey, hackers love pizza!
As an European, I can’t accept calling Pizza Hut’s produce “pizza”.
As an American, I can’t accept calling Pizza Hut’s pizza “produce”.
I got my sr.ht stickers in FOSDEM 4 days ago but I really want this now.
@kragniz We’re counting on you to make this happen next fosdem. :)
I’ll do my best
i love it
This is amazing, thanks
Yes, you can unsee.
When the iPad first came out, people thought it was a terrible name because of Maxi-pads.
Proof that you can get used to almost anything.
I to this day am amazed by the name, and cannot get used to it. I always try to call them iTablets.
Oh no. You said it. Now I gotta link to it. The spoof. I swore I saw him load it up by accident on stage one time. Reaction was priceless. I just can’t find that link.
What do you have against pizza?
Nothing, it’s just so-called american “pizzas” I dislike.
Italians love American pizza too!
That’s why it’s called the pizza effect!
https://en.wikipedia.org/wiki/Pizza_effect
You mean “creativity fuel”?
you fuck right off with that
Over the course of using only Go at work for the last year-ish, my opinion went from:
to:
Not sure if it’s stockholm syndrome by now but it’s definitely grown on me.
For example, I tried adapting some C++ code to Go last week, and the person was doing
mystring[len(mystring)]
and it worked with no out of bounds errors :(From the onset I’ve been viewing Go as the better C I needed. It did take me time to get used to the fascist gofmt, though. Today I mostly have gripes with the standard library, debugging and trying to get away from thinking in the event loop model (that took me so much time to internalize). Still enjoying the language and the tools.
The best thing about gofmt is that there is nothing you CAN configure. It’s the gofmt way or the highway.
I think the fascism of gofmt is great. After using go for a while, I miss a similar tool for other languages. I get by with
clang-format
for C, but it requires quite a bit of configuration, and still doesn’t get some things right.University finished, so I have a bunch of free time to work on personal projects. This week I’m continuing work on a container runtime built from scratch. So far it’s been fun playing with the various low level linux APIs (namespaces, cgroups, overlayfs etc). Right now it can pull and ‘boot’ docker images, but work needs to be done around populating
/dev
and using cgroups properly.Quick demo of pulling images: https://asciinema.org/a/08p212uouswkc8h7j1p9z46bj
Is it a problem that javascript engines are so complicated that understanding what your code actually does involves deep knowledge of the runtime?
I don’t think this sort of thing is specific to JavaScript runtimes. Do you know what algorithm is used by the standard library
sort
function of$language
?Knowing the algorithm tells you the asymptotic behaviour but that can be surprisingly useless - the constant factors from e.g. cache usage patterns can easily end up being multiple orders of magnitude (and you simply can’t understand those without understanding the details of the hardware - reasoning about the abstract Haskell/Ruby machine won’t tell you anything)
Have you ever switched to a custom sorting function because the one in your standard library was inappropriate?
Not personally. I would imagine that database implementations (including key-value stores) are the only software that needs to do this, these days. Knuth has an entire chapter on external sorts, optimized for different situations involving data that doesn’t fit in memory, but in the modern era we no longer write one-off storage backends with that level of complexity. I guess it’s nice to remember that computing can make real advancements sometimes…
If I know a sort is constrained somehow (i.e. a known interval of integers) I’ll use a radix sort or similar.
Radix sort is kinda amazing when one can get away with it. :)
O(n) sorting is so sweet but I’ve never hit the case where my data was simultaneously that constrained and sorting it was a bottleneck.
I’ve occasionally had that case (constrained data, sorting is a bottleneck), though not often. The last time I remember it was when I was doing some stuff with the Netflix Prize dataset, which is a giant set of movie ratings, each of them an integer 1-5. For some machine learning algorithms (e.g. decision trees), sorting the data by an axis is a bottleneck. Although even in that case, careful fiddling with data representation to be more cache-friendly made a much bigger difference to my runtime than radix sort did.
Yes. For suffix array construction, or when I require a stable sort and the standard library uses a non-stable sort.
The quadratic case can be easily avoided by using a non-dumb process to pick a pivot: random, median-of-three, etc.
The bigger problem with quicksort is usually that it’s not stable.
You should probably test this before throwing out the stdlib sort, though.
These days most, if not all, standard libraries use smarter versions of quicksort to eliminate the O(n^2) case, or at least make it a lot harder to hit. A lot of them don’t even use quicksort any more, but other algorithms (like timsort) with similar performance and guaranteed worst case O(n log n) behavior.
I know python, my go-to language, uses timsort. Timsort is complex enough that I don’t really know what is is doing under the covers at any point in time, however.
If you’re more into RestructuredText, there’s also presentty:
http://git.inaugust.com/cgit/presentty/