John B
mastodon 4.7.3General specialist. Coding is fun. People are interesting.
@sminez@hachyderm.io I'm not sure I'm understanding the problem with streaming + parallel execution.
I'm guessing the issue is knowing whether there is still a match "pending" on received data before you can commit to running the actions/substitutions?
If that is the case, is it possible to chunk the input and at the end of each chunk, ask each matcher if it is waiting on more input to see if it should match? (Alternative api - ask each matcher for the offset up to which there is no ambiguity for whether it is matching or not).
i.e. if the input stream is currently: aaaaa abaaa
then the matcher /ab/ could report an offset of 9. It doesn't (yet) know if the last 'a' is the start of a match or not.
That would allow you to process up to the minimum offset which all matchers are OK with.
Sorry if this is nonsense. Interesting stuff though.
Ideally I'd like to be able to run "structex" scripts
Or perhaps "stawk"? :-)
@ZachWeinersmith maybe
- Play with the 2x2 matrices but just the diagonal matrices with same real in all positions (multiples of identity). Work out together that addition, multiplication etc all work the same. "So for doing maths, these are pretty much the same thing"
- Set up lack of soln to x^2+1=0 as motivating problem.
- (ask for ideas) then drop the soln matrix on the board and ask them to play with it (and the diagonal matrices)
- They can see that this is a soln to the equation
- Play with this matrix and the others a bit. Discover soln squared is -1 matrix. Discover the other soln. Discover that, no matter what they do, all the matrices they can generate can be written as sum of multiples of the diagonal and the soln.
- Maybe bring it back and name the identity and soln matrices as 1 and I. Maybe talk about rotations by theta in the plane and discover what they get when theta =90 Deg
Fun idea to think about, thanks.