HNHacker News
TopNewBestAskShowJobs

friend-monoid

190 karma · joined April 2, 2017

submissionscomments
friend-monoid··on Ask HN: What does mastery look like in software engineering?
I think a better wording is “you can learn how to do it”; treading new waters is a daily task for software engineers.
friend-monoid··on Zig in 30 Minutes
Well, on the upside on the ‘for’ syntax, it allows you to say “for (objects) draw” instead of “for (object in objects) { draw(object); }”. So it’s not all bad.

Edit: also, the print stuff, I feel that’s in line with the Zig Zen - make the language simple to understand. Now the print function has a very clear type. Otherwise you need a “smart” print function (like Rust does with a macro or C does with varargs). Easier to understand, not easier to type.

friend-monoid··on Zig in 30 Minutes
Try compiling a program with nostd and nocore - try targeting a weird platform, like a small embedded device. You immediately find out how many hidden layers there are to Rust, it’s borderline annoying. Rust is an amazing language, but stuff like mem transmute and I don’t know - it’s been a while now - just trips you up. It’s possible that I just don’t “get” rust, but maybe that’s also the problem. Zig is so easy it’s hard to get wrong. Zig favours readability and understandability over everything else. I can easily grasp complex questions like “will this overflow my very limited call stack” in Zig - it’s harder in Rust (for me anyway).
friend-monoid··on Zig in 30 Minutes
I remember doing some basic IO using clib. There’s is a flag, like —link-clib or something. Then you can include header files as you would in C. I created a basic example a while ago doing some basic IO, epoll, timers, and linking in a C obj file, just to try out how to do embedded in zig. It’s really good.

Another upside with Zig coming from the embedded world is Zigs idea of doing async/await - since you define the building blocks yourself, it’s really easy to create an async/await-implementation e.g. on top of epoll, but for those times when your hacking on bare metal, you can just write an implementation which fits that particular hardware. It’s really, really good.

friend-monoid··on Fun with IP address parsing
This is neat but Im so disappointed by the chosen word list
friend-monoid··on MasterCard to stop processing payments on Pornhub, cites unlawful content
How do you know they dont do anything about it though? I’d wager they try
friend-monoid··on Zig 0.7.0 Release Notes
So stoked for Zig!
friend-monoid··on How we scale Live streaming for millions of viewers simultaneously
This would be really interesting if it had literally any details
friend-monoid··on Rejuvenating Autoconf
Also everyone uses package managers these days, and if you ever need to install a package manager manually, spending 2 seconds to specify the location of a certain library, or googling “cannot find -lpng”, doesn’t take much effort. The automatics of library finding is super complex and can really get in the way of package/repo maintainers. Today, it’s probably a better idea to optimise build systems to be used by people who understand how the relevant programming language finds libraries, and not to “help end users understand how to compile their code”.

Autoconf often does a good job in having some “—with-libX11=some-path” but sometimes people just do weird stuff with their packages.

But maybe I’m just butthurt from trying to package stuff to nixos and having too many “smart build tools” fail.

friend-monoid··on What ORMs Have Taught Me: Just Learn SQL (2014)
I’m interested in this because I have the opposite experience. Not saying any choice is wrong, but in my experience, moving that logic into the database has made all our codebases easier to reason about. The API’s don’t have to botch error handling due to “open transaction need to be ROLLBACKed”, I don’t have to worry about bad devs doing stuff non-atomically and putting the db in a bad state, and the code is easier to read because it’s just a single query that does “what it’s supposed to do”. The API usually ends up just being a small adapter for DB functions. It also makes sense to me because the “database API” (e.g. the database schema with some methods in it - the tables themselves are usually not in the same schema) describes the valid operations of the data, and can make sure the data is consistent. It also makes adding new APIs easier.
friend-monoid··on AWS CloudFormation now supports blue/green deployments for Amazon ECS
You can’t do EFS on Fargate in CloudFormation yet though.
friend-monoid··on Deploys at Slack
Link doesn’t work for me right now so I haven’t read the article, but usually beta testing precedes canary deploys. Maybe this is different.
friend-monoid··on Deploys at Slack
Seems reasonable to me? Better to deploy gradually in case the deploy is bad, right?
friend-monoid··on About Musl
But the kernel itself doesn’t use glibc?
friend-monoid··on Broot – A new way to see and navigate directory trees
I like it! It's a bit too slow on my machine, but I really have too many files, I need to clean up some of the crap I have lying around.
friend-monoid··on Unfork()
The inverse of fork is called join, right?
friend-monoid··on Be wary of functions which take several parameters of the same type
* Not all users have IDEs with all that much help (vim, emacs users come to mind), and not all platforms have this ability (consider for example writing serverless functions in an online IDE), and sometimes you do code reviews from an online platform or from your phone, and sometimes you just kinda pull up a piece of code in notepad, and I think you should be able to tell that the code is obviously correct in all of those cases.

* In C, the convention is "move(destination, source)". See memcpy, snprintf, strftime, others, but not all functions follow this convention. PHP is known for having lots of functions in standard library with differing conventions.

* It's easier to tell that "move(from=X, to=Y)" is correct than "move(X, Y)" though?

* I agree with the over-verbosity, but your last point that "annotating your arguments makes your code over-verbose and harder/slower to comprehend; instead, put all these guards and magic in the definition of the function" - isn't that also making your code harder/slower to comprehend, but this time you're putting the mindwork in understanding the function instead?

friend-monoid··on Be wary of functions which take several parameters of the same type
As C:

  struct copy_args_s {
    char * src;
    size_t src#;
    char * dest;
    size_t dest#;
  };
  int copy(struct copy_args_s args) {
    ...
  }
  int main() {
    copy((struct copy_args_s){ .src = "foo", .src_len = 3, .dst = "bar", .dst_len = 3 });
  }

Or with some macro magic:

  struct copy_args_s {
    char * src;
    size_t src#;
    char * dest;
    size_t dest#;
  };
  int copy(struct copy_args_s args) {
    ...
  }

  #define copy(...) copy((struct copy_args_s){__VA_ARGS__})

  int main() {
    copy(.src = "foo", .src_len = 3, .dst = "bar", .dst_len = 3);
  }
friend-monoid··on Dumbdown – A Tree Language that compiles to HTML
But... why?
friend-monoid··on Ask HN: What should a systems/low-level software engineer know?
Regular expressions isn’t the issue, it’s the libraries. Regular expressions are, mathematically, the quickest and safest way to parse text, and they are linear in complexity. But most libraries aren’t...
friend-monoid··on Ask HN: What should a systems/low-level software engineer know?
Been using ragel for a while now, it’s awesome. Ragel is a bit like the vim of parsing: the learning curve can be pretty steep, but once you get it, you’ll be the parser magician. Parsing in general just becomes pretty easy with ragel.
friend-monoid··on WebSub: Open protocol for distributed pub–sub communication on the internet
Except you don’t have an open connection where you receive messages on. Instead, you register a callback url. It’s more like webhooks, but it’s it’s own thing, and not a setting on a page.
friend-monoid··on WebSub: Open protocol for distributed pub–sub communication on the internet
XMPP is an open TCP connection with its own protocol, like MQTT, Stomp, Redis, NATS, and all the *MQs. WebSub is mostly between HTTP servers, where one server can tell another that it wants a specific HTTP URL to be GET’d on a message. Each message requires a new TCP connection. So it will not handle very many messages - but I don’t think that’s the point.
friend-monoid··on WebSub: Open protocol for distributed pub–sub communication on the internet
But we have the PATCH method, which is... Non-standard, I think? And it works fine.
friend-monoid··on WebSub: Open protocol for distributed pub–sub communication on the internet
1. Why not a SUB HTTP request? And a PUB http request. The response URL could be a required header.

2. We have HEAD, can we do service discovery using HEAD?

3. Why not let a topic be a HTTP URL? “PUB /user/john/position HTTP/1.1\r\ndata...”.

4. Subscription expiration as a way to force subscribers to renew and upon renew get redirected to other servers is pretty cool. NATS has a special message (the INFO message) to do the same, but you might be in the middle of an important request-reply session you don’t want to abort.

5. The authors could have made this protocol very “non-http-ish” by implementing what amounts to Redis but in HTTP. I’m glad they didn’t. This still feels like HTTP, which is great.

friend-monoid··on Introducing .app, a more secure home for apps on the web
It's a bidding war. Someone already bid 249.99 for "his.app". Next step up is 499.99. If you buy her.app for 249.99, then both will cost 499.99.
friend-monoid··on Show HN: HTTP/2 Python-Asyncio Web Microframework
Cool! Might try this for some smaller project. It's a shame that asyncio is so slow though, this framework isn't going to win any speed awards I guess.
friend-monoid··on Why SQLite Does Not Use Git
sha1 - object (e.g. 5a480efb...) file with sha1 - ref (e.g. master) file with ref - symbolic ref (e.g. HEAD)

right? Seeing as you can git update-ref branches, but you need to git symbolic-ref HEAD.

friend-monoid··on Why SQLite Does Not Use Git
Unless it is detached. :)
friend-monoid··on Why SQLite Does Not Use Git
Heh, good question.

But seriously, the fact that there is a .gitmodules file lulls you into a sense that that file is "the configuration file". If you don't know about these other files, then it's natural to edit .gitmodules. When you make errors, the fixing those errors are pretty hard. There is no "git submodule remove x" or "git submodule set-url" or "git submodule mv".

For example, do you know how, on the top of your head, to get an existing submodule to track a branch?

How do you think someone who does not quite understand git would do it? Even with a pretty ok understanding of git infernal, you can put yourself deep in the gutter. (case in point, if you enter the submodule directory and push head to a new commit, you can just "git add submodule-directory" to get point the submodule to the new commit. But if you were to change upstream url or branch or something else in the submodule, you're screwed. That's not intuitive by a long shot)

Edit: git submodule sync is not enough by the way... You can fuck up your repo like crazy even if you sync the two configuration files.

← PreviousPage 2 of 3Next →