Practicing writing games entirely using string rewriting for the first time. It's rewiring my brain, I've never seen a computing paradigm as powerful as that before. I'm at a loss for words-
The runtime is 200 lines, the game source reads like english, it's fast as hell, it vitrifies whatever examples is on rosetta code, even Prolog(You had one job?!).
tictactoe: https://git.sr.ht/~rabbits/modal/tree/master/item/examples/tictactoe.modal
runtime: https://git.sr.ht/~rabbits/modal/tree/master/item/src/modal.c
docs: https://wiki.xxiivv.com/site/modal
weep: https://rosettacode.org/wiki/Tic-tac-toe#Prolog
This entry was edited (7 months ago)
ThaCuber
in reply to Devine Lu Linvega • • •I think I once commented on such a thing as one example of pattern matching, not necessarily in Modal, but in Feather, another language by wryl
either way, I really like it, reminds me of Puzzlescript and other rule-based systems
Devine Lu Linvega
in reply to ThaCuber • • •ThaCuber
in reply to Devine Lu Linvega • • •ThaCuber
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to ThaCuber • • •(wryl)
in reply to Devine Lu Linvega • • •@thacuber2a03 Ah.
<> (or (#f) (#f)) (#t)
Should be..
<> (or (#f) (#f)) (#f)
ThaCuber
in reply to Devine Lu Linvega • • •ThaCuber
in reply to ThaCuber • • •Devine Lu Linvega
in reply to ThaCuber • • •abortretryfail
in reply to Devine Lu Linvega • • •Devine Lu Linvega
Unknown parent • • •datarama
Unknown parent • • •...as the main way you're encouraged to *think* about computation in it.
For example: What if an error report, rather than a line number and an error type, was a partially-reduced tree, where you can see exactly where the irritant went and its entire context, with runtime values? You could make a pretty sweet debugger in a rewrite-based language, I think.
(And many other programming tools, for that matter.)
datarama
Unknown parent • • •The reason I stopped my own experiments with it was mostly that if I wanted a rewrite system to have properties I could use for eg. compiling and optimizing (since rewrites are an expensive operation), then I'd have to restrict it ... and what I restricted it *to* would pretty much invariably end up being just another lambda calculus variant; just another functional language.
That said: I still think there's real value in rewrites as *part* of a language implementation, and perhaps...
a very weeny construct 💀
in reply to Devine Lu Linvega • • •no shade on your code, i think it is fascinating and i love it
but to be fair to the prolog version, it implements a computer player, using the minmax algorithm to compute the best next move
not that you couldn't do it in modal! i'd love to see it in fact. betting it will still be way more concise and readable than the prolog version
Devine Lu Linvega
in reply to a very weeny construct 💀 • • •poetaster
in reply to Devine Lu Linvega • • •poetaster
in reply to Devine Lu Linvega • • •DHeadshot's Alt
in reply to Devine Lu Linvega • • •Devine Lu Linvega
in reply to DHeadshot's Alt • • •