HNHacker News
TopNewBestAskShowJobs

YorickPeterse

2,784 karma · joined March 29, 2011

Author of the Inko programming language, formerly a staff developer at GitLab.

Website: https://yorickpeterse.com

submissionscomments
YorickPeterse··on Scaling the GitLab database
Following that same logic you probably should stop using a lot of websites out there.
YorickPeterse··on Scaling the GitLab database
That sounds like the webpack development server was somehow started, which definitely is not required (or even recommended) for production setups.
YorickPeterse··on Scaling the GitLab database

    > and the glaring problem of "ruby doesnt scale well" is everpresent
GitLab has many performance problems (and many have been solved over the years), but Ruby has thus far not been one of them.
YorickPeterse··on Scaling the GitLab database
No, because it probably would have required a complete rewrite of GitLab to make it work.
YorickPeterse··on GitLab raises $20M Series C round led by GV
GitLab.com is not deployed using any automated CI software, instead it's deployed using https://gitlab.com/gitlab-org/takeoff. The problem here was an incorrect version set in Chef, resulting in it deploying an old version to the cluster.
YorickPeterse··on Scaling the GitLab database
Sorry for the late reply!

    > Why wait for all of the slave databases to be in sync? If at least one is in sync, 
    > can you get all database interactions in the application to the valid subset?
If queries fail on the replica we'll cycle through the available replicas until we have one that works. If we didn't wait for all to be in sync it could in theory be possible we'd retry our query on a host that does not yet have the data, though this would be very unlikely. So basically we're being a bit paranoid here.

    > Why escape the input and use string interpolation instead of a parameter?
Rails doesn't really provide an easy way of doing this unfortunately. That is, to run raw queries you'll use something like this:

    ActiveRecord::Base.connection.execute 'your query here'
This particular API doesn't support passing any parameters, so you have to resort to manually escaping data and using string interpolation.
YorickPeterse··on PostgreSQL 10 Released
Not so much a reason to not use it, but something to keep in mind: queries such as `SELECT COUNT(*)` tend to be a bit more expensive in PostgreSQL compared to MySQL/MariaDB. This doesn't necessarily mean they're always slower, but it's something you should take into account.

Another thing to take into account is that updating between minor versions (major versions per 10.x) is a bit tricky since IIRC the WAL format can change. This means that upgrading from e.g. 10.x to 11.0 requires you to either take your cluster offline, or use something like pg_logical. This is really my only complaint, but again it's not really a reason to _not_ use PostgreSQL.

YorickPeterse··on Gitlab 10.0 released
This depends on the amount of memory a Puma setup would use vs an equivalent Unicorn setup. Say you have determined you need e.g 10 Unicorn workers, each taking 300 MB. If you could handle the same traffic using 1 Puma process with 10 threads that means you just saved yourself ~2.7 GB of RAM.

It's entirely possible that a single Puma process may end up using more memory than a single Unicorn process, so the only way to know for certain is to measure the difference.

YorickPeterse··on The Lil License

    > Person as in a legal person. This includes entities like corporations,
    > organizations, representatives and so on:
    > http://legal-dictionary.thefreedictionary.com/person
This may be the case for US law ("person" including both individuals and organisations), but it might also not be the case for all countries across the world. For example, Dutch law seems to define "person" as the individual (e.g. you and me) and seems to use a separate term for legal entities and the likes. It's possible that in practise the two are considered the same but I haven't been able to find such an example.

Exactly because of this it's better to be explicit. For example, the MPL 2.0 explicitly defines this:

    > 1.1. "Contributor"
    >
    >      means each individual or legal entity that creates, contributes to the
    >      creation of, or owns Covered Software.
Here the term "contributor" is used, but the same could apply to the term "person".

    > It tries to. Any change contributed to the project grants permission to
    > incorporate that change under the same terms of the license, which
    > includes the patent grant.
The patent grant states that any patents owned by the author can be used by the software's users:

    > and including usage rights to any patents the authors may hold on it
However, nowhere is it stated that patents used for contributions automatically belong (or can be used by) the authors and can thus also be used by the users. Defining what "authors" means could clear things up, though you'll probably want to separate the definition from "contributors" since you probably don't want random "contributors" to also be an "author" (this could give them too much power for example).

Again the MPL 2.0 is a good example since it does cover this, albeit not in a single place and in a somewhat hard to grok way.

YorickPeterse··on The Lil License

    > Permission is hereby granted by the authors of this software, to any person
Person as in what, a natural person? What about non persons such as legal entities?

    > and including usage rights to any patents the authors may hold on it
So the license allows you to use any patents (held by the project author) included in the project, but it doesn't cover anything about patents used by contributors when submitting changes. OK...

    > Any modification to the software submitted to the authors may be incorporated into the software 
    > under the terms of this license.
May? That seems like something that should really be changed to "Any modification to the software submitted [...] will be incorporated into [...]" or something similar that _doesn't_ let people decide about this on the fly.

This license as a whole is rather vague, leaving a lot up to interpretation. This isn't something you want from the only thing that stands between you and a potential legal nightmare. Just use good existing licenses such as the MPL 2.0, Apache, GPL (or some flavour of it), or even the MIT license (though I would strongly recommend not using it without a CLA).

YorickPeterse··on Better Database Migrations in Postgres
For GitLab we have a somewhat special approach to allow us to perform zero downtime migrations. Basically we have two types of migrations:

1. Regular migrations (located in db/migrate)

2. Post-deployment migrations (located in db/post_migrate)

Post-deployment migrations are mostly used for removing things (e.g. columns) and correcting data (e.g. bad data caused by a bug for which we first need to deploy the code fix). The code for this is also super simple:

    # Just dump this in config/initializers
    unless ENV['SKIP_POST_DEPLOYMENT_MIGRATIONS']
      path = Rails.root.join('db', 'post_migrate').to_s

      Rails.application.config.paths['db/migrate'] << path
      ActiveRecord::Migrator.migrations_paths << path
    end
By default Rails will include both directories so running `rake db:migrate` will result in all migrations being executed as usual. By setting an environment flag you can opt-out of the post-deployment migrations. This allows us to deploy GitLab.com essentially as follows:

1. Deploy code to a deployment host (not used for requests and such)

2. Run migrations excluding the post-deployment ones

3. Deploy code everywhere

4. Re-run migrations, this time including the post-deployment migrations

We don't use anything like strong migrations, instead we just documented what requires downtime or not, how to work around that (and what methods to use), etc. Some more info on this can be found here:

* https://docs.gitlab.com/ee/development/what_requires_downtim...

* https://docs.gitlab.com/ee/update/README.html#upgrading-with...

* https://docs.gitlab.com/ee/development/post_deployment_migra...

YorickPeterse··on Candy Japan total sales cross $1M
In The Netherlands this would be quite expensive, though it depends a bit on what your insurance would cover. For example, my health insurance plan (covering just me, not a family of 3) costs around €110 / month ($130) but is a fairly basic plan and requires that I pay the first €300 myself (which is stupid if you ask me) per year, anything after that is covered.

You can get cheaper or more expensive plans depending on the amount of value you pay yourself (known as the "eigen risico" or "own risk"), but the cheapest I could find was around €80 / month.

YorickPeterse··on Writing parsers like it is 2017
Having written a parser generator myself (https://github.com/YorickPeterse/ruby-ll), plenty of handwritten parsers, and having mess with parsing combinators I concluded I really don't like parsing combinators. Perhaps this was due to the APIs of the libraries I worked with (e.g. Nom in Rust), but it just lead to incredibly verbose and hard to work with code.

Since writing recursive descent parsers is not that hard (at least if your grammar is LL(1), see https://github.com/YorickPeterse/inko/blob/a76a8c23f901c5b2a... for an example) I would personally go with this approach whenever possible.

Parser generators definitely have their use cases (and allow you to write a parser much faster), but error reporting is often tricky to get right.

YorickPeterse··on Lenovo ThinkPad X1 Carbon review
Oh, I missed the "s" part and looked up the specs of the regular T460.
YorickPeterse··on Lenovo ThinkPad X1 Carbon review
I've been using an X1 (3rd gen with the 4K display) for about 2 years now I think, and it's a great laptop for Linux. A full charge will last around 8 hours, maybe 9 or 10 if you turn of Chromium and WiFi (this all depends a bit on what you end up doing).

My only complaint is that I had my display replaced 3 (or maybe already 4) times either due to dead pixels, or these white smudges on the screen (these appear to be caused by damage to the LCD). These smudges in particular keep popping up and aren't too uncommon amongst other users either. There's a new one since I last had my screen replaced, but it's fortunately only visible when looking down on the laptop from the top (even then it's hard to see).

YorickPeterse··on Lenovo ThinkPad X1 Carbon review
Let's not forget to mention a somewhat important detail: the T460 weights about 1.7 kg, while the X1 only weights about 1.1 kg. It's not a huge difference, but having a lightweight laptop is a big plus when carrying it around all day.
YorickPeterse··on The Odin Project – Learn Web Development for Free

    I question starting people on Ruby for web development.
Heavens forbid using a popular, practical language combined with a mature and even more popular web framework.

    Anyone starting web development now would do well to stick with Javascript.
Yes, let's recommend people to use a language where the things they learn (to use) stop being maintained/used/relevant 1 month later.

    And you can always use that on the backend if you have to
You can use Ruby in the frontend as well: http://opalrb.org/

    and if you need to spend time learning something for the backend part you'd be better 
    served learning about relational databases than Ruby.
What? Learning Ruby doesn't somehow mean you can't learn about relational databases.

When learning/teaching something you very much want to pick something that:

1. Has been around for at least 5 years

2. Is actively used, maintained, and overall has proven itself

3. Has good documentation and tooling

4. Perhaps has programs to help people getting started (Rails Girls, PyLadies, etc)

5. Is still around 5 years from now

Ruby and Rails are a perfect choice for this, though Rails (just like most frameworks out there) _is_ a bit complex for total beginners.

YorickPeterse··on Pass: A standard Unix password manager
This shouldn't really be an issue if you're using full disk encryption.
YorickPeterse··on How Discord Scaled Elixir to 5M Concurrent Users
While you don't need language X to scale, certain languages can definitely make it _easier_ and more cost-effective to scale. So it can matter depending on what you're trying to achieve.
YorickPeterse··on How I didn't become a SoundClouder
Typically in the EU (or at least here in The Netherlands) you can be fired on the spot (without a notice ahead of time) in the first month (usually referred to as a "trial month"). I suspect this is what SoundCloud took advantage of.
YorickPeterse··on Antisocial Coding: My Year at GitHub

    > What would a "professional and politically neutral as possible" company, in your definition, do in this case?
* "Male"

* "Female"

* "Other (feel free to specify in the text field below)"

Or something along those lines, it's not that hard.

YorickPeterse··on My list of JavaScript interview questions
To be honest none of these questions really give any insight into the skills/experience of the applicant as most of them come down to just reciting Wikipedia entries. If you want to get a better understanding of the applicant, try asking them to solve simple problems relevant to the position instead of performing a pop quiz.

In case of Javascript such a question could be:

    Users are reporting that page X takes a long time to load. How would you go
    about finding out why this page takes long to load and where time is being
    spent? What are the benefits and drawbacks of your approach, and what are
    the alternatives?"
The phrasing is just an example, but the idea is to:

1. Propose a problem that one can solve in e.g. 5-10 minutes

2. Ask them to think about the problem, their approach, benefits, drawbacks, etc

3. Have them deal with a problem that's actually relevant to the position, giving the applicant a better taste of what it's like to work at the organisation

YorickPeterse··on How to Interview Engineers

    > it be weird to take a week off just to work for another company
It's not even weird, it's just downright insane. No person should be expected to essentially work for free for a week without any guarantees they will get anything out of it.
YorickPeterse··on How to Interview Engineers

    > I can't imagine finding a new programming job while still working at the old job.
Imagine having things such as: a family, a car, a mortgage, bills, etc.

Giving up a job (therefore your income) just to find another job is not an option for many.

YorickPeterse··on Inside D's GC
One simple "solution" is to not implement evacuation, thereby not moving objects. In my opinion this somewhat defeats the purpose of using Immix, but some projects decided to take this route (e.g. Rubinius has/had an Immix GC but never implemented evacuation if I'm not mistaken).
YorickPeterse··on Get started making music
I played around with this a while back and there are Vim plugins for it. My biggest problem was having to compile the thing from source which involved also compiling a custom version of LLVM, which took forever. It's possible this is no longer a problem.
YorickPeterse··on Ask HN: Who is hiring? (May 2017)
We're also hiring database specialists! So if you like working with PostgreSQL, Ruby, and Rails you should definitely check out https://about.gitlab.com/jobs/specialist/database/
YorickPeterse··on Why I will not exercise my GitLab stock options
It's just a mirror nowadays. In the past we used to accept merge requests via this mirror as well.
YorickPeterse··on Why I will not exercise my GitLab stock options
This is not the case. When firing somebody there are two options you have as an employer:

1. Fire them the usual way, in this case there is a termination period (usually 1 month).

2. Fire them on the spot. This is possible, but usually only done if an employee violated a contract agreement, harassed somebody, or basically committed some kind of serious offence.

This only applies to those employed in The Netherlands, other countries may have other rules.

More information: https://www.rijksoverheid.nl/onderwerpen/ontslag/vraag-en-an...

YorickPeterse··on How is team-member-1 doing?
We are considering using S4 (http://www.supersimplestorageservice.com/), it's probably the best place to store your important data.
← PreviousPage 11 of 14Next →