Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can /// (slashes; esolang) be compiled?
#1
/// (slashes) is an esoteric programming language to have just an operator: substitution of program source. The interpreter is published on the article and the language is proven to be Turing-complete.

I wondered if a compiler for this language can be constructed, that compiles into a machine code, other compiled language, or similar.
Reply
#2
The language is Turing complete, but it doesn't do any input or output. You can know what it's going to print just from the source code. So you could "compile" it by running it and making an executable that prints the result.
[-] The following 1 user says Thank You to Ringstaart for this post:
  • aaaaaa123456789
Reply
#3
(2020-06-30 18:54:32)Ringstaart Wrote: The language is Turing complete, but it doesn't do any input or output. You can know what it's going to print just from the source code. So you could "compile" it by running it and making an executable that prints the result.

Slashes interpreter actually outputs the result, and there is the one with input, called itflabtijtslwi (ignore this fancy little acronym, because this is just that slashes language with input)

Also how does your compiler deal with the program that never halts?
Reply
#4
(2020-07-02 08:42:53)queha Wrote:
(2020-06-30 18:54:32)Ringstaart Wrote: The language is Turing complete, but it doesn't do any input or output. You can know what it's going to print just from the source code. So you could "compile" it by running it and making an executable that prints the result.

Slashes interpreter actually outputs the result, and there is the one with input, called itflabtijtslwi (ignore this fancy little acronym, because this is just that slashes language with input)

Also how does your compiler deal with the program that never halts?

It can output a program that never halts, of course.
If you need to contact me for any reason, or if you have any questions, concerns, problems or requests, message me here or email me at aaaaaa123456789@acidch.at.

This forum has been around for (loading...)
Reply
#5
(2020-07-02 08:42:53)queha Wrote:
(2020-06-30 18:54:32)Ringstaart Wrote: The language is Turing complete, but it doesn't do any input or output. You can know what it's going to print just from the source code. So you could "compile" it by running it and making an executable that prints the result.

Slashes interpreter actually outputs the result, and there is the one with input, called itflabtijtslwi (ignore this fancy little acronym, because this is just that slashes language with input)

Right, it does do output, of course.

Quote:Also how does your compiler deal with the program that never halts?

I hadn't thought of that! I guess it could use a heuristic. Like, it doesn't do what I said if it takes more than 100,000 steps or the text becomes larger than 100KB when it's trying to run it.

It could fall back to making an executable that has a normal interpreter with the program source code baked in.

I think an executable would always have to contain an interpreter because the source code keeps changing. You can't just translate it to machine code.

That way would work for itflabtijtslwi too.

(2020-07-02 09:03:47)aaaaaa123456789 Wrote: It can output a program that never halts, of course.

You'd have to solve the halting problem to reliably know when to do that.
[-] The following 1 user says Thank You to Ringstaart for this post:
  • aaaaaa123456789
Reply




Users browsing this thread: 1 Guest(s)