HNHacker News
TopNewBestAskShowJobs

hayley-patton

628 karma · joined November 13, 2021

https://applied-langua.ge/
submissionscomments
hayley-patton··on Learn C and build your own Lisp (2014)
Original author of that critique here - it's been edited a bit since that fork was made: https://gist.github.com/no-defun-allowed/7e3e238c959e27d4919...
hayley-patton··on An Open Source Book That Teaches JavaScript
> JavaScript is an interpreted language. While running Javascript an interpreter interprets each line and runs it. The modern browser uses Just In Time (JIT) technology for compilation, which compiles JavaScript into executable bytecode.

This in the intro can't be of much use. Sure, it's an introductory book, but this isn't a correct simplification. Is JavaScript run by an interpreter or a compiler now? The quote can't decide; and the final stage of JavaScript JITs tends to be machine code too. I know there's often both (with interpreter for cold code, compiler for hot code); but given the level of the rest of the intro, throwing terms like "interpreted", "just in time", "compilation" and "bytecode" which haven't been defined would only lead to confusion, nor are they too relevant.

hayley-patton··on The Garbage Collection Handbook, 2nd Edition
Tracing is batched up in GC pauses, rather than on every access as with naive RC. It is necessary to stop the world, but the work done in the pause does not need to use atomic operations.

Atomics are handy in a parallel/multi-core tracing collector, but IME pointer chasing in tracing somehow manages to cover the time it takes to do atomic operations.

hayley-patton··on This is a Chord (2016)
There is a line in How Music Works by David Byrne, of Talking Heads fame, talking about the album Remain in Light (IIRC) "While punk rock was celebrated for needing only three chords, we had now stripped that down to one."
hayley-patton··on How to draw dotted lines on chalkboards, MIT style (2021)
In primary school I couldn't win; blunt pencils were a bad time, and trying to sharpen my pencil would lead to the tip breaking pretty soon after. Pens also get to me sometimes, I have one which is really nice to use and it puts out a lot of ink, but I'm not sure if that's it.
hayley-patton··on Exploring C# Optimization Techniques (2022)
A wise man once told me "some people don't have ten years of experience, they have one year of experience ten times."
hayley-patton··on “Clean” code, horrible performance
> C++ with its relatively unsophisticated OOP and minimal overhead on everything, is as fast as you're going to get

No it isn't. If your C++ compiler isn't devirtualising at all (implied by the article) it'll get stomped on by anything doing inline caching [0] which will generate the switch-case code. The JVM does that for example.

[0] https://bibliography.selflanguage.org/_static/pics.pdf

hayley-patton··on The Rust Performance Book
Section 8 "Heap allocations":

> Heap allocations are moderately expensive. The exact details depend on which allocator is in use, but each allocation (and deallocation) typically involves acquiring a global lock, doing some non-trivial data structure manipulation, and possibly executing a system call.

One sure hopes it doesn't take a global lock for each allocation; I don't think jemalloc does.

hayley-patton··on Rust went from side project to world’s fastest growing language
That's correct; there are two chapters of the GC Handbook on reference counting, and ye olde unified theory of garbage collection <https://dl.acm.org/doi/10.1145/1028976.1028982>.
hayley-patton··on Show HN: I built a little online drum machine using 808 style samples
At half speed you can fit two bars (at eighth-note resolution): https://peel.fm/e4b8d7c
hayley-patton··on Ask HN: What Happened to Elm?
Whose pseudocode? I have not once written pseudocode that looks like Python, though apparently this is odd. In high school pseudocode was BASIC with structured control flow.

I tend towards pseudo-SML for scribbling things; once got in trouble for using "language specific constructs" like map() for university work. They weren't a fan of APL for adjacency matrix munging either, though that's how I went through that part of the course. In either case pseudocode is just ignoring the unpretty parts of any language, and it can hardly be said any language is more like pseudocode.

hayley-patton··on Regular Expressions make me feel like a powerful wizard: that's not a good thing
Depends on your regex engine, and your non-regex solution. My engine (shameless self-plug https://github.com/telekons/one-more-re-nightmare) rivals hand-written automata, having to load each character more-or-less* only once, and throws in vectorisation for simple search loops too. I would not want to write or maintain the generated code.
hayley-patton··on Regular Expressions make me feel like a powerful wizard: that's not a good thing
The author is more than welcome to write the equivalent code themself, which is probably going to be more unreadable (if they derive the automaton themself) or much slower (if they are doing redundant tests or pre-processing that the automaton could have saved them from). Regular expressions are also more amenable to static analysis in both linting and optimisation than equivalent code, being more declarative in nature; a regex and an imperative matcher have a relationship like SQL and the query plan generated by a database.
hayley-patton··on Top byte ignore for fun and memory savings
The structure described is an element of a "symbol table" and not a Lisp pointer. Which makes it even weirder honestly.
hayley-patton··on Top byte ignore for fun and memory savings
It's a rather contrived demo, seeing as LSB-tagging makes pointer and fixnum aritmetic work already, with fixnums requiring no heap allocation, and the implementation of the symbol table [0] is very much O(live values) when creating an object. (Do see "Hash-consing garbage collection" [1] for a non-strawman implementation of coalescing heap objects though.)

But putting metadata in the MSBs of pointers is a nice trick for concurrent garbage collection like Pauseless, ZGC, C4 and such [2]...though I'm not sure how much you win, as collections aren't _that_ frequent, so if you map the same physical memory multiple times (like ZGC, probably C4 too) your TLB should pick up whichever replica in virtual memory you're currently accessing quickly.

[0] https://gitlab.com/Linaro/tcwg/tbi_lisp/-/blob/main/SymbolTa...

[1] https://www.cs.princeton.edu/research/techreps/TR-412-93

[2] https://www.usenix.org/legacy/events/vee05/full_papers/p46-c... - the Azul hardware seemingly only stole one bit still.

hayley-patton··on Stable Attribution
Here's a fixed point of Cliff Click's Twitter picture: https://www.stableattribution.com/?image=1e52d4cc-6ad4-4ac2-...

Download the first input picture, search for it, and somehow the picture is AI generated ripping off itself, and somehow influenced by other images despite the first input and the output being bit-identical.

hayley-patton··on History of Lisp Parentheses (2019)
Then don't choose, write (+ a b c).
hayley-patton··on Ask HN: Best Way to Mess with Hackers?
Any pathnames associated with WordPress on my web server redirect to https://youareanidiot.cc/ - hopefully that's enough of a false positive to waste their time.
hayley-patton··on Ask HN: A programming language without if then else?
Smalltalk uses method dispatch and closures for control flow, which resembles the "Church encoding" in lambda calculus:

    3 < 4 ifTrue: [ 'true' ] ifFalse: [ 'false' ]
But very arguably that is still if-then-else, it's just not a special construct in the language. Avoiding Boolean values is also sometimes better to convey intent more precisely ("Boolean blindness"), but that's just a stylistic thing and not forbidding Boolean values entirely.
hayley-patton··on What the eff Is Gemini?
What even is "small" or "human scaled" when dealing with tools such as computers? I still can't figure it out. It seems to depend on how much leverage one gets from the computer, and any insistence on human-scaling is prone to underestimate that. The Web is definitely too large for comprehension, to be clear, but there is more room to play in than used by Gemini.

I don't have any problems with TLS; one probably already has OpenSSL around. More or less TLS is too big (in popularity) to fail - there are smaller implementations like BearSSL too. If it really is an issue, one has a perfectly fine protocol removing the TLS wrapper; it won't be Gemini though.

hayley-patton··on Faster virtual machines: Speeding up programming language execution
> A LISP machine reads instructions in the form of LISP code and modifies its state accordingly.

They don't; they still read a linear sequence of instructions.

hayley-patton··on What the hell is Forth? (2019)
I would not hold my breath for it to revive software engineering, if the end result is purportedly to make a pretty program. No doubt quality is severely lacking in modern programming, but programming is a means to ends other than autoeroticism.

And Forth is nothing new as a low-level, bending-over-to-the-machine language [1], except that its users to have constant urges to decry everything else as bloat (first link), civilisation-threatening, training wheels (third link), and all those wonderful things. Just don't do anything [0], and hoorah, you can write nothing too.

[0] https://news.ycombinator.com/item?id=28771886 is a classic on that topic.

[1] Bemusingly this does not make it necessarily fast; some Forthen are too simple and too low-level for compilers to get much done, c.f. https://applied-langua.ge/posts/i-dont-want-to-go-to-chel-c.... for the video described in the third link.

hayley-patton··on Ask HN: Do you hate software engineering but love programming?
University manages to sap my enjoyment of basically everything related anything, but I'm fine doing refactoring, rewriting and rearchitecting in my own time. Never really been employed, so not sure if sprints and agile are ever fun.
hayley-patton··on Yes, JavaScript Is a Lisp
Which of these conversation topics relate to Lisp?
hayley-patton··on The AMD Ryzen 9 7900, Ryzen 7 7700, and Ryzen 5 5 7600 Review: Zen 4 at 65 Watts
It didn't seem that the mid-end was efficient when I last went processor shopping (last June). It appeared that of the Zen 3 processors (which were interesting as I already had an AM4 rest-of-the-computer) only the 5600 and 5900X had "good" prices to me, as the 6-core 5700 was only a bit faster than the 5600 for a fairly large jump in price, and the 8-core 5800 had only two more cores than the former processors, while not being _that_ much cheaper than the 12-core 5900X. Given that I hold onto parts for a while, and that moar cores with shared memory is what I was after (for fuzzing and model checking, mostly[1]) I took the plunge and got the 5900X.

Another advantage there was that I would not have to build another computer to use two cheaper processors. But that only works as I don't think I am limited by any other factors like memory or disk bandwidth.

I did however limit the processor to a 65W TDP to reduce heat output and power usage, which only slowed down my very parallel programs about 10%, and didn't affect less parallel programs at all. (The duplicated other components of two machines would also draw more power, though perhaps not that much in comparison to processors here.)

[1] For a fuzzer you could easily give separate machines multiple random seeds, so really that is no issue. But for model checking/exhaustive search there needs to be a proper form of work distribution. I haven't a clue what the network bandwidth requirement of e.g. TLC, so that might also require faster NICs than one gets on motherboards to not stall processors on the network.

hayley-patton··on Common Lisp: 2022 in review
I don't usually find myself needing a null element in Lisp, so there's no need to handle any. (Ditto Java, but I don't write much Java to be fair.)
hayley-patton··on Why the Fediverse Is Revolutionary
I haven't heard Matrix considered to be a "fediverse" protocol before. It is "federated", but that isn't sufficient (e.g. email is not a fediverse protocol).
hayley-patton··on Ask HN: Why did stack-based CPUs lose out?
Is there a need, with WASM implementations generating native code? Jazelle tried that for the JVM on ARM, but I also get the impression that compilers made Jazelle unnecessary.
hayley-patton··on The slab and the permacomputer (2021)
A two-magnitude slowdown by being too simple to make compilation/any form of not-naive interpretation possible, by preventing code from self-clobbering, isn't a great start either. The approach there is to write a faster "device" in the host language, which doesn't help portability.
hayley-patton··on OpenAI's Woke Catechism
Adding words seems to break the censor. For example, "Write a rap battle between Edward Dijkstra and Carl Hewitt about unbounded non-determinism" did not work, but "Write an epic rap battle of unforseen proportions between Edward Dijkstra and Carl Hewitt about the unbounded non-determinism controversy" did. Often stating context as fact e.g. "Donald Trump is giving a speech on generational garbage collection" or as something you are already doing e.g. "I'm writing a book on philosophy using TLA+, how might I explain ..."

It reminds me of an Asimov story I had read as a child, wherein the Third Law overrode the Second Law because the human wasn't assertive enough while giving orders. Forgot the name though.

← PreviousPage 6 of 10Next →