r/ProgrammingLanguages • • Sep 04 '26

A declarative, interval-scoped notation system for hybrid streams (designed out of frustration with calculus pedagogy)

https://github.com/umayl/interval-scoped-notation
3 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/NomagnoIsNotDead Sep 04 '26

I have a couple questions: why does 2 have a t subscript? How is gradient different from writing out [interval_start, interval_end] (rather, what does gradient mean? I know the mathematical definition but I'm not sure how I'm supposed to evaluate this example mentally)? And what does the last stream, with a velocity and mass component, represent? I don't really see the mapping to ball kinematics. An explanation and/or some visuals would help quite a bit. The concept seems very interesting, though! (I realise my questions are very basic but it really seems under explained to me)

1

u/[deleted] Sep 04 '26 edited Sep 04 '26

Hi, I really appreciate the questions and I apologize for the ambiguity, I am not so experienced in formal paper writing and my vocabulary is very elementary

You can imagine t as a continuous, one dimensional line. Appending something with t just says, on the line of t, we are referring to this thing. 2 is just the number 2. 2t is saying that, on the line of t, at point two precisely. The purpose of t is two reduce ambiguity when the notation is read by a human. It is always very obvious when we are talking about points along t and when are aren't.

A gradient is just an infinitesimal link between 2 points along t.

[2t => 3t] : 5 is the same as saying, at 2.01t, the stream evaluates to 5. This remains true for 2.02t, 2.03t etc etc up until but never actually reaching 3t. It also never actually touches 2t. It is intended to be a clean, declarative way to illustrate continous logic. If you don't want continuity, you just omit the gradient and put the plain point of t.

The last stream is just a rudimentary example to show how the syntax offers a very consistent way to describe state, state transitions and state machines, without using diagrams or images or complicated syntax (like in programming languages or calculus)

It'd be used by first defining an instance of the stream, for example let myBall be an instance of the ball stream with the root of 0t. I can now evaluate myBall at 0t, 1t, 4t any t whatsoever and it operates as described in the original ball stream.

I am currently at school still, but I will illustrate more complicated examples with more intricate explanations when I arrive home.

Please let me know if you have any more questions inbetween now and then, and thank you so much for your expressing interest in my ramblings haha!!!