HackerTrans
TopNewTrendsCommentsPastAskShowJobs

ltratt

no profile record

Submissions

Local Reasoning for Global Properties

tratt.net
2 points·by ltratt·10 hari yang lalu·0 comments

Local Reasoning for Global Properties

tratt.net
4 points·by ltratt·11 hari yang lalu·0 comments

Test-case reducers are underappreciated debugging tools

tratt.net
153 points·by ltratt·bulan lalu·20 comments

Retrofitting JIT Compilers into C Interpreters

tratt.net
135 points·by ltratt·3 bulan yang lalu·26 comments

Some Things I've Learned About Software [video]

youtube.com
1 points·by ltratt·6 bulan yang lalu·1 comments

What Context Can Bring to Terminal Mouse Clicks

tratt.net
2 points·by ltratt·8 bulan yang lalu·0 comments

What Context Can Bring to Terminal Mouse Clicks

tratt.net
3 points·by ltratt·8 bulan yang lalu·0 comments

Garbage collection for Rust: The finalizer frontier

soft-dev.org
144 points·by ltratt·9 bulan yang lalu·180 comments

Why Firsts Matter

tratt.net
2 points·by ltratt·10 bulan yang lalu·0 comments

Why Firsts Matter

tratt.net
1 points·by ltratt·10 bulan yang lalu·0 comments

Parsing: the solved problem that isn't

tratt.net
200 points·by ltratt·15 tahun yang lalu·47 comments

comments

ltratt
·7 hari yang lalu·discuss
> The downside of manually narrowing is more code, but the upside is clarity.

This, IMHO, is where things get tricky: quite often, writing more code is at odds with clarity. I don't think there's a simple relation here -- more sometimes is better! -- and for me at least I don't know how to define it any better than "I know it when I see it".
ltratt
·16 hari yang lalu·discuss
We did have a project some years ago looking at extending LuaJIT on which Tom Fransham did excellent work. Alas, the funder's priorities moved on (as is their right!), so we didn't get to finish it. It was a bit sad, as we (well, mostly Tom) had built up a real head of steam, but c'est la vie. Still, either way, I would never have claimed enough personal expertise with LuaJIT to take over maintainership!
ltratt
·bulan lalu·discuss
This looks interesting, and definitely useful for non-C/Python languages, which existing reducers I know of mostly don't have explicit support for! I can't get it to build though (I've filed an issue).

I was also wondering: is there a UI while reduction happens? I've found Shrink Ray's UI improvements in the last year to be much more useful than I first expected: not just because it gives me something to look at, but because it really helps me understand if reduction is on the right path or not. [Some of the new Shrink Ray extras like being able to rewind reduction to a past point and to skip passes are also really useful too.]
ltratt
·3 bulan yang lalu·discuss
It would really be good if someone could provide an updated overview of all of the "GCs for Rust" created thus far -- for a while I tried to keep up with them, but there are just too many! When we wrote the Alloy paper, we took Manish's survey as a starting point, and covered as many GCs of different kinds as we could squeeze in [1]. But even then there was no way we could squeeze _everything_ in, and I've seen at least 2 or 3 new ones since (safe-gc is older than the Alloy paper, so I'm not including it in that count)!

[1] https://soft-dev.org/pubs/html/hughes_tratt__garbage_collect...
ltratt
·3 bulan yang lalu·discuss
> If this project would be able to detect the interpreter hotspots itself and completely automate the procedure, it would be great.

I don't think that's realistic; or, at least, not if you want good performance. You need to use quite a bit of knowledge about your context to know when best to add optimisation hints. That said, it's not impossible to imagine an LLM working this out, if not today, then perhaps in the not-too-distant future! But that's above my pay grade.
ltratt
·3 bulan yang lalu·discuss
You're quite right that since we're working with LLVM IR, adapting to other languages is probably not _that_ difficult, though these things always end up taking more time than I expect! Since the majority of real-world problems in this area depend on C interpreters, we put our limited resources to that problem. You're also right that "interpreters" is a pretty vague category, and there are other parts of C (and other) programs that could be yk-ified, though I suspect it would be a fairly specialised subset of programs.
ltratt
·3 bulan yang lalu·discuss
Our fork of LLVM does add a pass, amongst other changes, but we also have to do things like change stackmaps in a way that breaks compatibility. Whether stackmaps in their current incarnation are worth retaining compatibility for is above my pay grade! So some of our changes are probably upstreamable, but some might be considered too niche for wider integration.
ltratt
·8 bulan yang lalu·discuss
I'm assuming you're referring to the Python finaliser example? If so, there's no syntax sugar hiding function calls to finalisers: you can verify that by running the code on PyPy, where the point at which the finaliser is called is different. Indeed, for this short-running program, the most likely outcome is that PyPy won't call the finaliser before the program completes!
ltratt
·9 bulan yang lalu·discuss
The only way to forbid it would be to forbid creating pointers from `Gc<T>`. That would, for example, preclude a slew of tricks that high performance language VMs need. That's an acceptable trade-off for some, of course, but not all.
ltratt
·9 bulan yang lalu·discuss
We don't exactly want Alloy to have to be conservative, but Rust's semantics allow pointers to be converted to usizes (in safe mode) and back again (in unsafe mode), and this is something code really does. So if we wanted to provide an Rc-like API -- and we found reasonable code really does need it -- there wasn't much choice.

I don't think Rust's design in this regard is ideal, but then again what language is perfect? I designed languages for a long while and made far more, and much more egregious, mistakes! FWIW, I have written up my general thoughts on static integer types, because it's a surprisingly twisty subject for new languages https://tratt.net/laurie/blog/2021/static_integer_types.html
ltratt
·9 bulan yang lalu·discuss
If you've used Chrome or Safari to read this post, you've used a program that uses (at least in parts) conservative GC. [I don't know if Firefox uses conservative GC; it wouldn't surprise me if it does.] This partly reflects shortcomings in our current compilers and in current programming language design: even Rust has some decisions (e.g. pointers can be put in `usize`s) that make it hard to do what would seem at first glance to be the right thing.
ltratt
·15 tahun yang lalu·discuss
Indeed, the allusion to syntax directed editing in the article is due to MPS.
ltratt
·15 tahun yang lalu·discuss
Yes, that's part of the same bug, as I understand it anyway (to be clear: I'm not sure that anyone's claiming that there are problems with Earley's recogniser, which is really the core of his paper). Scott's "SPPF-Style Parsing From Earley Recognisers" gives an overview of the bug and its implications.
ltratt
·15 tahun yang lalu·discuss
I'm not sure the Earley paper "is full of bugs" - to the best of my knowledge, it has only one bug (albeit a biggy), which is in its description of how to create a parse tree.