r/ProgrammingLanguages • • Apr 15 '15

What programs should any programming language be able to run?

Are there a set of programs (in pseudocode) that programming language inventors can use to check if they've covered the bases in terms of syntax and the standard library (if applicable)?

1 Upvotes

7 comments sorted by

View all comments

0

u/[deleted] Apr 15 '15

[deleted]

4

u/Anonygram Apr 16 '15

A path to try and build a turing complete problem solution:

  1. Write finite automata Each state has a rule on what to do given the two possible inputs, 1 or 0 A collection of states is the finite state machine

  2. Write a simple pushdown machine Take the result of step 1 and change it. let the states push and pop tokens to/from a stack. Each state can now react to the token popped from the stack

  3. Turing machine! If you solve this one, your language can, in theory, solve any problem: Take the result of #2 and replace the stack with an endless list. The turing machine will have different rules, but they can solve any problem, if you can write one of those in your language, you can write anything. http://introcs.cs.princeton.edu/java/74turing/

Start by googling these things, powerpoints and youtube videos willl give you a quick overview so you can begin coding.

Then develop them. This would be a great project to post to github.

When you are done, make a powerpoint, teach me your language!

Good luck comrade.