Little Language Case Study - Generating Code for Simple State Machines

8 views
Skip to first unread message

Paul Tarvydas

unread,
Apr 8, 2026, 9:11:14 AM (13 days ago) Apr 8
to pi...@googlegroups.com

We've spent decades building programming languages that try to do everything — general-purpose, Turing-complete, expressive, fast, safe, concurrent. ...
But the ambition to make one language handle every problem has a shadow side: it makes us reach for that one language even when a smaller, more targeted tool would serve us better. 

Little Language Case Study - Generating Code for Simple State Machines

Raoul Duke

unread,
Apr 8, 2026, 11:24:26 AM (13 days ago) Apr 8
to pi...@googlegroups.com
AMEN

Mike Austin

unread,
Apr 9, 2026, 6:28:05 PM (11 days ago) Apr 9
to PiLuD
Every once in a while I rewrite my web calculator. Every time, it's tricky to count for all the states and interaction.

Pressing equal multiple times repeats the last operation. Pressing an operator should calculate the previous, but only once. Using 0 for default won't work for multiplication, etc.

On Wednesday, April 8, 2026 at 8:24:26 AM UTC-7 raould wrote:
AMEN

Paul Tarvydas

unread,
Apr 9, 2026, 11:07:35 PM (11 days ago) Apr 9
to pi...@googlegroups.com

As I see it, these are two completely different problems. (1) calculator (2) stateful interaction. 


I have reached the conclusion that using the same notation for both problems is anti-productive and leads to an imbalanced solution.


--
You received this message because you are subscribed to the Google Groups "PiLuD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pilud+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pilud/c3a42e86-0d7e-4b7d-a1ae-ec37f383d20bn%40googlegroups.com.

Mike Austin

unread,
Apr 10, 2026, 12:54:59 AM (11 days ago) Apr 10
to PiLuD
I agree. In my previous version it supported keyboard and UI so the logic was separated. Come to think about, maybe it’s more logical to think about values as a stack. Calculators that support parens definitely create a type of AST.

Thanks for the push in the right direction.
Reply all
Reply to author
Forward
0 new messages