Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ufo
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
8 ms
·
61.
▲
by
ufo
1y ago
The whole issue is that, without computing first and follow sets, it's easy to make a mistake and think that the grammar is LL(1) when it actually isn't. When that happens, the if statement does you no good. It'll be determin
62.
▲
by
ufo
1y ago
I disagree. When writing recursive descent by hand, it's easy to miss an ambiguity because of miscomputed FIRST and FOLLOW sets. In practice most recursive descent parsers use if-else liberally. Thus, they effectively work like pegs wh
63.
▲
by
ufo
1y ago
A middle ground that I think is sometimes useful is to use an LR parser generator to check if the grammar is ambiguous, but use recursive descent for the actual implementation. Since we won't actually use any code from the LR parser ge
64.
▲
by
ufo
1y ago
It sounds like you're describing the Lexer Hack[1]. That trick works just the same in an LR parser, so I wouldn't count it as an advantage of recursive descent. [1] https://en.wikipedia.org/wiki/Lexer_hack
65.
▲
by
ufo
1y ago
The issue in dynamic languages like python is that almost every little thing is impossible to be sure at compile time: * The type of arguments passed to the function. Everything might point to the function always being passed values of a pa
66.
▲
by
ufo
1y ago
Pix blew other kinds of bank transfer out of the water. TED, DOC, Boleto, were slow and expensive. Pix is instant, free for most people, and just works.
67.
▲
by
ufo
1y ago
One quite useful application of this is that implication can play the role of the partial-order operator in a Galois Connection. A Gallois connection is an iff-and-only-if formula of the form F(x) ≤ y iff x ≤ G(y) One form of this
68.
▲
by
ufo
1y ago
Regular pasta, bread, and yoghurt are processed, not ultraproccessed. (the shelf-stable varieties are often ultraprocessed though, and are less healthy than the non ultra-processed ones)
69.
▲
by
ufo
1y ago
I know the author starts the post by saying he won't explain the reasons why he had to write a new Lua interpreter from scratch, but I'm still curious about that. Does anyone know? I dug through some of the links in the post and c
70.
▲
by
ufo
1y ago
It depends of the dinosaur. Large ones, like t.rex, had fewer feathers.
71.
▲
by
ufo
1y ago
I think the real issue here is not whether there is a separate type for tables and arrays, but whether the arrays are homogenous (all elements must have the same type). In most dynamic languages, the arrays are heterogeneous. For example, P
72.
▲
by
ufo
1y ago
For what it's worth, there are already two code paths for tables. The array part is stored separately from the hash table part.
73.
▲
by
ufo
1y ago
The main catch is that if the optimization guesses wrong and a different type is inserted into the table afterwards, then it would incurr an O(n) operation to transfer all the data to a deoptimized table. Another caveat is that Lua can have
74.
▲
by
ufo
1y ago
This optimization might land in the next Lua release. More specifically, the "Reflected Arrays" version (Figure 6). https://github.com/lua/lua/blob/f71156744851701b5d5fabdda506...
75.
▲
by
ufo
1y ago
It's frustrating for me to see this discussion thread being taken over by dozens of comments filled with fascist lies, and being reminded that there are still nutjobs out there actively plotting to overthrow our democracy. If you reall
76.
▲
by
ufo
1y ago
For context, it's useful to remind that after the last presidential election, Brazil withstood a coup attempt similar to USA's January 6th. Since then, the courts have taken a tougher stance against social media, including a count
77.
▲
by
ufo
1y ago
This reminds me of the old idea that you could get some architecture astronauts to specify a system and then offload the implementation of the individual modules to the cheapest developers one could find. Which didn't always work well
78.
▲
by
ufo
1y ago
If you accidentally store nil in an array it creates "holes" inside an array, which breaks the length (#) of the array.
79.
▲
by
ufo
1y ago
Tables being dual purpose is fine. The real problem is that assigning nil deletes the table field. Unfortunately, fixing that now would cause Python3 levels of breakage.
80.
▲
by
ufo
1y ago
We switched from a hierarchical internal representation to a flat one, with gotos. Made it easier to write textbook otimization algorithms. In theory we could try to reconstruct the if and while statements when it's time to emit C, but
81.
▲
by
ufo
1y ago
Alas, as of last month we changed Pallene's compiler and it now generates C gotos for control flow. ( ^ _ ^ メ ) It helped with certain optimizations...
82.
▲
by
ufo
1y ago
More than just keeping it simple, it's also about reducing the API surface of the language. Lua's main design constraint is that it's meant to be embedded inside other applications, and the versatile table type helps a lot in
83.
▲
by
ufo
1y ago
I'm Pallene's lead maintainer. Currently the code is maintained by me, my students and other open sou rce collaborators. We collaborate with Roberto over some Pallene-related research, specially about the type system semantics, b
84.
▲
by
ufo
1y ago
Do you know how old that is? Lua Teal has already been around for at least 5 years.
85.
▲
by
ufo
1y ago
A tricky tradeoff is that, because Teal compiles to Lua source, adding those run-time type checks would incur some considerable overhead. I've seen other languages in this space easily run 2 or 3 times slower when run-time checks are t
86.
▲
by
ufo
1y ago
Teal compiles to Lua text files. I believe it's compatible with both Lua 5.1 and 5.4
87.
▲
by
ufo
1y ago
I'm not sure if I follow. Teal still compiles all those things into plain Lua tables, it's just that the type system has different table subtypes for better type checking. I think the variable scoping is also the same as regular
88.
▲
by
ufo
1y ago
His team discovered Eris and many other trans-neptunian objects, which did fuel the discussion behind pluto's demotion: greatly increase the number of planets, or demote pluto? They're also behind the Planet 9 theory that's d
89.
▲
by
ufo
1y ago
I'd be surprised. It's surprisingly difficult to setialize NaN values. Can't do it on JSON, for example.
90.
▲
by
ufo
1y ago
Link to the macros: https://github.com/Grazfather/dotfiles/blob/master/nvim%2Ffn...
More ›