HN user

identity0

514 karma
Posts4
Comments112
View on HN

SVG is still a stupid format. Who wants to send image data through XML? It would be like sending a raster image through a big JSON array.

There are two main solutions: Use an option or maybe type or Use a nullable type

I don't get it. These are literally all exactly the same thing, all slightly varying in ergonomics and compiler support. They may differ slightly but to call them two different categories of solution is just creating a false dichotomy for yourself.

However, the type system is a little more flexible than with option types. The type system understands that a union type is a supertype of its branches. In other words, int is a subtype of int?. That means we can pass a definitely-present-integer to something that expects a maybe-present-integer since that’s safe to do.

You can do that in Swift, despite being placed as an example of "Solution 1".

The short answer is that, yes, it is entirely possible to live without null, and languages like Rust do.

If you can call say that Swift has "null", then you can equally say that Rust has "null"--it's called "None". The only way "None" and "null" from other languages differ is in built-in compiler support.

Areweyet 6 years ago

When I click a link, I want to know where I'm going. Where do you think "arewesmoothyet.com" will take you? If you guessed some Mozilla related thing purely from context, well you're also wrong. It's actually some WFH/affiliate marketing course. This was my point; domains are expensive and temporary for people who don't care. Because of this stupid joke, people actually interested in "Firefox Nightly hang telemetry visualization" or whatever have nowhere to go. One wiki, one page per topic, is all you need.

Areweyet 6 years ago

What a waste of domain space (yes, I know they're abundant, but still.) areweaudioyet.com says nothing about its contents. areweasyncyet.rs had the right idea with the .rs domain name, but anyways, I feel like all of these would be better organized on one wiki, with one list for each category. Easier to search, edit, and hyperlink.

The top pattern is extremely common so comments are somewhat unnecessary since everyone would know what you're doing. In the second one, comments would be less necessary with a type annotation and perhaps a better name. Maybe "next_ptr" instead of "indirect"---all pointers are indirection, so that name is redundant. But the comments are necessary, to me at least.

I wish more languages gave us a "|>" operator. Too many languages settle with dot notation, which confuses encapsulation/method calling with syntactical convenience.

Agreed. It's not a "foreign" function if everything is in WASM. All the VM sees is WASM code; it doesn't make a difference if it was originally written in C or Rust.

Have you ever seen a procedural language with a good REPL? Python maybe, but definitely no compiled procedural garbage-collectorless language. The "needing to put type signatures" is completely unrelated. I have no idea how that would stop Rust from being good in a REPL.

You mean like a REPL? Most languages are unusable for interactive programming. And it's not a downside if it stops use in a domain that was nobody's goal.

I have never seen a well-made but general solution beat a well-made and specific solution for one problem, in complexity or run time, ever. This is very true with allocators. A lot of the time people will just use 'malloc' without any thought into what they're actually allocating. For example, if you only allocate/deallocate from one thread, jemalloc is already way overblown in complexity.

Rust 1.48 6 years ago

In vim if you press K it will bring up the man page for the word under your cursor. It was very useful when learning C, considering that most libc functions have helpful man pages.

Best aspects of C 6 years ago

It's not that GNU is incompetent or overly bureaucratic or anything. It's that they really didn't want to infringe on Unix, and they presumed that Unix's yes would have been implemented in the most obvious, dead-simple way. And, as a plus, GNU yes can stream y's at like 10 GB/s, if you need that.

Hemingway Editor 6 years ago

This is why grammar is not optional. I have no clue what you said or are trying to convey. Yeah english is flexible, but that doesn't mean you can just drop articles and sentence structure.

Hemingway Editor 6 years ago

And that's why I don't like this concept. Let's be honest, that passage sounds like crap. I'm all for brevity, and I think nowadays people tend to write with too much formality and bureaucracy, but this app is not the way to go about fixing the problem. Arbitrarily capping sentences to ~20 words (I assume that's what they do) makes your writing really choppy and more verbose, ironically. That last paragraph probably could have been just 1 long yet focused sentence.

Not sure what your point is.

1. Because it's healthy and feels good

2. Because it's healthy and may stop future problems

3. Because it may stop future problems

4. Because it feels good

So why lose weight for the sake of losing weight? It's neither healthy nor fun if you do it the wrong way.