Viewing profile — jcparkyn
jcparkyn
HN member- Joined
- Sat, Apr 16, 2022, 9:40 AM UTC
- HN karma
- 620
- Public activity
- 242 items
- HN profile
- View on Hacker News ↗
About jcparkyn
Recent public activity
-
comment
Comment #48671760
Agent loops (particularly coding agents) have a huge amount of repetition, because the entire context is included in every model request. So long as it's at the start of the input …
-
comment
Comment #48145871
> If standard defined that left subexpression of addition is fully evaluated before the right expression that wouldn't be allowed. I'm no expert, but surely this would still be all…
-
comment
Comment #47272423
Honestly having looked at the memcached clients available for Java recently, I don't think any of the options could be considered feature-complete. None of the main ones support th…
-
comment
Comment #46805430
In the programs I write probably about 80-90% of variables are immutable, and I think this probably corresponds to most other code. Except in certain domains and programming styles…
-
comment
Comment #46775419
This is a little bit tricky because the parser has to distinguish between: for x in arr (something ()) \ /-- function call and for x in arr (something ()) \ /-- loop body This is c…
-
comment
Comment #46775371
This is similar but not quite the same as persistent data structures. In particular: - We can avoid quite a few allocations in loops by mutating lists/dicts in place if we hold an …
-
comment
Comment #46763595
> How to pass a mutable reference into a function, so that it can change the underlying value and the caller can observe these changes? Just modify the value inside the function an…
-
comment
Comment #46763531
This applies everywhere, and it fundamentally wouldn't be possible for just function calls. > needless cost Are you comparing to a language with mutable references or a our functio…
-
comment
Comment #46763410
Personally I think local mutability is quite a useful property, which was part of the inspiration for making this instead of just another pure functional language: - All functions …
-
comment
Comment #46761676
> can you take the address of a variable in some way? I intentionally didn't add this, mostly because I wanted to explore how far you can get without it (and keep the language simp…
-
comment
Comment #46761600
Nope, it's value semantics (unlike Python), the references are just an internal optimization. Implicit copies happen when a list/dict with more than one reference is mutated.
-
comment
Comment #46761198
It's only semantically a pass-by-value, in reality a reference is passed and the data is only copied if needed (i.e. value is mutated while shared).
-
comment
Comment #46761167
> Have you benchmarked any real workloads? Nothing "real", just the synthetic benchmarks in the ./benchmarks dir. Unnecessary copies are definitely a risk, and there's certain code…
-
comment
Comment #46761124
> Use immutable pass by reference. Make a copy only if mutability is requested in the thread. This is essentially what Herd does. It's only semantically a pass by value, but the sa…
-
comment
Comment #46760949
Yes, if you modify a nested dict/list entry, all nodes above it will be cloned. Here's an example: x = [1, [2]]; var y = x; set y.[0] = 3; // clones the outer array, keeps a refere…
-
comment
Comment #46760629
Thanks, I updated the post title based on this and another comment. Thanks for the pointer to Euphoria too, looks like an interesting language with a lot of similar ideas.
-
comment
Comment #46760556
Not everything in C is pass-by-value. Sure, you can argue that a pointer itself is passed by value, but the data it points to is definitely not.
-
comment
Comment #46760375
I'm not sure if I understand the question? There are two ways to define a variable binding: x = 1; // declares x as immutable var y = 2; // declares y as mutable The "default" beha…
-
comment
Comment #46760343
Thanks, some interesting reading there that I will check out (I wasn't aware of PCF). Perhaps I should've used more precise wording: "All types are value types". > Standard ML [...…
-
story
Show HN: A small programming language where everything is pass-by-value
This is a hobby project of mine that I started a few years ago to learn about programming language implementation. It was created 95% without AI, although a few recent commits incl…
-
comment
Comment #46242657
> The whole point of names is that they aren't descriptive I actually agree with this, but that's exactly the opposite of what TFA is arguing.
-
comment
Comment #45790194
One of my previous side projects used this idea in the extreme: It's a two-player online word game (scrabble with some twists) but all the state is stored in the URL so it doesn't …
-
comment
Comment #45090588
Not to mention tracepoints (logging breakpoints), which are functionally the same as printf but don't require compiling/restarting.
-
comment
Comment #42837726
> I think if you [...] and have some luck you will succeed no matter what Ignoring the politics of it, this wording is pretty funny to me.
-
comment
Comment #42572062
To be fair, this is the first thing that comes up when I google search for "DuPont connector" (after some sponsored shopping links).