Is it possible to build a language code in which each line is the correct program?
Any examples? Better yet, any real examples?
Accuracy: by “correct” I mean “compiles”, although “works without errors” and “runs without errors and ends in a finite time” would also be interesting questions :)
By string, I mean any sequence of bytes, although this character set restriction will be met.
, . C, . C, , . "Hello, world!". .
, .
(, , - ). brainfuck .
... oh [], "meh. nitpickers" .
, ;)
C- , BNF
<program> ::= <character> | <character> <program>
#!/bin/bash # full_language.sh gcc "$1" if [ $? != 0 ] then echo -e "#!/bin/bash\necho 'hi'" > a.out chmod +x a.out fi
: perl.
, "" "", "" . , , "" .
, . ( {K, S, @}) . , althogh , .
, . : , ( ). " " "@? ? , ! , Omega - , , , , , .
: {K, S, @}, , ( ) . , , , , "" (, Omega).
, TokenMacGuy, , , , Jot , TokenMacGuy .
"" , , , .
http://en.wikipedia.org/wiki/One_instruction_set_computer
http://en.wikipedia.org/wiki/Whitespace_(programming_language)
..
- " " .
: http://en.wikipedia.org/wiki/Turing_completeness
" , , , Turing-complete, (. ).
What you are describing is essentially like matching from the Godel number to the original program. In short, the idea is that each program should be reducible to a unique integer, and you can use it to display results about the program, for example, using oracle . One of these mappings is the Jot language, which has only two operators: 1 and 0, and the first operator must be 1.
Source: https://habr.com/ru/post/1717077/More articles:How to decode HTML-encoded text in MS Access - htmlWork with CSV - SQLite against the shell (join / paste / cut) - shellSetting up a SQL table query - sqlHow to use StandardAnalyzer with TermQuery? - pythonWho should perform code verification? - code-reviewHow to integrate Zend Framework into my old non-centralized PHP site? - phpCreate from the command line to create a binary for Mac OS 10.5 (and 10.6) - command-lineHow can I use std :: remove in a container with std :: tr1 :: weak_ptr? - c ++MySQL Explains Anomaly - sqlGetting Started with Wizard-Free WCF - wcfAll Articles