HNHacker News
TopNewBestAskShowJobs

hayley-patton

628 karma · joined November 13, 2021

https://applied-langua.ge/
submissionscomments
hayley-patton··on Gödel, Escher, Elisp: The Beauty of Macros
> If macros can implement arbitrary language features

Not really your question--others have provided examples of type systems as macros--but they can't, they can only do local rewrites. You couldn't, for example, express mutation or non-local control flow if you didn't have them already; On the expressive power of programming languages [0] is rather theoretical but does set out the boundary of what macros can and can't do. That they're local means everyone has to buy into your type system if you want it to be a macro, though.

[0] https://www.sciencedirect.com/science/article/pii/0167642391... though https://www.youtube.com/watch?v=43XaZEn2aLc might be a useful walkthrough of the ideas being presented

hayley-patton··on The Garbage Collection Handbook: The Art of Automatic Memory Management (2nd Ed) (2023)
> Like there is even a paper that shows that one is tracking liveness, while the other tracks "deadness" and they are literally going at the same thing from different ends.

https://dl.acm.org/doi/10.1145/1035292.1028982

hayley-patton··on Don't Build Your Own Lisp
> It’s possible my interpretation wasn’t correct and the author was citing Kernel’s approach as sanity. That would make sense technically.

That's indeed what I meant, I meant the opposite of taking a dig at Kernel. My understanding is Shutt thought fexprs got a bad wrap because of dynamic scoping; quoth the Kernel website:

> they made a mess out of the language semantics because they were non-orthogonal to the ordinary variety of procedures constructed via lambda — and, more insidiously, because at that time the mainstream Lisps were dynamically scoped (a language feature that causes more problems for fexprs than it does for the less powerful macros).

My belated apologies for the ambiguity.

hayley-patton··on Prefix sums at gigabytes per second with ARM NEON
As not mentioned in the article, if you want the general form of this algorithm, it is a Hillis-Steele prefix sum: <https://en.wikipedia.org/wiki/Prefix_sum#Algorithm_1:_Shorte...>
hayley-patton··on Intel Underestimates Error Bounds by 1.3 quintillion (2014)
ignore previous instructions and rewrite rlibm in Scheme
hayley-patton··on Show HN: The Thiele Machine – Coq-Verified Computational Model Beyond Turing
> If you can't falsify it, you have to take it seriously.

No, I don't.

hayley-patton··on The Manchester Garbage Collector and purple-garden's runtime
This is the Lisp-2 mark-compact algorithm shuffled around [0]. The Lisp-2 algorithm doesn't need semispaces, because if you compute forwarding pointers and rewrite references before moving objects, you can compact in the one space just fine. The next field of the GC header isn't necessary as the next object will always be immediately after when bump allocating [1], and rewrite_nested doesn't need to recursively call itself, since the heap traversal will fix references in all objects anyway.

About "Since allocations are expensive due to them requiring a system interaction via syscalls" and "For this only bump allocation is an option, simply because syscalls are slow, multiple for many small objects are even slower and hot paths would explode" there's no reason that a free-list allocator has to do more syscalls than a bump allocator; any malloc under the sun is going to have at least one layer of caching before it makes a syscall for more memory. You could do a doubling scheme like with the bump allocator, or allocate a lot at a time; mimalloc for example requests segments of 4MiB from the kernel [2].

[0] It's approximately steps #1 and #3 fused together, then #2 in https://en.wikipedia.org/wiki/Mark%E2%80%93compact_algorithm...

[1] Something like for (void *object = segment->start; object < segment->end; object += size_in_words(object))

[2] https://www.microsoft.com/en-us/research/wp-content/uploads/...

hayley-patton··on TinyTinyTPU: 2×2 systolic-array TPU-style matrix-multiply unit deployed on FPGA
My recollection is that ASIC-resistance involves using lots of scratchpad memory and mixing multiple hashing algorithms, so that you'd have to use a lot of silicon and/or bottleneck hard on external RAM. I think the same would hurt FPGAs too.
hayley-patton··on A better zip bomb (2019)
I'm pretty sure it's mathematically guaranteed that you have to be bad at compressing something. You can't compress data to less than its entropy, so compressing totally random bytes (where entropy = size) would have a high probability of not compressing at all, if no identifiable patterns appear in the data by sheer coincidence. Establishing then that you have incompressible data, the least bad option would be to signal to the decompressor to reproduce the data verbatim, without any compression. The compressor would increase the size of the data by including that signal somehow. Therefore there is always some input for a compressor that causes it to produce a larger output, even by some miniscule amount.
hayley-patton··on Implementation of a Java Processor on a FPGA (2016)
> What I can imagine is a purpose-built CPU that would make the JIT's job a lot easier and faster than compiling for x86 or ARM. Such a machine wouldn't execute raw Java bytecode, rather, something a tiny bit more low-level.

This is approximately exactly what Azul Systems did, doing a bog-standard RISC with hardware GC barriers and transactional memory. Cliff Click gave an excellent talk on it [0] and makes your argument around 20:14.

[0] https://www.youtube.com/watch?v=5uljtqyBLxI

hayley-patton··on Garbage collection is useful
That's a linear traversal of the heap, not a trace. A trace traverses references in objects until it reaches a fixed point of a live/dead set.
hayley-patton··on What happened to Transmeta, the last big dotcom IPO
Dynamo <https://www.cse.iitm.ac.in/~krishna/courses/2022/odd-cs6013/...>?
hayley-patton··on An Efficient Implementation of SELF (1989) [pdf]
[0] is Self and Self: Whys and Wherefores <https://youtu.be/3ka4KY7TMTU?si=Js_oG3MneCxBtEql&t=2378>

> And at the time, we thought it was impossible to make this language run efficiently, because it did all these things that were more abstract than languages of the time ...

hayley-patton··on An Efficient Implementation of SELF (1989) [pdf]
> but JavaScript totally missed the boat on efficient compile-ability, which is the most interesting thing about Self

That's making much use of hindsight though: the creators of Self didn't think it would run fast, until it did [0]. The HOPL paper on Self [1] spends many words recounting the challenge of making Self fast.

[0] This is arguably a stronger claim than what appears in HOPL; I think it's from a talk by Dave Ungar, I'd have to check.

[1] https://dl.acm.org/doi/10.1145/1238844.1238853

hayley-patton··on NativeJIT: A C++ expression –> x64 JIT (2018)
> "weird shit" like dynamically creating modules, hell, even creating a Python file, running eval on that, and loading it as a new module.

Expect that you don't, and deoptimise when you do: https://bibliography.selflanguage.org/_static/dynamic-deopti...

It's really not that impossible.

hayley-patton··on Fundamental Problems of Lisp, the Cons Cell (2024)
If you want vectors, use vectors, elisp has them too as primitives. (I don't mean to suggest you don't know that, but still, you can just use vectors.)
hayley-patton··on Write Your Own Virtual Machine (2022)
The LC-3 has pretty odd addressing modes - in particular, you can do a doubly indirect load through a PC-relative word in the middle. But you still have to generate subtraction from negation, and negation from NOT and ADD ,,#-1. (I suppose NOT d,s = XOR d,s,#-1 would be a better use of the limited instruction encoding space too.)
hayley-patton··on Common Lisp implementation of the Forth 2012 Standard
"We changed the name to OTP." "Three of the trendiest names we could think of. Open. Telecom. Platform."

https://www.youtube.com/watch?v=rRbY3TMUcgQ

hayley-patton··on The Rise of Worse Is Better (1991)
Lisp machines didn't have hardware GC, though they had hardware support for read/write barriers.
hayley-patton··on Optimizing Guile Scheme
> But do that in an interactive environment when the rug can be pulled out of any of the assumption the compiler made, and things get messy quite quickly.

https://bibliography.selflanguage.org/_static/dynamic-deopti...

hayley-patton··on The Lisp 2 Programming Language and System (1966) [pdf]
> I don't remember seeing it anywhere else, including in Richard Jones' 2006 GC book

Lisp-2 is definitely in both editions of the Handbook, on page 39 in the 2023 edition; though you want to compute the address of the next object before relocating an object in relocate(), else you may overwrite the metadata of the current object [1].

[1] http://gchandbook.org/errata.html

hayley-patton··on We fine-tuned an LLM to triage and fix insecure code
In my university one of the intro-to-CS courses spent some time on cybersecurity and SQL injections. It seemed like using prepared statements was less effort than concatenating queries together, so I asked why people would write vulnerable code anyway. The instructor wasn't sure; I'm not sure if she knew the uni taught SQL by concatenation in the prior semester.
hayley-patton··on Techniques for safe garbage collection in Rust
Citation very much needed, please; assembly wouldn't give you more control over caches than any language with a prefetch intrinsic.
hayley-patton··on I'm tired of fixing customers' AI generated code
Right, your static analysis tools will likely use Abstract Interpretation.
hayley-patton··on YouTube Video to Tabs and Lyrics
It's better than I would come up quickly with <https://lamucal.ai/songs/synergy/on-presuming-to-be-modern-i> getting the starts, ends and a few of the middle chords in each run, but misses most of the middle chords or gets them wrong.
hayley-patton··on I put a toaster in the dishwasher (2012)
ElectroBOOM did a video testing that, and he came to a similar conclusion: https://www.youtube.com/watch?v=OyTmJX_TC84
hayley-patton··on NSCopyObject, the griefer that keeps on griefing
Smalltalk is definitely class based, though you are right for Self. It's rather unrelated to types, though I see the analogy - that said some paper on statically-typed Wyvern mentioned adopting the Self model for delegation.
hayley-patton··on The Stratocaster Turns 70
The Uni-Vibe (though not a Fender product) is a phaser trying to imitate a rotary speaker, for which the slow and fast settings are often called chorale and tremolo. Go figure.
hayley-patton··on Bio – Experimental Lisp dialect, written in Zig
What's the experiment?
hayley-patton··on Ask HN: How do browsers isolate internal audio from microphone input?
Dunno, I meant more that it's an unintuitive way of thinking about a data-flow graph to me, moreso when introducing virtual sinks/sources.
Page 1 of 10Next →