Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
someone_19
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
someone_19
9d ago
> The whole point of abstraction is that the implementation details aren't known. I disagree with that phrasing; it is better to say that abstractions allow a programmer to ignore unimportant details. For example, when developing tw
2.
▲
by
someone_19
10d ago
> Assembly (which is faster than anything in the same sense: for any program in any language, there exists and Assembly program that's at least as fast) At least you aren't claiming that the JVM is ~1.5 faster than perfectly wr
3.
▲
by
someone_19
10d ago
> I have seen it mentioned everywhere, but is this actually true? Yes, it just adding or subtraction int to stack pointer register. I’m not certain, but the only thing that might be faster is accessing data at a fixed address - that is,
4.
▲
by
someone_19
11d ago
Thank you for the reply. Do you mind a reasoned discussion? > A JIT with speculative optimisation and a moving GC. Idiomatic Rust, through its concepts of ownership and borrowing, encourages a pattern where you receive data as an argumen
5.
▲
by
someone_19
11d ago
> because of essential constraints of low-level languages that prevent them from doing certain optimisations that matter mostly in large programs Which specific optimizations are you referring to? In my experience, this is largely a myth
6.
▲
by
someone_19
4mo ago
Ada is the lost knowledge of a past, more advanced civilization.
7.
▲
by
someone_19
4mo ago
> No, you’re clearly wrong; golang was always going to add support for generic functions. Let's get this straight. I'll give you a long quote from Rob Pike's article where he describes the history of the go language: "
8.
▲
by
someone_19
4mo ago
You already have iota. Type safety is not needed by design: > Go intentionally has a weak type system... Go in general encourages programming by writing code rather than programming by writing types... https://github.com/
9.
▲
by
someone_19
4mo ago
...and Java didn't even have basic enums or sum types from the beginning. But it had null. They added enums, they added sealed classes. They're trying to get rid of null (apparently it's really hard). The problem is that in 2
10.
▲
by
someone_19
4mo ago
So you mean to say that PHP5 and Js from 2007 had a well-founded design?
11.
▲
by
someone_19
4mo ago
I agree that they were clearly not in a hurry. I disagree that they are doing everything right. I am interested to see how they will fix the 'million dollars mistake'.
12.
▲
by
someone_19
4mo ago
Indeed, in 2012, it was not clear to anyone that generics were needed /s
13.
▲
by
someone_19
7mo ago
> but the good parts of JS are better than anything else in existence What you talking about?! I can't think of a single thing in Js that I could say is good. Okay, two big corporations have invested a lot of money and effort into m
14.
▲
by
someone_19
1y ago
Here is example of compile time error with wrong newtype argument: https://play.rust-lang.org/?version=stable&mode=debug&editio... rust-analyzer gives an error directly in IDE.
15.
▲
by
someone_19
1y ago
Unhappy way is a part of contract. So yes, that is what I want. If a function couldn't fail before but can after the update - I want to know about it. In fact, at each layer, if you want to propagate an error, you have to convert it to
16.
▲
by
someone_19
1y ago
You can do this quite easily in Rust. But you have to overload operators to make your type make sense. That's also possible, you just need to define what type you get after dividing your type by a regular number and vice versa a regula
17.
▲
by
someone_19
1y ago
Maybe once or twice a month I'll get some language issue (like no negative trait bounds, restrictions on generic const, or something related to lifetime). I might spend an hour or more on each such case.
18.
▲
by
someone_19
1y ago
> It's essentially impossible to write a Rust program without relying on many of its escape hatches like RefCell and unsafe, that make the borrow checker go away. This is very contrary to my experience. I don't use cloning or v
19.
▲
by
someone_19
1y ago
...and using it in function calls would also be inconvenient. Now I have a clear understanding of what is happening and how. Nevertheless, using something like this for educational purposes maybe could help. Author of the article In the exa
20.
▲
by
someone_19
1y ago
My first thought when I was learning Rust was "Why don't they use a different operator for move?", something like: let a <= String::from("Hi"); let b <= a; let j = 0; // Copy let k = j; This may not
21.
▲
by
someone_19
1y ago
> Second is an absolutely strict programming language, that incorporates not only memory membership Rust style, but every single object must have a well defined type that determines not only the set of values that the object can have, bu
22.
▲
by
someone_19
1y ago
Look at vectors or hash maps. This is a perfect example of the Rust philosophy. Namely, writing complex low-level abstractions that offer a convenient and reliable high-level API. It uses unsafe, but few people understand what it really is.
23.
▲
by
someone_19
1y ago
> Golang is basically just more concise Java But golang/newsqueak was developed much earlier, in the early 80s by Rob Pike. https://en.wikipedia.org/wiki/Newsqueak ``` type point: struct of{ x, y: int; } a:=mk(