Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah I don't know enough rust to know what's special here. Presumably the inverse backwards part. I retain that every project (language, application, etc) should start with what it is, what it looks like (code or screenshot as appropriate), and why it matters. This felt very implicit in that.

And, I'm still not sure how that wacky stuff gets compiled down. It looks like syntax sugar as a language.



I think the "backwards in time" aspect can most easily be understood as a consequence of (A -> B) being the same as (~B -> ~A). That is, if you know how to go from A to B, then instead of requesting B it's enough to request A. Though this can be applied more generally to a "logic of resources" which then also requires multiple varieties of the "struct" and "enum" construct, depending on whether the "producer" or "requester" side is making a choice.


I guess I'm just not understanding the minimum subtraction example. They claim it only loops through the array once, and I see that in the code, but I don't see how that's possible. In Python land I can certainly do [x - min(v) for x in v] and maybe that looks like I'm only going once but really I'm not. Maybe I'll fire up the compiler and check the resulting code.

I guess I'm still in the edit window. I installed it. Naturally once of its hundreds of dependencies needed a newer rustc than the 22.04 PPA but whatever, got that sorted. Turns out it doesn't compile down into assembly but if I'd kept reading I would've seen that it goes to Ivy, an intermediate language that's run later. Running the example gives:

> vine run vine/examples/sub_min.vi [1, 0, 4, 6]

Interactions Total 948 Annihilate 491 Commute 21 Copy 88 Erase 102 Expand 142 Call 63 Branch 41

Memory Heap 1_184 B Allocated 19_520 B Freed 19_520 B

Performance Time 0 ms Speed 6_245_059 IPS

Apparently the stats are default. Which makes this feel like a toy but again, whatever. Running that first way gives:

Interactions Total 1_069 Annihilate 562 Commute 21 Copy 96 Erase 114 Expand 163 Call 67 Branch 46

Memory Heap 1_184 B Allocated 22_000 B Freed 22_000 B

Performance Time 0 ms Speed 7_088_859 IPS

IPS seems quite variable at this small an input size. So my conclusion is: if it helps one write code better, go for it. Who cares. But this certainly doesn't seem like some magic bullet that doesn't need to go through the array twice. The ivy code is not very human friendly so I couldn't wrap my head around what it's actually doing, but it looks like it's a bunch of functional programming. It really does look quite slow and mathematically pure. So as a math toy I think it's doing a good job.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: