Live data from Hacker News

What Are Signals?

signia.tldraw.dev

11–20 of 63 posts

Re: What Are Signals?

#11

I don't really understand why people like signals again. I used a signals-like reactive programming model in VueJS a while ago and hated that you could never be sure exactly where things were being changed. Thankfully it seems that the React creators and maintainers are not hopping on the signals train and are instead adamant about unidirectional dataflow with explicit mapping of state to UI, which, as has been the r…

My impression is that Javascript is just an horrible language to create reactive systems, and that default purity with explicit effects is extremely underrated. (But then, I was already biased.)

It is hard to even make sense of the discussion without imagining the details of how those frameworks are implemented. And the discussion on the level of normal usage, not something advanced or development oriented.

Re: What Are Signals?

#12
post #2

At first I thought this was talking about Unix signals Then I thought for a moment it was talking about a "signal" in the information theoretical sense All I came away with was that they've invented a new name for event driven architectures and/or data flow programming. I know naming is hard but we need to stop overloading terms.

I felt similarly disappointed, as I was expecting a cool intro to DSP or something similar. But nope, another BS buzzword from the magical world of webdev.

Re: What Are Signals?

#13

I don't really understand why people like signals again. I used a signals-like reactive programming model in VueJS a while ago and hated that you could never be sure exactly where things were being changed. Thankfully it seems that the React creators and maintainers are not hopping on the signals train and are instead adamant about unidirectional dataflow with explicit mapping of state to UI, which, as has been the r…

[deleted]

Re: What Are Signals?

#14

I don't really understand why people like signals again. I used a signals-like reactive programming model in VueJS a while ago and hated that you could never be sure exactly where things were being changed. Thankfully it seems that the React creators and maintainers are not hopping on the signals train and are instead adamant about unidirectional dataflow with explicit mapping of state to UI, which, as has been the r…

Because it's nicer. The mental model of reading the functions using signals is; it's all about initialize|constructor|new function. And then those off-jsx stuff starts to make sense since you won't re-initialize those things. They need to exist somewhere in particular execution model. In Solidjs, it's effects (compiled from jsx where signals are read). I think those who are familiar with static type languages, naturally understand how signals needs to be unwrap/wrap .. like a monoid, not a big deal.

Re: What Are Signals?

#15
post #2

At first I thought this was talking about Unix signals Then I thought for a moment it was talking about a "signal" in the information theoretical sense All I came away with was that they've invented a new name for event driven architectures and/or data flow programming. I know naming is hard but we need to stop overloading terms.

“Signal” was used for a time-varying value in a reactive system for a very long time (I thought it was as far back as Fran in 1998, but I was remembering wrong—I was only able to find usage in Grapefruit in 2009, older references welcome). One way or another, in a functional reactive programming system, you need distinct names for: (a) A thing that happens (or might happen but ultimately doesn’t) and is associated wi…

I've always referred to and heard these referred to as "events" and "sequences" with d/e being subtypes of either or containing additional contexts.

I'm not sure what you mean by "Rx" in this context.

My background is much more in the systems (and indeed, "signals" in the theoretical sense).

I still think the name "signal" here is quite bad, since it's the abstract concept of something-that-carries-information

Re: What Are Signals?

#16

I don't really understand why people like signals again. I used a signals-like reactive programming model in VueJS a while ago and hated that you could never be sure exactly where things were being changed. Thankfully it seems that the React creators and maintainers are not hopping on the signals train and are instead adamant about unidirectional dataflow with explicit mapping of state to UI, which, as has been the r…

I'm not a JS/Vue/React programmer but I would definitely expect function One to return Count: 4 if props.count == 2 when One is called. For function Two I would be more suspicious and would not be overly surprised if it returned Count: {props.count * 2} to be evaluated at a later stage.

Re: What Are Signals?

#17
post #15

Earlier quoted context omitted.

“Signal” was used for a time-varying value in a reactive system for a very long time (I thought it was as far back as Fran in 1998, but I was remembering wrong—I was only able to find usage in Grapefruit in 2009, older references welcome). One way or another, in a functional reactive programming system, you need distinct names for: (a) A thing that happens (or might happen but ultimately doesn’t) and is associated wi…

I've always referred to and heard these referred to as "events" and "sequences" with d/e being subtypes of either or containing additional contexts. I'm not sure what you mean by "Rx" in this context. My background is much more in the systems (and indeed, "signals" in the theoretical sense). I still think the name "signal" here is quite bad, since it's the abstract concept of something-that-carries-information

> I’m not sure what you mean by "Rx" in this context.

From “reactive extensions”, a name for a family of libraries[1] (RxJava, Rx.NET, RxJS), AFAIK one of the first attempted implementations of mature FRP ideas in the imperative world and one messy enough that it took React’s success for anything similar to reënter the mainstream.

Compare the enthusiastic HN reception of “Deprecating the observer pattern” in 2011[2], mostly by people who heard of FRP in the functional-language setting, and the vitriol it received in 2018[3], apparently from people for whom FRP came to mean Rx (and similarly confused things like Bacon.js). It is this vitriol that I meant to preemptively redirect by the mention of FRP ≠ Rx, so if you’re not aware of this history it’s no big loss to ignore it.

(Yes, I am very much No-True-Scotsmanning this. That should not be taken to mean that reconciling FRP with side effects is a trivial problem, though,—I’m not sure it’s even a solved one. Only that Rx and its ilk suck as a solution.)

> My background is much more in the systems (and indeed, "signals" in the theoretical sense).

> I still think the name "signal" here is quite bad, since it's the abstract concept of something-that-carries-information

I think the intention was to allude to physical wires and conceptual analog or digital things they transmit, as in “reset signal”, “differential signalling”, etc. It does seem to me to be an apt term for a (continuous-)time-dependent doodad in a program, given “variable” is taken.

Your description sounds more like the information-theoretic “channel” or “transmission medium”.

[1] https://reactivex.io/

[2] https://news.ycombinator.com/item?id=2972581

[3] https://news.ycombinator.com/item?id=17845341

Re: What Are Signals?

#18

I don't really understand why people like signals again. I used a signals-like reactive programming model in VueJS a while ago and hated that you could never be sure exactly where things were being changed. Thankfully it seems that the React creators and maintainers are not hopping on the signals train and are instead adamant about unidirectional dataflow with explicit mapping of state to UI, which, as has been the r…

My impression is that Javascript is just an horrible language to create reactive systems, and that default purity with explicit effects is extremely underrated. (But then, I was already biased.) It is hard to even make sense of the discussion without imagining the details of how those frameworks are implemented. And the discussion on the level of normal usage, not something advanced or development oriented.

What language(s) would you recommend for building reactive systems?

Re: What Are Signals?

#19

I don't really understand why people like signals again. I used a signals-like reactive programming model in VueJS a while ago and hated that you could never be sure exactly where things were being changed. Thankfully it seems that the React creators and maintainers are not hopping on the signals train and are instead adamant about unidirectional dataflow with explicit mapping of state to UI, which, as has been the r…

Yes, it's more of a design problem of some of these libraries though.

Ideally, signalling shouldn't be retrofitted on normal variables. It assumes then that you overload variable access (assignment and reads). Then it's hard to know which variables are reactive and which ones are not. The problem stems from the overloading of semantics.

A UI is mutable so it's not about mutable state being wrong but the unit of variability are not program variables but rendered props which are basically DOM Element properties. In react, it just happens that it uses variables whose values are injected in the DOM elements via jsx but that's an issue (especially when dealing with exports, prop drilling etc)

So until a plain variable and a reactive variable are made to look different everywhere in code, it will remain confusing. And even then, it's not optimal.

Disclaimer: I'm currently implementing a cross-platform UI framework in Go and that's the reason why I had to think about it since traditional languages do not have reactive variables.

Re: What Are Signals?

#20
post #2

At first I thought this was talking about Unix signals Then I thought for a moment it was talking about a "signal" in the information theoretical sense All I came away with was that they've invented a new name for event driven architectures and/or data flow programming. I know naming is hard but we need to stop overloading terms.

The term signal was used, because RxJS had already taken the term "Observable" to refer to their primitives, which are actually more like streams.

Because of this, Ryan Carniato of SolidJS referred to his own observable primitives as "signals" and this has become the default terminology to talk about this type of pattern within the context of web development.

Really, signals should be thought of as a type of observable.

Post reply on HN