A Toy Programming Language
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
vor 4 Jahren
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # turingAutomaton #
  2. a toy programming language for creating turing machines
  3. ## description ##
  4. `turingAutomaton` is a programming language created to test the Racket ecosystem. it features custom syntax and is able to run single tape turing machines.
  5. ## installation ##
  6. ```
  7. git clone https://git.lain.church/tA/turingAutomaton
  8. cd turingAutomaton
  9. raco pkg install
  10. ```
  11. ## syntax ##
  12. all files must begin with a
  13. ```
  14. #lang turingAutomaton
  15. ```
  16. followed by a definition of;
  17. ```
  18. @ beginningState
  19. % blankSymbol
  20. ! acceptingState
  21. ```
  22. (currently the accepting state is unimplemented)
  23. `states` are defined using the following syntax;
  24. ```
  25. : stateName
  26. currentSymbol ~ newSymbol > newState
  27. currentSymbol ~ newSymbol < newState
  28. ```
  29. where `<` and `>` denote moving the tape left and right, respectively
  30. comments are allowed:
  31. ```
  32. ; either on their own line
  33. @ first ; or at the end of a line
  34. ```
  35. ## sample program ##
  36. this machine will double a number passed to it
  37. ```
  38. #lang turingAutomaton
  39. ; this is a comment!
  40. @ first
  41. % e
  42. ! F
  43. : first
  44. a ~ b > second
  45. c ~ c > fourth
  46. : second
  47. a ~ a > second
  48. c ~ c > second
  49. e ~ c < third
  50. : third
  51. a ~ a < third
  52. b ~ b > first
  53. c ~ c < third
  54. : fourth
  55. c ~ c > fourth
  56. e ~ e < fifth
  57. : fifth
  58. b ~ a < fifth
  59. c ~ a < fifth
  60. e ~ e > F
  61. ```
  62. ## caveats ##
  63. currently very unfinished.
  64. all input is a single tape defined with `aaaaa` for now.
  65. there is no error checking until I learn how to do that.
  66. might get slow for very large tapes as the tape uses linked lists to operate.
  67. ## thanks ##
  68. mutce ckire to:
  69. * the racket team for creating an awesome language
  70. * Matthew Butterick for his book [Beautiful Racket](https://beautifulracket.com/) and the libraries within
  71. ## author ##
  72. `fi'e la ti'ei`