From a quick look it seems like it's "as fast as a linter" because it is a linter. The homepage says "Not just generic AST patterns", but I couldn't find any rule that did anything besides AST matching. I don't see anything in the code that would enable any kind of control or data flow analysis.
HN user
yatac42
My takeaway is that his test email bounced
What test email? I see no mention of a test email in the blog post. The mail that bounced was the one with the verification link from Viva.
but we shouldn't forget that this kind of failure can only happen starting from an ambiguous grammar specification
I don't think that's true. The following CFG is unambiguous:
S ::= A S | A
A ::= 'a' | 'a' 'b'
Yet if we translate this 1-to-1 to a PEG (without changing the order of the alternatives), it's not going to match any input with 'b's in it, so it doesn't match the same language.Note that they're actually citing "Mitchell, Webb et al." in the paper.
A lot of these games with fancy anti cheat protection the cheat tools basically just tell the server "spawn me a vehicle right here" and the server just does it.
Citation needed. I'd be quite surprised if it were common for servers of professional games to trust the client in that sense (i.e. allowing it to decide game logic like what gets spawned where).
As far as I'm aware the most common types of multiplayer cheats are
* wall hacks, which you could probably prevent by not sending the client any information about objects that the player can't see, but that would require the server to calculate the line of sight for every player/object, * and aim bots, which I don't think you could prevent at all on the server side since they don't rely on the bot having access to any information that the player isn't supposed to have. They just rely on the bot being better at aiming. I suppose if you did all rendering server side and only sent the rendered graphics to the client (i.e. streaming), that would make it harder for the bot because it'd now have to do image recognition to find the target, but that just makes it harder, not impossible. Plus, game streaming wasn't well received for a reason and anyway, I don't think that's what you had in mind when you talked about "not trusting the client".
And perhaps more relevantly, the regex from the article also works fine in RE2.
re2 uses a DFA-based system instead that just doesn't support the kinds of regexes that catastrophically backtrack
There are certain fearures that are harder or impossible to implement with RE2's approach, but it's not true that it doesn't support the kind of regex that would catastrophically backtrack using a backtracking engine.
`(.*a)*b` would be a (silly) example of a regex that can catastrophically backtrack using backtracking engines and re2 supports it just fine without backtracking.
Yes and buying music on Amazon (which is what the comment I originally responded to was about), you get system number 2, i.e. a DRM-free MP3 download.
Buying movies on Amazon is a different matter entirely, but the comment and my reply were specifically about music.
Which current systems?
For games on Steam and movies basically anywhere, the current system is that after I buy the game/movie, I can watch/play it for as long as I have access to the account. If I lose the account or the service shuts down, I'm fucked. That sucks.
For games on GOG or MP3s basically anywhere, the current system is that I buy it and then I can play the game/music forever as long as I don't lose the downloaded files. If I do lose the files, I can still redownload them as long as the service is still operating and I still have access to the account.
The second system seems fine to me.
> music I've purchased
They really ought to stop using "buy"/"purchase" metaphorically to mean something more like "one time fee for an indefinite lease that ends upon account termination."
That doesn't really apply to buying music though, does it? If Amazon banned my account, that wouldn't prevent me from listening to the MP3s I've bought from them. It would only prevent me from re-downloading them from their servers if I somehow lost all of my local copies.
But if I buy a CD from a physical store, they also don't give a me another copy for free if I lose it (even without account termination entering into it), so I'm not really any worse off with the digital download.
I wouldn't say the source language is not meaningful. If you wrote an ahead-of-time JavaScript-to-WebAssembly compiler and benchmarked the WASM generated by that, it would probably be a lot slower than the WASM generated by the Rust compiler, no?
An important difference between your add method and binary search is that the signature of your add method already implies the contract that the sum of the two integers must fit into an int because there simply is no correct value of the specified return type that could be returned otherwise.
There's nothing about the signature of an ordinary binary search method that would imply that it only works for arrays that have less than MAX_INT/2 elements.
if this was true every company would be transparent
"Only assholes and sociopaths are transparent" does not mean "all assholes and sociopaths are transparent".
I am fairly confident that people still use Apache Ant as build system
As in: there are still (older) projects around that haven't (yet) migrated away from Ant? Sure.
As in: Ant is still the go-to build system or at least still commonly used? No, not at all. When I create a new Java project in IntelliJ for example, I can choose between Maven and Gradle as the build system. Ant isn't even offered as an option.
If the `exit` variable were set to a string, `exit()` would be an error because you can't use `()` on strings. `exit` is a callable whose `__str__` method returns that message.
Note that this isn't specific to the REPL. Running `print(exit)` in a Python script will print the same message.
it's conceptual slow because of the language (types, implicits, ...) and it's accidentally slow because written in Scala (a slow language) on the JVM (slow startups and warmups)
Do you have reason to believe that the accidental part matters to any significant degree?
I mean, C++ compilers are notorious for being slow and most of them are written in C++, which is one of the fastest languages around. It seems to me that, if your language is conceptually slow to compile, the fastest implementation language in the world won't fix that problem for you.
On the other hand, if your language is conceptually fast to compile, a slowish implementation language won't hurt much (I've never heard any complaints about the speed of `javac` for example though I've heard plenty of complaints about the speed of Java in general).
Å isn't a German character, it's Norwegian. GP was ordering a package from Germany to Norway.
Honestly your comment is so beside the point that I am not sure that you are not trolling.
That seems pretty antagonistic for no reason.
You parent comment basically says the very same thing
How so? The original comment said that a lack of information hurts nerds' feelings because having information is a matter of pride for them (so for emotional reasons, not rational ones). Your parent said they need information to make a well-informed decision, not for emotional reasons. How is that the same thing?
Word of warning: The Scanner class does not adhere to the maximal munch rule, so you shouldn't use it to match keywords the way that it's done in the code in the linked reddit thread. If you replace the word "foobar" in the input with "truebar", it will then be tokenized as the keyword true followed by the identifier "bar", which is obviously not what you want.
I can't find any evidence of that being true. In this article[1] for example, all the examples either have the comma before the "aber" or none at all. I can't find any example anywhere where a comma after the "aber" would be correct nor can I think of one myself.
I also wouldn't say that German has "otherwise the same grammar as English". (Or in wrong German: "Ich auch würde nicht sagen dass Deutsch hat ansonsten das gleich Grammatik wie Englisch" - even if we're just talking about comma rules, the German version should have a comma before the "that/dass").
[1] http://www.neue-rechtschreibung.net/2012/04/30/kommasetzung-...
In fact you wouldn’t really use iphone at all, but smartphone
The sentence "Smartphone is a phone made by Apple" (or maybe "A smartphone is a phone made by Apple") would have a very different and wrong meaning though, so that doesn't make much sense to me.
What is the programming equivalent of stack equal columns?
The game's "stack equal columns" corresponds to Haskell's Data.List.group function:
import Data.List
group [1,2,2,3,3,3,2,1,1]
[[1],[2,2],[3,3,3],[2],[1,1]]
The variables used in the expressions might not be in scope (in fact they usually aren't).
That's solved easily enough by evaluating the expression in the scope where it was defined (again that's what other languages do).
Also, I'm rather sure that's how it works in C++
Default arguments in C++ work as I described: If you define `void f(int arg = g(x)) {}`, then calling `f()` n times will call `g` n times as well (using the `x` that was in scope when `f` was defined) - and if you never call `f`, `g` isn't called either.
An example demonstrating this: https://ideone.com/vs26Oq
Also, the mutable default arguments problem is quite difficult to solve in any other way. Python never copies things for you.
Why would it need to copy anything? What's wrong with just evaluating the default argument expression every time the function is called with a default argument rather than once at definition-time? That's how it works in other languages.
At this point, does any major European country have more than two viable parties or coalitions?
If we look at the coalitions that have happened at the national level in this century, we have:
* Social Democrats + Greens
* Conservatives + Social Democrats (like, a lot)
* Conservatives + Liberals
So that's three different coalitions that have actually happened in the last 20 years. Admittedly three is not a lot more than two, but it is more (and we're talking about a time frame that only includes 5 national elections and only about actual coalitions, not potentially viable ones).
And if you look at state governments as well, there are actually a lot more combinations that seem to work.
Will the German Greens ever get a Cabinet seat outside a coalition with the Social Democrats?
Almost certainly.
At the state level they already have. In one case they're even the majority with the conservatives being the minority partner in the coalition.
At the national level they almost did in 2017. Negotiations between the conservatives, the greens and the liberals failed because the liberals backed out and the greens + conservatives didn't have a majority on their own - they would have been ready to go otherwise. It is entirely possible, even likely, that we will see a conservative-green coalition after this year's elections.
Again I want to emphasize that you were comparing different algorithms on different data structures. It's like someone made a benchmark using the naive recursive Fibonacci definition and then you implemented the iterative version in another language and concluded from that that the other language must be much faster. The different algorithm is what gave you (most of) the speed up, not the language.
I mean, I don't doubt that C++ is in fact faster than Haskell, just not by that much.
C++ and the shortest, simplest possible quicksort
wk_end was talking about "functional pseudo-quicksort" on immutable linked lists. You're presumably talking about a proper quicksort on mutable arrays. That's comparing apples to oranges.
And even if you weren't, how is that an argument? Person A says "X is faster than Y", then person B says "Actually I just ran X and it took 10x longer than Y" and then you say "Well Z, which isn't even part of this discussion, is 1000x faster than both X and Y, so your argument is invalid". How does that follow?
It's called abstract syntax tree because the concrete syntax is not a tree, it's an list of characters.
It's called abstract syntax tree to distinguish it from parse trees (a.k.a. concrete syntax trees).
Why does it say AOT in the title and the README, but JIT in the project description? Did that change at one point and the description wasn't updated?
Edit: Actually it says AOT at the beginning of the README, but then JIT later in the Philosophy section. So I guess if the README has been updated, it's been updated incompletely.