I find building little toy interpreters and programming languages fantastically fulfilling, creatively energizing, and a really fun way to learn how such a common element of our work that's often a black box functions inside. I've written before about how to get started [2] with these kinds of little toy programming language projects if you're curious to dive in.
Write a program in Tabloid that takes 5 numbers and returns the product of the first three numbers plus the product of the last two.
Run it with the numbers 4,5,7,8,9.
----> ChatGPT response:
DISCOVER HOW TO product_with_five_numbers WITH a, b, c, d, e
RUMOR HAS IT
EXPERTS CLAIM ab_product TO BE a TIMES b
EXPERTS CLAIM first_product TO BE ab_product TIMES c
EXPERTS CLAIM de_product TO BE d TIMES e
EXPERTS CLAIM result TO BE first_product PLUS de_product
SHOCKING DEVELOPMENT result
END OF STORY
EXPERTS CLAIM input_a TO BE 4
EXPERTS CLAIM input_b TO BE 5
EXPERTS CLAIM input_c TO BE 7
EXPERTS CLAIM input_d TO BE 8
EXPERTS CLAIM input_e TO BE 9
EXPERTS CLAIM final_result TO BE product_with_five_numbers OF input_a, input_b, input_c, input_d, input_e
YOU WON'T WANT TO MISS 'The result is'
YOU WON'T WANT TO MISS final_result
PLEASE LIKE AND SUBSCRIBEGiven time and ability, making what you need almost from scratch may be not just viable, but productive.
* Linus Torvalds (The OG)
* Linus Sebastian (Linus Tech Tips)
* Linus Lee (Author)
https://www.reddit.com/r/SideProject/comments/12bgn7p/weve_c...
Perfection.
I had a similar, never realized concept of a language named "Spouse"(no gender implied), with keywords such as "You promised we would ... on ..."(declarations), "you always ..."(loops) and "Fine."(marking the end of the program). I couldn't get the grammar to be both consistent and sound like the real deal though.
[1]: https://fransfaase.github.io/MCH2022ParserWorkshop/ [2]: https://github.com/FransFaase/MCH2022ParserWorkshop/blob/mai... [3]: https://fransfaase.github.io/MCH2022ParserWorkshop/IParseStu...
WHAT IF TOTALLY RIGHT IS ACTUALLY COMPLETELY WRONG
YOU WON'T WANT TO MISS 'Alt-facts in logic are here'
LIES!
YOU WON'T WANT TO MISS 'Fake news are not discovered yet'
PLEASE LIKE AND SUBSCRIBE
It prints that "FAKE NEWS ARE NOT DISCOVERED YET!", disappointingly enough.