Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
thomasmg
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
12 ms
·
121.
▲
by
thomasmg
1y ago
Yes, I see your point. In Rust, the owner, and the mutable borrower can change the pointer itself (like C realloc). If multiple "mut" borrows are allowed, then this would be unsafe, so I understand "unstable mut" would s
122.
▲
by
thomasmg
1y ago
Well the distinction between mutable and immutable borrows doesn't solve use-after-free. What prevents use-after-free is ownership. There is one owner, and the owner can not free the memory as long as there is a borrower (it doesn'
123.
▲
by
thomasmg
1y ago
I think you are right. The post talks about mutable vs immutable borrows, and how to have multiple mutable borrows, safely. But doubly-linked list are hard in Rust due to ownership, and not borrowing. (Doubly linked lists could be supported
124.
▲
by
thomasmg
1y ago
A static analysis of the regular expression has the advantage that many problematic cases can be caught at compile time. Not all: the expression is sometimes generated at runtime. There's also a risk that too many cases might be reject
125.
▲
by
thomasmg
1y ago
Right. An example regex that can be slow is CSV parsing [1]: .*,.*,.*,.*,.* etc. I believe a timeout is a better (simpler) solution than to try to prevent 'bad' patterns. I use this approach in my own (tiny, ~400 lines) regex libr
126.
▲
by
thomasmg
1y ago
Thanks! I know Rust, Java etc do a good job of array bound check elimination, but I prefer a way to _ensure_ there is no check. I felt this was missing.
127.
▲
by
thomasmg
1y ago
Thanks! Yes, that makes a lot of sense. I will improve this section! > what I'd be losing by going from C to Bau Well, you can add native C code, so in theory you do not miss much. But in practise, yes of course many features are mi
128.
▲
by
thomasmg
1y ago
I'm working on a new memory-safe systems programming language that is supposted to be (almost) as fast as C, Rust etc, but as simple and concise as Python: https://github.com/thomasmueller/bau-lang There is a play
129.
▲
by
thomasmg
1y ago
Thanks! So here is an explanation: > The same baseless accusations of “unreadable”, “write-only” and “impossible to learn” are leveled at all Iversonian languages, k included. I argue that these accusations are far from baseless. Sure, I
130.
▲
by
thomasmg
1y ago
I appreciate the features of these languages (J, K, and Klong), but I do not understand the reason why they have such a hard to read syntax. I think it is a pity; I could see myself using it otherwise. Maybe it is by design, but I do not un
131.
▲
by
thomasmg
1y ago
> If you try to use it like your favorite functional/procedural/OO programming language, you will only get frustrated. For me personally, the sentence could be shortened to just: "If you try to use it, you will only get fr
132.
▲
by
thomasmg
1y ago
> using it like gperf is certainly not a special case. Well... let's put it like this: in this survey, "parsers" (where I am one of the co-authors) are not mentioned explicitly in the "Applications" section. They
133.
▲
by
thomasmg
1y ago
From what you describe, I think you have a somewhat special use case: it sounds like you are compiling it. The experiments done in the survey are not: instead, the hash function is used in the form of a data structure, similar to a Bloom fi
134.
▲
by
thomasmg
1y ago
Using a brute-force approach can quickly find a minimal perfect hash table. Eg. the RecSplit approach can be used for this case, to first split into 4 sections, and then use another one for each section. Or, in this case, the same one for e
135.
▲
by
thomasmg
1y ago
So I'm a bit confused, the paper says "'Randen' ... outperforming ... PCG" but now you wrote "though slower than pcg64"? In the paper itself, PCG is faster but "these microbenchmark results are quite
136.
▲
by
thomasmg
1y ago
Yes, I know it is not designed to be a error-correction code, and other codes (turbo code, fountain code), are a lot more efficient. But I wanted to mention it because it's related to the topic. > You can make it work over data with
137.
▲
by
thomasmg
1y ago
So, for this it sounds like you only need one Bloom filter (not multiple), and each subset is an _entry_ in the filter. The total set size doesn't matter; what matters (for the size of the Bloom filter) is the total number of entries y
138.
▲
by
thomasmg
1y ago
This is a bit similar to count-min sketch, which can be used to calculate frequencies in a stream. Also interesting are "Invertible Bloom Lookup Tables" (IBLT), https://arxiv.org/pdf/1101.2245 , which allow t
139.
▲
by
thomasmg
1y ago
This is described here: https://en.wikipedia.org/wiki/Bloom_filter#Compact_approxima...
140.
▲
by
thomasmg
1y ago
Well, what problem do you want to solve? What you describe is not a use case but a possible solution... this smells like an xy problem...
141.
▲
by
thomasmg
1y ago
Yes, this is the succinct counting blocked Bloom filter I wrote. I wanted to write a paper about it. It requires twice the space of a blocked Bloom filter (which is about half the space of a regular counting Bloom filter). Reads are very fa
142.
▲
by
thomasmg
1y ago
Thanks for reading and taking the time to respond! > Doesn't this go against the "literals are enclosed in quotes" idea? Sure, one could argue that other changes would also be useful, but then it would be less concise. I t
143.
▲
by
thomasmg
1y ago
For me, the main problem of the Regex syntax is the escaping rules: Many characters require escaping: \ { } ( ) [ ] | * + ? ^ $ . And the rules are different inside square brackets. I think it would be better if literal text is enclosed in
144.
▲
by
thomasmg
1y ago
Well, Trump is the one that almost always frames things in very binary way. If someone contradicts him, it is "fake news". His opposition is typically much less so, and much more rational and thoughtful. Even many in the oppositio
145.
▲
by
thomasmg
2y ago
I mean heat pumps where you drill around 200 meters deep. Whether you want to call those geothermal or ground-source, that is up to you I guess.
146.
▲
by
thomasmg
2y ago
For Java, C++, and Rust there is also https://sux.di.unimi.it/ maintained by Sebastiano Vigna, a professor from Italy. Together with his student (I also helped a bit), he wrote a paper about RecSplit, a minimal perfect hash
147.
▲
by
thomasmg
2y ago
In many places it makes sense to heat the earth (yes) in summer using the heat pump (using electricity from photovoltaics) so that efficiency in winter is better.
148.
▲
by
thomasmg
2y ago
Yes. And in Switzerland, I believe most new houses have some other type of heat pump (drilling for geothermal is not allowed everywhere, or too expensive). This all still needs electricity; but many houses now install photovoltaics. (At lea
149.
▲
by
thomasmg
2y ago
The VAT is not complex. And why would an American company be better at invoicing?
150.
▲
by
thomasmg
2y ago
> borrow is never tasked with cleaning up data And the reason for this is that there is no branch needed at the end of the borrow, to check for refCount=0? (Or, is this at least one of the reasons?) I'm wondering about the performan
More ›