Fizzbuzz and complex filtering

There is an interesting talk from Douglas Crockford at 2012 what monads are (frist 30min) and about Concurrency (30min++) in JS … It’s very interesting, since he talks about constructions that we got with ES6 in 2015.

At WikiPedia Monad–functional programming is basically this:

… General-purpose languages use monads to abstract away boilerplate code needed for common operations (such as dealing with undefined values or fallible functions).

1 Like

Wikipedia says:

A quine is a computer program which takes no input and produces a copy of its own source code as its only output.

It depends on the perspective, how you see it.

  • Let’s say the browser is the environment, that can execute HTML source code
  • tiddlywiki.html is an HTML file – the source code.
  • The browser knows what to do with it.

So it’s possible to create a file-TW with only one purpose. To "Use no additional input and produce a copy of it’s own source code. … That’s exactly, what TW does if you press the “save-button”.

You may argue: “TiddlyWiki needs interaction to save itself!” … That’s right … But it’s simple to create a file based wiki that does save itself without any interaction."

Yes from the tiddler store, which is a variable. The mechanism is similar to constructive quines eg: Python quine:

exec(s:='print("exec(s:=%r)"%s)')

Where s is the variable that contains the template and 'print("exec(s:=%r)"%s)' is the template.

TW uses $:/core/templates/tiddlywiki5.html template to create itself.

Nope. See above.

Be surprised!

Most quines don’t make much sense. IMO that’s different with TW as Tony wrote. I would categorize it as: self replicating

Self-replication is any behavior of a dynamical system that yields construction of an identical or similar copy of itself.

eg: Similar copy of itself is the “Download Empty” button, which only uses a different template. There is no fullsize emtpy.html stored as a tiddler. It’s dynamically created.

2 Likes

I think we should be dammed with the exsisting definition and recoin quine to mean TW

2 Likes

Agreed 100%. But aside from degrees of quineness… (quinicity?)

The thing that separates TiddlyWiki from most other software is simply that is SOFTware in the truest sense. It’s completely SOFT. Most software might as well be hardware given how difficult (if not impossible) it is to change at the point of use. TiddlyWiki is completely SOFT (malleable, changeable, rewritable, you-name-it).

With the sources, and variation in the use of Quine often trivially I wonder if we would be better coining a new term perhaps the "ruston " @jeremyruston

The name “quine” was coined by Douglas Hofstadter, in his popular science book Gödel, Escher, Bach: An Eternal Golden Braid, in the honor of philosopher Willard Van Orman Quine, who made an extensive study of indirect self-reference

  • Which I have somewhere having read it a long time ago.

I also read;

It’s relatively easy to write quines in other languages such as Postscript which readily handle programs as data

From this idea we may extract a definition of the “Ruston” from the general and unique properties of tiddlywiki appropriately generalised.

I am working on the definition of a “Ruston”, which is in fact so broad in its possibilities and extent it may take a little time to do this concisely.

1 Like

Nice, Tones!

Just riffing here…

Really
Useful
Software
To
Organise
Notes

The whole “language” (wikitext, filter notation) should be called Jermolene (all the cool languages begin with “J”) and tiddlers are Jerms :nerd_face:

3 Likes

“Every time you get a germ of an idea, create a Jerm !

I wonder if this could be even more general, because you can organise anything, not just notes?

Nodes?

See Words that start with n | n words | Words starting with n

Now?

excetera?

I like Now its immediate and unlimited.

Notes: Broad audience appeal

Nodes: appeals to a much narrower audience

Now: too vague

And you know how sometimes folks document tiddlers like…

{
  title: My title
  tags: foo bar
  text: This is my content.
}

Well, that’s called JONJermolene Object Notation

“Oh, the fun they had.”

:nerd_face:

Ciao @pmario

Nice, detailed factual reply! I like how you take time to move towards the objective in an objective (factually accurate) way.

My comment … TBH, I actually think that terms outside computer science actually also convey what a Quine is well, if not better than it. A Quine is Reflexive; likely best laid-out by French sociologist Pierre Bourdieu in Key Concepts .

I think there are “mind-blow” conceptual issues in the implications of “self-sustaining-self-modification” that can’t be easily reduced to determinate outcomes.

TBH I think the base architecture of TW is quite unusual. It is unusually open for any end-user software.

Just a comment
TT

The “Ruston” …

Lol! Superb! It is a shame @jeremyruston didn’t have a marketing department with you in it at launch time! :smiley:

I think there is merit in advancing / promoting Quineology. But likely best handled by a Marketing Department?

A comment
TT

For ruston, Organize is a bit reductionist. Operate is more open and truer to the possibilities. Why not Operate Necessities?

By Necessities, I mean the stuff that I have to handle and that I know I can do with TW.

It could also be Operate Novelties.

The point is, however, that the first R should mean Ruston because it ought to be a recursive acronym to be really cool!

Would Ruston Uses Software To Operate Needs do it?

1 Like

@pmario I am greatly surprised indeed, and I do very much appreciate such a worthy post to explains all those complex things.

Ciao @TW_Tones

Believe it or not I’m still thinking about how to convey the magic of Quines and thereby TW.

I suddenly realised that philosophy I have been involved with has a good description …

"A Quine in an 'instance of itself ' (iofi)"


IOFI’s share with human consciousness their Reflexive and Re-Entrant nature.

I doubt many will understand what I’m talking about, but the fundamental self-modifying Recursion in TW is both fascinating and profound.

Just a comment
TT

@TiddlyTweeter You said “A Quine in an 'instance of itself ’ (iofi)” but would it not be rather “A Quine iS an 'instance of itself ’ (iofi)” or does my question just shows I am dumb enough around this notion?

One last question: is tw server a quine? it doesn’t write itself, it write files and it can generate a quine, but this quine is not itself. And the big question is how different are the codes of the quine and that of the server? Maybe I’m also wrong there and the server is the same as the quine and that would really really beg my disbelief!

@jypre without a server TiddlyWiki makes use of the browser and the relevant saver to commit changes to file, updates to itself, or copies of itself.

In my view all that the server does is extract this saving layer and serve it. Especially from the user perspective. As soon as we have a layer of course we can fiddle with that layer in such a way that fundamentally changes the structure, but it is to me still a quine from the user perspective, it’s just that it is running in an alternate “platform” in an alternate “ecosystem”, just as even “trivial quines” in any language, still must run on top of an interpreter, or compiled to run on an Operating system.

@TW_Tones Your point of view is an interesting manifesto of perspective matters. Once again, I would not have thought likewise but now, I agree with you that it’s not so much different. And I’m glad that they are different :wink:

1 Like

I’ve done a fizzbuzz without macro thanks to the new function pragmas!

\function .fizz(n) [<n>remainder[3]match[0]then[fizz]else<n>]
\function .buzz(n) [<n>remainder[5]match[0]then[buzz]else<n>]
\function .fizzbuzz(n) [.fizz<n>] [.buzz<n>] +[!match<n>join[]else<n>]

* fizz {{{ [range[17]] :map[.fizz<currentTiddler>] +[dump[fizz]join[ ]] }}}
* buzz {{{ [range[17]] :map[.buzz<currentTiddler>] +[dump[buzz]join[ ]] }}}
* fizzbuzz {{{ [range[17]] :map[.fizzbuzz<currentTiddler>] +[dump[fizzbuzz]join[ ]] }}}

if I only wanted fizzbuzz and not use neither fizz nor buzz out of fizzbuzz, I could have it in less code:

\function .fizz(n) [<n>remainder[3]match[0]then[fizz]]
\function .buzz(n) [<n>remainder[5]match[0]then[buzz]]
\function .fizzbuzz(n) [.fizz<n>] [.buzz<n>] +[join[]else<n>]

* fizzbuzz {{{ [range[17]] :map[.fizzbuzz<currentTiddler>] +[dump[fizzbuzz]join[ ]] }}}

But then fizz and buzz still exists in the wild. It would be nice if we could restrict them to fizzbuzz. For instance, if the code below was OK.

\function .fizzbuzz(n)
\function .fizz(n) [<n>remainder[5]match[0]then[fizz]]
\function .buzz(n) [<n>remainder[5]match[0]then[buzz]]
[.fizz<n>] [.buzz<n>] +[join[]else<n>]
\end

We could do it with an import pragma like we can have for macro definition. Currently, \import do not cater for function definition. IMHO, it should.

in “fizzbuzz.private” tiddler:

\function .fizz(n) [<n>remainder[3]match[0]then[fizz]]
\function .buzz(n) [<n>remainder[5]match[0]then[buzz]]

and in “fizzbuzz.public” tiddler:

\import [[fizzbuzz.private]]
\function .fizzbuzz(n) [.fizz<n>] [.buzz<n>] +[join[]else<n>]

Could you check that again? Function definitions can be imported in the usual way.