Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ufo
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
61 ms
·
871.
▲
by
ufo
6y ago
One downside of markdown being so flexible is that it's hard to remember if a given dialect implements a certain feature, or how it will handle a certain corner case I think I see the appeal of specifying a robust subset of markdown, s
872.
▲
by
ufo
6y ago
How fundamental is the requirement that all the "block stuff" be exactly four characters wide? The parts that were the strangest for me are that link references can only contain a single unicode character and that block quotes are
873.
▲
by
ufo
6y ago
That's the kind of thing I was thinking about. Do they exist? One example that someone mentioned in a sibling comment is Autosetup, which apparently uses Tcl instead of posix shell + m4. An interesting idea... Tcl is one of those langu
874.
▲
by
ufo
6y ago
From the point of view of an end user, I love compiling projects that use autotools. Download a tarball and then compile make install without needing to install a bunch of dependencies just for the build system. You can also trust that stan
875.
▲
by
ufo
6y ago
One of the main differences is that LALR parsers don't use backtracking to implement "choice". Parsing happens in a single pass over the input. With parser combinators, ambiguity is silently resolved by accepting the first op
876.
▲
by
ufo
6y ago
The search keyword you might want to use for this is "program synthesis".
877.
▲
by
ufo
6y ago
My 2 cents: Algebraic data types (tagged unions) are very useful for representing syntax trees and other things of the sort. I'm not sold on the idea of going 100% purely functional (a-la haskell) though. Even a compiler written in a n
878.
▲
by
ufo
6y ago
The tricky thing is that the length operator in Lua (#) actually returns the largest integer index in the table. If you use 1-based arrays, that also happens to be the number of elements in the table. However, if you use 0-based arrays then
879.
▲
by
ufo
6y ago
I'd also argue that counting down is more common than having a list with UINT_MAX elements.
880.
▲
by
ufo
6y ago
Djikstra does a good job of selling the virtues of 0-based indexing, but he doesn't give the same attention to the situations where 1-based indexing is better. That's the biggest problem I see in EWD831. For example, if you need t
881.
▲
by
ufo
6y ago
Fun fact: Hisham, the author of the blog post we're discussing is a notorious user of 3 space indentation. It actually works quite well in Lua, where blocks are terminated by the "end" keyword. Still sacrilegious if you ask
882.
▲
by
ufo
6y ago
One of the more common examples is if you need to iterate backwards. It's awkward because the [0,N) interval becomes (N,0]. for(i=N-1; i>=0; i--)
883.
▲
by
ufo
6y ago
In portuguese it's always POO. I always found that amusing :)
884.
▲
by
ufo
6y ago
It's a more obvious problem in typed languages like C or Java, where the type system can't help much to protect you against null pointer exceptions if you forget to check for null. Specially in C, where the null pointer exceptions
885.
▲
by
ufo
6y ago
Doesn't a bitwise OR work just as well as a XOR here?
886.
▲
by
ufo
6y ago
On the topic of intermediate variables, when I'm forced to use c89 I'm really shameless about introducing extra code blocks in the middle of other blocks. For example, {int i; for(i=0; i<N; i++){ /**/
887.
▲
by
ufo
6y ago
To be honest, the times listed on recipe websites are often too optimistic. That said, for chopping it really helps to have a sharp knife. A dull knife takes longer to do the job and it's also more likely to cause an accident.
888.
▲
by
ufo
6y ago
I like the approach that ShellCheck uses for its verbose error messages. Every error message is identified by an easily-googleable error ID that is not translated and there is a link to the shellcheck wiki where you can find an in-depth exp
889.
▲
by
ufo
6y ago
Exactly. "No such file or directory" is the default error message for the ENOENT error code. https://www.man7.org/linux/man-pages/man3/errno.3.html
890.
▲
by
ufo
6y ago
For more complex string matching tasks that the built-in patterns cannot handle, LPeg might be a good choice. I think it's not likely that something like PCRE-compatible regular expressions would be included in the Lua standard library
891.
▲
by
ufo
6y ago
These days I've grown to see the word "integrative" as a red flag for pseudosciency or pseudoscience-adjacent stuff. https://sciencebasedmedicine.org/what-is-integrative-oncolog...
892.
▲
by
ufo
6y ago
Thanks for the references. The academic paper about Hyperscan is very interesting: https://www.usenix.org/system/files/nsdi19-wang-xiang.pdf My impression is that they break the regex into components and use choos
893.
▲
by
ufo
6y ago
> For now it remains experimental because Irregexp is orders of magnitude faster than the new engine on most common patterns I'm sure that an important reason for this is that thousands of man-hours have been invested optimizing Irr
894.
▲
by
ufo
6y ago
It works similar to talking to a robot via voice call. When you start the chat with the bot it will answer with a standard message saying things like "Hi, welcome to XXX" and present you with a fixed menu of options like "typ
895.
▲
by
ufo
6y ago
In Brazil, even telehealth appointments are often done via Whatsapp these days. It really is everywhere.
896.
▲
by
ufo
6y ago
The actual study seems to be about increasing the accuracy of ultrasound-guided tissue biopsies, by adding CT-scan information to the visualization. Reading the paper I don't see any mention of replacing or avoiding biopsies, as implie
897.
▲
by
ufo
6y ago
In theory it should be possible to read out loud an "indent" and a "dedent" token whenever the indentation changes. That would be basically the same trick that Python's parser uses under the hood. However, I don
898.
▲
by
ufo
6y ago
On the topic of printf("%n"), I remember hearing a fun story about that a while ago. It appears that in certain Mazda cars it was impossible to play the "99% invisible" podcast on the car stereo (and only that podcast),
899.
▲
by
ufo
6y ago
Previous discussion: https://news.ycombinator.com/item?id=23356607
900.
▲
by
ufo
6y ago
In many languages, creating a pull-based iterator for a tree-shaped data-structure can be tricky. It might require turning the recursion inside out to use an explicit stack... Do you know how well Rust can handle this? I'm not familiar
More ›