Live data from Hacker News

Vine: A programming language based on Interaction Nets

vine.dev

21–30 of 51 posts

Re: Vine: A programming language based on Interaction Nets

#21
post #5

Author here, happy to answer any questions.

About the inverse feature: it is not clear to me how code using it evaluates and how much faster it is. But I find it confusing when reading the sub_min[1] function and reminds me how much I value readability. I'm not convinced that feature should be exposed just because interaction nets allow you to flow time backwards. Better free parallelism is already a great improvement!

[1] https://vine.dev/docs/features/inverse

Re: Vine: A programming language based on Interaction Nets

#22
post #5

Author here, happy to answer any questions.

Have you thought about how autodiff can be baked into the lang? Given that it is already seemingly all representing computation with graphs of operations, building AD into it seems like a natural extension that could open up some pretty useful applications/bring in some scientific computing interest.

I’m also curious to think about how the “time travel” might interact (if at all) with (1) basic algebra and (2) building off that, systems of equations and (3) building off of that something like implicit/crank-nicholson finite difference schemes.

Without having thought about it much, it feels intuitively like there might be an elegant way of expressing such algorithms using this notion of information traveling backwards, but perhaps not.

As an aside, although I’m not really a fan, the representation of time travel in Tenet seems like a natural analogy to include in your docs for fun if desired. More relevant, talking about things like backprop in standard ML packages might be one way of providing a shared reference point for contextualizing information flowing backward through a computational graph.

Finally, echoing what others have said about not burying the lede in the docs, as well as wanting to see more motivation/examples/discussion of interaction nets.

Re: Vine: A programming language based on Interaction Nets

#23

Earlier quoted context omitted.

This is something I never got through my annual rechecking of the interaction nets wiki page, cause isn't the lambda calculus also fundamentally parallel? Are nets even more?

Both lambda calculus and interaction nets are confluent. That is, for a term that can be normalised (i.e. evaluated), one can obtain the same answer by performing any available action in any order (n.b. if the chosen order terminates). For example, for `A (B) (C (D))`, I can choose to first evaluate either `A (B)` or `C (D)` and the final answer will be the same. This is true in both systems (although the reduction i…

That's a great explanation.

Re: Vine: A programming language based on Interaction Nets

#25
post #3

"This function calculates the minimum of a list of numbers, and subtracts every number in the list by that minimum. This function currently iterates over the list twice; once to calculate the minimum, and once to do the subtraction. At a first glance, it looks like there is no way to merge these two loops, because you need to calculate the minimum of all the numbers before you can subtract from any of them. As it tur…

That's a very cute feature! Thinking about it in terms of thunks makes it pretty understandable to me.

Re: Vine: A programming language based on Interaction Nets

#26
post #17
post #10

Earlier quoted context omitted.

Yeah, that would be good to add to the docs. Interaction nets are an alternate model of computation (along the lines of the lambda calculus or Turing machines). It has several interesting properties, one of the most notable being that it is fundamentally parallel. https://en.wikipedia.org/wiki/Interaction_nets https://t6.fyi/guides/inets I think there are many potential applications for interaction nets in parallel &…

Isn't any pure language easy to parallelize? What advantage do interaction nets offer over a parallelizing compiler for a purely functional language?

You may be interested in my other comment. To put it simply, pure languages remove serialisation of false data dependencies, exposing data parallelism, and interaction nets remove serialisation of false control dependencies, exposing control parallelism.

Re: Vine: A programming language based on Interaction Nets

#27
I like Inverse types! While it's not novel idea, this seems like a very concise implementation of it. Inverse types are also known as negative types (https://legacy.cs.indiana.edu/~sabry/papers/rational.pdf) or holes. This concept is what needed to make a concrete category for computation compact (highly recommend: http://arxiv.org/abs/0903.0340) and make the connection to how our physical universe actually works on a quantum level, with antiparticles performing backward computation. I'm pretty sure this model of computation of filling holes with inference would allow us to understand advantages of quantum computation much better.

Do you have any thoughts on HVM's SupGen for program synthesis? I would love to understand how interaction nets makes the notion of inverse types and filling holes more natural and efficient.

Re: Vine: A programming language based on Interaction Nets

#29
post #3

"This function calculates the minimum of a list of numbers, and subtracts every number in the list by that minimum. This function currently iterates over the list twice; once to calculate the minimum, and once to do the subtraction. At a first glance, it looks like there is no way to merge these two loops, because you need to calculate the minimum of all the numbers before you can subtract from any of them. As it tur…

I was thinking it must be possible to do something semantically similar in Prolog:

   find_min_and_subtract([H], [R], Min) :-  
       Min = H,
       R is H - Min.  
   find_min_and_subtract([H|T], [R|Rs], Min) :-
       find_min_and_subtract(T, Rs, TailMin),
       (H  Min = H ; Min = TailMin),
       R is H - Min,!.
Which [9,4,12,2] -> [7, 2, 10, 0].

But this doesn't work for all cases anyway (just the ones where the last value is also the minimum). I feel it can be fully expressed in one pass with miniKanren instead but no time to figure that out now; it can defer the arithmetic by setting up constraints.

Always liked the idea of 'using variables in the past' (or creating them in the future) and the first amazement moment was with Prolog (there were quite a lot of wow! moments in Prolog for the young me who only knew basic, pascal & c, like when you have some 'write multiply in prolog', when you deliver f(x,y)=x*y, you can not only do f(2,3) and get 6, but also f(2,y)=6 and get y=3), but, so it made me think of it.

Re: Vine: A programming language based on Interaction Nets

#30
post #25
post #3

"This function calculates the minimum of a list of numbers, and subtracts every number in the list by that minimum. This function currently iterates over the list twice; once to calculate the minimum, and once to do the subtraction. At a first glance, it looks like there is no way to merge these two loops, because you need to calculate the minimum of all the numbers before you can subtract from any of them. As it tur…

That's a very cute feature! Thinking about it in terms of thunks makes it pretty understandable to me.

Yes, thunks with sugar is my thinking as well. Does not explain the "last unassignment" examples though. I don't quite understand why it's needed though :)
Post reply on HN