Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
barosl
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
16 ms
·
91.
▲
by
barosl
11y ago
Yup, I'm much in favor of using a constructor, or even a trait, if such a breakage can be problematic, because I believe types are part of an API (so they should have been opaque types in the beginning). But I now understand what an id
92.
▲
by
barosl
11y ago
Huh, I didn't know Go has a concept of implicit default value. In that aspect, zeroing out in struct literals also makes sense. However I would say that while default zero is better than garbage value, failing to compile is even better
93.
▲
by
barosl
11y ago
I understand that in the latter case, what fields are being assigned is clearer (albeit the former case can also adopt a similar order-based strategy). What I disagree is the "zeroing out" part. I don't want 0 or empty string
94.
▲
by
barosl
11y ago
type T struct { Foo string Bar int Qux string } t := T{"example", 123} // doesn't compile t := T{Foo: "example", Bar: 123} // OK I find this behavior somewhat s
95.
▲
by
barosl
11y ago
I'm mildly surprised, why isn't this a thing in Haskell? Can't it be easily added, considering an or pattern is trivially expanded to two (or more) patterns?
96.
▲
by
barosl
11y ago
> Stuff like doubly encoded URLs Could you elaborate on this? It sounds a bit scary. Does this mean that Rails tries to decode a URL several times until it can't be decoded? If so, isn't this problematic if some (arguably crazy
97.
▲
by
barosl
11y ago
Oh, yes. I had also tried that, but found some convenient features missing, e.g. line breaks treated as `<br>` (not two consecutive blank lines), GitHub-flavored tables, and the strikethrough syntax. I'll have to wait until the o
98.
▲
by
barosl
11y ago
Whenever someone writes bad things™ about some language, one of the language's fanboys shows up and starts nitpicking! Yes, now is the time! > Another bad part is Rust’s JSON handling. It badly needs macros which make things easier.
99.
▲
by
barosl
11y ago
I once experimented this, and it worked. I wanted to do this because I needed a decent and fast CommonMark library, but Rust didn't have one. (Yes, I tried to embed JavaScript in Rust just to parse some MarkDown text!) There are two li
100.
▲
by
barosl
11y ago
This is a nice summary! FWIW I'm more likely 1, as I've seen many people coming from dynamic languages being frustrated about the "Rust way". Not only the ownership model, but also compiling, optimization, etc. 3 is cert
101.
▲
by
barosl
11y ago
> In Python a function can fail with any error and there is nothing you can do about that. To be fair, the adorable `except:` black magic exists there to be used in such a case. Of course its use is extremely dangerous for obvious reason
102.
▲
by
barosl
11y ago
Days ago I saw a lightweight httpd written in C here, yesterday a C++ header-only httpd library caught my mind, and now an httpd in assembly. I'm curious what would come next...
103.
▲
by
barosl
11y ago
Sorry if my words were too strong. I said that because I like tools that do a particular job well. bash might be a middle ground tool that has moderately sane defaults and features. However, in other words, bash is inferior to fish with reg
104.
▲
by
barosl
11y ago
I definitely recommend fish to every newcomer to Unix. It has sane defaults, colorful output, and so many features that work out of the box. That said, there is a long-standing issue regarding inline environment variables.[1] Briefly speaki
105.
▲
by
barosl
11y ago
There's a wonderful presentation on this topic: https://www.youtube.com/watch?v=3CwJ0MH-4MA
106.
▲
by
barosl
11y ago
Two points: - Performance is important even for web applications. For example, after migrating to HHVM, Wikipedia could buy less servers, serve pages faster, and reduce latency.[1] Rust is fast, even compared to other statically compiled la
107.
▲
by
barosl
11y ago
That's funny, because I started hacking Rust just because the `~` sigil and friends were gone. :-) Before that, so many sigils in Rust scared me and kept me from learning it. Rust still has a bit many sigils nowadays, but it's def
108.
▲
by
barosl
11y ago
Isn't .NET Native comparable to Go? I mean, an ahead-of-time compiled, garbage collected language. Whereas both Rust and C++ don't have mandatory GC. That being said, I'm really excited to see a single binary .NET application
109.
▲
by
barosl
11y ago
In short, Node.js is discontinued, but io.js is renamed to Node.js? That sounds reasonable. I personally preferred the name of "iojs" to "node", but it's true that node's brand is more powerful...
110.
▲
by
barosl
11y ago
> the source of troubles is usually in humans, not technology And this is exactly the reason why Rust even exists. I find it amusing to see the author use it to defend the C++'s side.
111.
▲
by
barosl
11y ago
I would say that the reason it is named `enum` is exactly not to surprise them. While learning Haskell, I had used `data` several times, but never grokked its true meaning. The naming of `enum` in Rust helped me finally understand what AD
112.
▲
by
barosl
11y ago
That's interesting, what does "break" mean exactly? Does it stop compiling after GHC being upgraded? Or does it suffer from performance regression due to the changes of the optimizing strategy in GHC?
113.
▲
by
barosl
11y ago
While I like the overall Rust community, I'm a bit skeptical to this, because all the language communities I've seen claim to be friendly and helpful. There may be some difference in degree, though.
114.
▲
by
barosl
11y ago
Indeed! That's why I'm still not used to Haskell. While I can do simple things with the language, the abstractions made by the popular libraries written in Haskell require me to understand a certain concept to use them properly. H
115.
▲
by
barosl
11y ago
I understand your anxiety on the complexity of Rust. I wonder if there were a language that fixes exactly the pitfalls of C (e.g. sane string manipulation), without adding any high level concepts, but with memory safety. However, at the sam
116.
▲
by
barosl
11y ago
There have been some efforts to make Rust utilize the native Windows API instead of libc on Windows. While this is ongoing, the lack of experienced Windows developers participating the Rust project has been slowing down the progress. We
117.
▲
by
barosl
11y ago
Uh, yeah, same for me, but that's the "I don't want to indent these lines for now" situation that I mentioned above... Wasn't I clear about that? To me, regardless of the number of the key strokes needed, it's
118.
▲
by
barosl
11y ago
But then again, unfortunately, Python's significant whitespace makes automatic indentation hard, because there are some edge cases that an editor cannot extract the actual intention by the programmer well. For example, if there is a co
119.
▲
by
barosl
11y ago
I think adding generics to a stable language is actually a hard thing to do. There's more than "that's it". Rust has had many major and minor changes regarding generics solely, which has broken backward compatibility eac
120.
▲
by
barosl
11y ago
After hacking Rust, I got the feeling that generics are hard. They are so hard that a language should consider them from the beginning to fully take advantage of them. That might be the reason why the Go team says generics are hard to imple
More ›