Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Finite State Machine Designer (madebyevan.com)
139 points by gurjeet on Aug 11, 2024 | hide | past | favorite | 33 comments



As someone who wrote more variants of button handling code than I have fingers (mostly for physical buttons): Buttons can be way more complex than people usually would suspect:

- Buttons need to be debounced so you don't trigger 10 presses because the contacts bounce 10 times up and down before they settle to the on state

- maybe you want different states and callbacks for single press, while pressed, double press, long press, very long press, release — all of which require to measure time and some thinking (e.g. how can you reach a long press when there is a short press before ?)

- how to properly implement key combinations? Does order matter? How would you handle a "both keys at the same time"-scenario if in reality they are many milliseconds apart?

And there are always tradeoffs, which is why I had to write more than once variant of the thing (that, and I got better at writing it).


how to reach "idle, down" ?


click outside of the button and hold down

the better question is to ask how to reach "hover pressed"


The funny thing is that I had found the hard one but not the easier one.


which one is the hard one?


click outside of the button, hold down, and move cursor onto button


You might want to add graphviz/digraph export (and possibly import). It's a pretty decent format for this kind of task, supported by several IRL tools.

Oh ... 2010. I guess it's not actively being maintained.


We moved to https://gitlab.com/graphviz/graphviz/

There were 8 merge requests and 3 commits in the last 24 hours.


I remember using this to submit FSM related assignments for my Theory of Computation classes back in the day. Fun times.


Same here :)


We used this in one of my classes last year.


Check out automatarium - https://automatarium.tdib.xyz/ It can do finite state automata, pushdown automata and turning machines. We use it for computing theory classes at RMIT, and it was built by RMIT students.


Is there a way to subscript double-digit numbers? I tried S_{10} but it doesn't seem to work.

Edit: Kinda hacky/unintuitive but you can type S_1_0


On macOS deleting something is actually pressing fn+delete


It would be nice if backspace was allowed. There is no delete key on a Macbook keyboard.


To make matters more confusing, on some Macbook models (locale dependent?) the backspace key is labeled as "delete" (but still functions as a backspace key, unless you hold fn)


the backspace key has been labeled as "delete" for more than 15 years AFAIK.


Certainly depends on locale then, mine (2021 MBP, UK) is not. It has a "backspace" symbol.


I remember this! It was one of my inspirations for creating a hierarchical state machine editor [0] and a state machine library with a visualization layer [1].

[0] https://state.new [1] https://github.com/statelyai/xstate


This is a handy tool, but I wish it supported edge snapping. If you inspect the generated LaTeX it doesn't actually link up the FSM states, it just anchors them to raw TikZ coordinates.


Does it only run in Chrome? Is my VM too slow? Anyway, it doesn't work in my Linux Firefox. Too bad we don't have a real app for this.


Machinations[0] is a cool tool in this category:

[0]https://machinations.io


Hmm doesn't appear on android mobile chrome. I just see a white square where the designer should appear.


The white square is the designer. Try double clicking on it.


(Double-)Tapping on the canvas doesn't seem to do anything in FF for Android.


For me it dlightly zooms in, so maybe the browser captured that action


Not working on my iPad either. Might not be mobile friendly.


Well it was made nearly 15 years ago.


Impressive! I wonder what this guy went on to build /s


Haha! For those unsure, this is one of the co-founders of Figma, and he also maintains esbuild. See the root domain (https://madebyevan.com/).


Just saw his WebGL water running on HaikuOS Firefox this morning. It's quite a strange thing to see the same name like this.


Too bad it's webshit. A command line tool with several language backends would come in quite handy.




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

Search: