Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pron
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
69 ms
·
931.
▲
by
pron
2y ago
Maybe you can insist that these are two features (although I disagree), but calling one of them templates really misses the mark. That's because, at least in C++, templates have their own template-level language (of "metafunctions
932.
▲
by
pron
2y ago
> But I'm not seeing how comptime is accomplishing that. Because Zig does the work of C++'s templates, macros, conditional compilation, constexprs, and concepts with one relatively simple feature.
933.
▲
by
pron
2y ago
I'm sorry, but not being able to see that a design that uses a touchscreen to eliminate the keyboard is novel despite the touchscreen itself having been used elsewhere alongside a keyboard, shows a misunderstanding of what design is.
934.
▲
by
pron
2y ago
The revolution in Zig isn't in what the comptime mechanism is able to do, but how it allows the language to not have other features, which is what gives that language its power to simplicity ratio. Let me put it like this: Zig's c
935.
▲
by
pron
2y ago
> According to the link that’s not the case with the Zig comptime machinery. It’s effectively duck-typed from the point of view of the client (declaration). It is "duck-typed", but it is checked at compile time . Unlike duckty
936.
▲
by
pron
2y ago
> No. My compile-time when using a library with a comptime type in Zig is not guaranteed to work because my user experience could depend on if the library writer tested with the types (or compile-time input) that I am using.[1] That’s no
937.
▲
by
pron
2y ago
That wouldn't be very meaningful. The semantics of Zig's comptime is more like that of subroutines in a dynamic language - say, JavaScript functions - than that of macros. The point is that it's executed, and yields errors, a
938.
▲
by
pron
2y ago
It is novel to the point of being revolutionary. As I wrote in my comment, "the novelty isn't in the feature itself, but in the place it has in the language". It's one thing to come up with a feature. It's a whole o
939.
▲
by
pron
2y ago
My "manic praise" extends to the novelty of the feature as Zig's design is revolutionary. It is exciting because it's very rare to see completely novel designs in programming languages, especially in a language that is b
940.
▲
by
pron
2y ago
> Just because something mucks with a program's AST doesn't mean that it's introducing a new "language". That depends on the language specification. The Java spec dictates what code a Java compiler must accept a
941.
▲
by
pron
2y ago
Java's annotation processing is intentionally limited so that compiling with them cannot change the semantics of the Java language as defined by the Java Language Specification (JLS). Note that more intrusive changes -- including not o
942.
▲
by
pron
2y ago
They don't need to be restricted to total computation to be referentially transparent. Non-termination is also a reference.
943.
▲
by
pron
2y ago
Yes, I am using the term more correctly (or at least more generally), although the way it's used in functional programming is a special case. A referentially transparent term is one whose sub-terms can be replaced by their references w
944.
▲
by
pron
2y ago
Yes! To me, the uniqueness of Zig's comptime is a combination of two things: 1. comtpime replaces many other features that would be specialised in other languages with or without rich compile-time (or runtime) metaprogramming, and
945.
▲
by
pron
2y ago
Not only is there nothing here that approximates a "solution" to an unsolvable problem, but that there are more programs you can decide the more time you simulate them is the actual statement of generalised halting theorems. Ind
946.
▲
by
pron
2y ago
Yes, we must parameterise problems to meaningfully talk about classes [1], but interesting algorithms are interesting because they tractably give an answer to some large set of inputs. Their authors may not always know how to meaningfull
947.
▲
by
pron
2y ago
> So, for pure exploration in GP, you do indeed suffer the full weight of the halting theorem. As you transition into the exploitation regime, this becomes more of a grey area. I don't understand what the grey area is. The time hier
948.
▲
by
pron
2y ago
I don't know if I would call that "approximately solving the halting problem", and the use of the halting problem is already short-hand for much more general and less binary results. In the 1965 [1] paper by Hartmanis and Ste
949.
▲
by
pron
2y ago
P.S. Another thing to remember is that government expenses are often investments . This doesn't only apply to health, education, law enforcement, and transportation infrastructure but also to social security. If people think they'
950.
▲
by
pron
2y ago
It's important to remember that government debt doesn't ever need to be repaid, sort of how an immortal man could indefinitely refinance loans. That he'd have to borrow again to repay the old loans (while maintaining the debt
951.
▲
by
pron
2y ago
> The U.S. system of government relies on established norms as much as it does law. And it's also happily breaking the law. The Executive doesn't legally have the power to allocate resources (or not), not to mention the power t
952.
▲
by
pron
2y ago
It is not propaganda that POTUS is blackmailing law firms that represent his opponents and universities he doesn't like, and "suggesting" a revocation of broadcast licenses due to unfavorable coverage. It is not propaganda th
953.
▲
by
pron
2y ago
Because these are ranked by prevalence x severity, and most programs are written in memory-safe languages, the UB-related weaknesses are probably at the top of the list for programs written in C or C++, especially because "ordinary&quo
954.
▲
by
pron
2y ago
Java allows you to freely change any decision made by any author of any library you use. None of that ability has been taken away. However, changing other code (and potentially changing the assumptions on which it was built) shouldn't
955.
▲
by
pron
2y ago
> Nobody demanded anything, if we want to play word games. People asked for lightweight concurrency, better FFI, faster startup, value classes etc.. How could we have done any of that without the integrity work? It's like saying, no
956.
▲
by
pron
2y ago
Well, software today is much bigger and of higher quality that was thought possible in the seventies. That's not to say that it can scale indefinitely, but my point was that unsound methodologies (i.e. not formal proofs) work much bett
957.
▲
by
pron
2y ago
No, this JEP only talks about fields ; it has no impact whatsoever on locals. There's no positive or negative impact on performance when making locals final or not.
958.
▲
by
pron
2y ago
First, it's not a "crusade" but the steps necessary to deliver the features Java's users demand. Second, the prevalence of the use of JDK internals has dropped drastically, and demonstrably so. For example, many programs
959.
▲
by
pron
2y ago
> I don't know where that ranking comes from. It comes from MITRE ( https://en.wikipedia.org/wiki/Mitre_Corporation ), and the methodology is explained on the website (roughly, the score is relative prevalence ti
960.
▲
by
pron
2y ago
> On the other hand, I don’t think the solution to someone holding a shotgun to their foot and threatening to pull the trigger is to make everyone wear armored shoes. I don't think so, either, it's just that I think there are b
More ›