Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
xscott
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
34 ms
·
421.
▲
by
xscott
5y ago
I was wrong elsewhere in this discussion. I now think the problem isn't that the original code breaks any rules/promises, but that the transformation to the second version of the code is not valid. > So, which of the optimiza
422.
▲
by
xscott
5y ago
I see your point, but this is really niddly. It explicitly asks if the address in `x` is equal to the address in `y-1`. And if so, it modifies the contents at that address which is equal to both. If the conclusion was that the C standard
423.
▲
by
xscott
5y ago
> Only in the presence of accesses and modifications can you actually break the promise. Ok, creating aliases you don't use is probably fine. I should've worded that more carefully. However, the example code certainly modifies
424.
▲
by
xscott
5y ago
> Which part of the program do you believe violates the restrict promise? The part where they modify a piece of memory using `x` and then modify the same piece using `y`. That's a promise the programmer made inside that function and
425.
▲
by
xscott
5y ago
> It takes two pointers with the extra promise that they do not alias each other. ... and then promptly uses pointer arithmetic to create an alias. It violated the promise. > If you view this as 'derived from', you can neve
426.
▲
by
xscott
5y ago
The code intentionally uses `y` to access stuff that it also accesses through `x`. Declaring `x` and `y` to be `restrict` was a promise that it wouldn't do that. > Does the standard not allow you to pass any pointers which could be
427.
▲
by
xscott
5y ago
I think "restrict" is a really nice compromise in C: Your code declares that you're willing to follow additional rules, and the compiler can make additional optimizations. The article shows a piece of code that makes that pr
428.
▲
by
xscott
5y ago
> [...] restrict, a C keyword to promise that a given pointer x does not alias any other pointer not derived from x The author clearly states that restrict is a promise, and then immediately violates that promise. If you lie to the comp
429.
▲
by
xscott
5y ago
Funny enough JavaScript now has BigInt, which is purely integer: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
430.
▲
by
xscott
5y ago
Yeah, I got your point. I don't think we're in disagreement about anything, and I probably shouldn't have conflated multiple topics. It's not really _syntax_, but this would be uglier to me: var temp = alloc(&quo
431.
▲
by
xscott
5y ago
You don't need the GC of course, but manually tracking and releasing the memory takes all the fun out of this kind of high level programming, particularly when you start to nest expressions. As a hypothetical example: call(
432.
▲
by
xscott
5y ago
Men can only "bail on the situation" when they don't have much to lose. Any man with a reliable job and good salary is very vulnerable to having wages garnished.
433.
▲
by
xscott
5y ago
I'm not sure where you get your information, but it feels like you have some other axe to grind.. Nearly every single man in my circle of friends has gotten a vasectomy. Several of us knew we never wanted children and would've g
434.
▲
by
xscott
5y ago
Yeah, I agree. If you're willing to use a garbage collection library [0], you can even have a pleasant syntax for ObjectiveC style OOP in C: var result = call(foo, "bar: %s boo: %f", baz, hoo); The garbage collector
435.
▲
by
xscott
5y ago
I don't know your age, and I can't predict the future, but I can say that in my 20s to early 30s I had trouble keeping a positive bank account balance and yet I was able to retire in my mid 40s. Max out your 401k. People are real
436.
▲
by
xscott
5y ago
It's a long article, but the author does make a point to contrast how much this place is not like The Villages.
437.
▲
by
xscott
5y ago
You could've put a piece of foam insulation in that window. Remove it when you want the view or need to escape a fire. There are a lot of compromises between bricks and single pane glass.
438.
▲
by
xscott
5y ago
Yeah, now only if Pascal had used curly braces, all could be right in the world :-)
439.
▲
by
xscott
5y ago
I'm not sure I understand your point. I don't think we're disagreeing about anything. C needs forward declarations for some things, and it needs a symbol table to resolve some parts of the grammar. All I was saying was that
440.
▲
by
xscott
5y ago
I think the two of you are talking past each other. You're saying, "yes, you need a symbol table", and he's saying, "yes, but a symbol table isn't very hard to do". Personally, I wonder how many of these
441.
▲
by
xscott
5y ago
> Knowledge builds on knowledge. I always thought so too, but this discussion makes me think otherwise.
442.
▲
by
xscott
5y ago
> A Turing-complete language is just that, Turing-complete. It sounds like you're dismissing Turing complete languages as basically the same. I think that's kind of like saying all hardware and networking is just made out of e
443.
▲
by
xscott
5y ago
Other than the standard search engines or Wikipedia, I don't know where to find a good history of language or hardware. I'm only aware of these examples because they were part of my "comparative programming languages" c
444.
▲
by
xscott
5y ago
> Compare programming in the 1970s and 1980s to now. We're way more sophisticated now than we were then. I think this is revisionist history at best. Your comments about baud rates and CPUs getting faster is true of course, but loo
445.
▲
by
xscott
5y ago
> But otherwise I don't totally get the point of this post. Reverse psychology? "Please don't look at my language!" A quick googling finds this: https://harelang.org/ My first impression is that it&
446.
▲
by
xscott
5y ago
They won't update your maps. They'll just put advertisements that you're forced to watch at loud volume before the car will permit you to start it.
447.
▲
by
xscott
5y ago
I think you're implicitly saying that Rust solves the problems in the article, and so migrating C++ projects to use Rust is a path forward. However, the blog author's first example was implementing a "contiguous circular que
448.
▲
by
xscott
5y ago
They also made SMS over Google Voice a second class citizen.
449.
▲
by
xscott
5y ago
Heh, ok. Instead of calling them a "fucking liar", you're saying they're "full of shit". Still seems hostile :-)
450.
▲
by
xscott
5y ago
I don't have an answer. I think maybe it's not so important that everyone be right all the time. I mean, it frequently seems like people are just talking past each other anyways. However, I'm pretty certain that when someon
More ›