Live data from Hacker News

A functioning Turing Machine using Notepad++ and its find/replace regex engine

github.com

71–80 of 91 posts

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#71
post #21

Earlier quoted context omitted.

I find myself wondering if anyone has done a proper analysis to prove that human activity is Turing complete!

It is so, trivially; humans wrote the find/replace box in Notepad++.

I mean, I can write a FSM that outputs the code for find/replace in Notepad++.

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#72

Nice one to add to the list of accidentally Turing complete systems. What's your favourite :)?

A bit off topic but in the french internet there is an add, these days, asking people to try the Turing test to find a (good) job. I find it very funny. Imagine a job interview where you have to be turing-complient to get the job : you play the tape and the recruiter act like a scanning device...

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#73

Earlier quoted context omitted.

Glob is used in most shells, plus in several languages (Tcl has both glob and regexp matching).

Yeah, but they don't call it "regex" which would be the scary part.

Ah, I interpreted the original statement as

> Some [people] by "regex" mean "globs"

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#74
post #41

Earlier quoted context omitted.

I know the basic syntax and I never have that problem. Perhaps you mean the advanced syntax? However I don't see the problem, there either. I usually don't need it, and to be honest, when I do, I find it more maintainable to use multiple simpler expressions combined with some programming.

You must not have suffered enough, I mean used regexs widely enough. He meant “syntax” in the sense that different regex engines have different syntax and capabilities - can I do a negative look ahead assertion in engines Z, how do I do a zero width lookaround in pcre, gnu, python, posix, etc. Depending how far down the rabbit hole you want to go, start here: https://swtch.com/~rsc/regexp/regexp1.html

I just don't count those cases as 'basic' syntax.

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#75

Earlier quoted context omitted.

We are guaranteed to halt, e.g lifespan. After death cells enter apoptosis stage where cells do final stages upon shutting down. I’d say it appears we are Turing complete, or at least it appears so from this angle

Given that Turing machines cannot be guaranteed to halt (and it's trivial to write an infinitely-running Turing machine), therefore humans are not, technically, Turing-complete.

Turing completeness is a theoretical construct that ignores that errors in execution inevitably occur during a sufficiently long program, due to the second law of thermodynamics (entropy must increase in a closed system). Any realization of a Turing complete engine eventually fails. That's different than halting, though, because it doesn't answer the question as to whether the program of the machine eventually reaches a halt instruction, when properly executed.

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#76
post #3

I was under the impression that RegEx was not turing complete. Is there something special about N++’s regex engine that allows this?

No, nothing special about N++ (well, lookahead, but many regex engines have that). Repeated Search+Replace is the key, and not part of regex.

And if you allow multiple pattern-replacement pairs, you don't even need regex (the pattern can be a single fixed string) as it is enough to simulate semi-Thue systems [1].

[1] https://en.wikipedia.org/wiki/Semi-Thue_system

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#78

Earlier quoted context omitted.

We are guaranteed to halt, e.g lifespan. After death cells enter apoptosis stage where cells do final stages upon shutting down. I’d say it appears we are Turing complete, or at least it appears so from this angle

Given that Turing machines cannot be guaranteed to halt (and it's trivial to write an infinitely-running Turing machine), therefore humans are not, technically, Turing-complete.

[deleted]

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#79
post #21

Earlier quoted context omitted.

It is so, trivially; humans wrote the find/replace box in Notepad++.

I mean, I can write a FSM that outputs the code for find/replace in Notepad++.

Yeah, but you can't write an FSM that can execute itself repeatedly over its own output indefinitely!

Re: A functioning Turing Machine using Notepad++ and its find/replace regex engine

#80
post #10

Earlier quoted context omitted.

That's not relevant as to whether it's a turing machine or not, tho... The possible calculations (and genericity) is what matters. The "button for each step" could be analogous to powering the turing machine, or turning some crank for Babbage's machine, or whatever..

This is absolutely relevant, turing's original definition described a completely autonomous and automatic machine, that's why every turing machine has a halting state that locks it in a loop when computation is finished. >could be analogous to powering the turing machine, or turning some crank for Babbage's Those things are done once for those machines, you press power-on or turn a crank for just one time and the mac…

>This is absolutely relevant, turing's original definition described a completely autonomous and automatic machine, that's why every turing machine has a halting state that locks it in a loop when computation is finished.

That's just an accidental part, and is orthogonal to the manual "click next".

The halting state absolutely will be there, locked in a loop and everything, you just manually click to step over each iteration of that loop.

As said, the "click next" is no different that a clock signal in a CPU, or manually cranking the turing machine to play.

It's not at all relevant to the abstraction.

>Your computer is not a computer without a hardware clock, the repeated pressing of a button is acting as a hardware clock here.

Which is exactly why it's an irrelevant detail to the turing machine computation. It's just the clock, not the digital logic.

Whether the hardware clock is internal, or external, or I have a mule rotate around a millstone to drive it, or a big chunk of quartz, is irrelevant, as long the machine is receiving it. This includes me clicking a button to send a pulse.

Let's put it another way, what you're saying is isomorphic to:

"This setup is not a turing machine but this exact setup plus a while loop to repeatedly call xsendkey for Enter is".

Post reply on HN