Jeremy Ruston:
Thus, there are lots of quite prominent features that were introduced early on and that I would now handle differently (eg, the fact there is a difference between transclusion and the view widget, or the presence of text substitution macros which I now think was a mistake).
<$function $name="tablerows" filter>
<$list filter=<<filter>> >
<tr>
<th>{{!!title}}</th>
<td>{{!!field1}}</td>
<td>{{!!field2}}</td>
</tr>
</$list>
</$function>
<table>
<tr>
<th>Title</th>
<th>field1</th>
<th>field2</th>
</tr>
<tr><th colspan=3>Important Stuff</th></tr>
<$call $name="tablerows" filter="[tag[Tag1]tag[Important]]" />
<tr><th colspan=3>Less-Important Stuff</th></tr>
<$call $name="tablerows" filter="[tag[Tag1]!tag[Important]]" />
</table>Now, this does look basically the same as a macro call.
<$function $name="tablerows" filter>\define tablerows(filter:<default>)
</$function>\end
Doesn't make a difference for me. We just would need to change the macro parser. ... right?The differences are crucial, though: lower parsing and refresh overhead, only <<one syntax>> for variables, and no gotchas with quoting, whitespace, order-of-operations or open markup.
As far as I'm concerned, the similarity in usage could make transitioning trivial in many cases and the more consistent behavior could make TiddlyWiki "programming" much easier to learn.
<$function $name="xx" filter>
</$function> --
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/a6e13075-d639-4af5-b3c5-3883745688cd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeremy: in TWX the idea is to make macro invocations and transclusions be the same thing. In other words, macro invocations would become parameterised transclusions, which simply means that the parameters for the macrocall/transclusion would be available as local variables within the transclusion.
Jeremy: A related part of my thinking is that the tiddler store would become a widget; the tiddlers that it defines would be available within the scope of the widget. The ancestor cascade would take care of the shadow tiddler mechanism.
Mario: What's the problem, with making it exactly look like the existing syntax and just implement the performance improvement?
Mario: IMO those are implementation details, that could be implemented in a backwards compatible way. ... right?
\define make_list(filter) <$list filter="$filter$"/>
\function make_list(filter) <$list filter=<<filter>>/>
\define keycap(text) <kbd>$text$</kbd>
\function keycap(text) <kbd><<text>></kbd>\define get_date(tiddler) {{$tiddler$!!date}}
\define apply_tag(tag, text) <$tag$>$text$</$tag$>
\define apply_markup(markup, text) $markup$$text$$markup$ <!-- where markup is something like // or ``` -->To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/bba9e126-74be-4b2a-9b45-ad1dcb5f5fe2%40googlegroups.com.
Turning to another aspect of TWX, my idea is that it should be written in C, and compiled to WebAssembly. There are several motivations:
IMO creating a new kernel should use a language that was designed to create kernels :) ... I'd love to go with rust here.
Just a thought
-m
--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/2e218423-1c94-4f75-ad6d-784824a9b972%40googlegroups.com.
I have a plugin that defines parametrized tiddlers as components, there is a demo here:
...Turning to another aspect of TWX, my idea is that it should be written in C, and compiled to WebAssembly...
...I'd love to go with rust here...
Hey, all —I have a plugin that defines parametrized tiddlers as components, there is a demo here:Neat! So under the hood this is functionally equivalent to <$vars><$transclude/></$vars> right?
What I'd really like to see in the future is a "parse-tree cache" for more efficient transclusions.
there is caching in the core - see 'getCacheForTiddler'
What I'd really like to see in the future is a "parse-tree cache" for more efficient transclusions.
there is caching in the core - see 'getCacheForTiddler'Haha, I almost bit my tongue when I sent that E-mail — I was aware of the cache mechanism but hadn't seen that it was implemented for parse trees as well.Trouble is, transclusions don't use the parse tree cache. They call parseTextReference, which parses the transcluded tiddler with the current ruleset. Part of the trouble with implementing a parse-caching optimization is that the context where the tiddler is transcluded might define different parse rules, resulting in a different parse tree for that context. As noted by other users, however, this "feature" can be unexpected or undesirable.
On Thursday, January 4, 2018 at 8:56:29 PM UTC+1, Evan Balster wrote:there is caching in the core - see 'getCacheForTiddler'Haha, I almost bit my tongue when I sent that E-mail — I was aware of the cache mechanism but hadn't seen that it was implemented for parse trees as well.Trouble is, transclusions don't use the parse tree cache. They call parseTextReference, which parses the transcluded tiddler with the current ruleset. Part of the trouble with implementing a parse-caching optimization is that the context where the tiddler is transcluded might define different parse rules, resulting in a different parse tree for that context. As noted by other users, however, this "feature" can be unexpected or undesirable.
Forgive a mere mortal, and if this is irrelevant then just disregard it but;
IMO defining multiple macros, or macros in a tiddler containing other stuff, is not true to tiddler philosophy. There mere fact that a macro is defined indicates that it should be an (individual) tiddler.Adhering to tiddler philosophy here would also open up for a much more friendly UI for creating macros, as I've noted elsewhere. Briefly; an (individual) macro tiddler could for example have the type macro and thus a specific macro edit template with separate fields for the macro title and another for parameters. Why should a user have to learn special syntax for macros when they are basically just encompassing "shells".In practice one currently typically needs to define multiple macros within the same tiddler. This could be easily solved, in accordance with what I just wrote, by adding new macros comparable to how we currently add new fields. In actuality, what is created are separate macro tiddlers but they are presented (transcluded) as if part of the current edit view.<:-)
--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/188e4f82-e542-4360-a95e-1085b840c1cd%40googlegroups.com.
Forgive a mere mortal, and if this is irrelevant then just disregard it but;
IMO defining multiple macros, or macros in a tiddler containing other stuff, is not true to tiddler philosophy. There mere fact that a macro is defined indicates that it should be an (individual) tiddler.
Adhering to tiddler philosophy here would also open up for a much more friendly UI for creating macros, as I've noted elsewhere. Briefly; an (individual) macro tiddler could for example have the type macro and thus a specific macro edit template with separate fields for the macro title and another for parameters. Why should a user have to learn special syntax for macros when they are basically just encompassing "shells”.
In practice one currently typically needs to define multiple macros within the same tiddler. This could be easily solved, in accordance with what I just wrote, by adding new macros comparable to how we currently add new fields. In actuality, what is created are separate macro tiddlers but they are presented (transcluded) as if part of the current edit view.
<:-)
--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/188e4f82-e542-4360-a95e-1085b840c1cd%40googlegroups.com.
BJ: if the transclusion is for a 'text' then parseTextReference calls parseTiddler which uses the caches.
BJ: There is no 'context for transclusions' in tiddlywiki, (actually there is the inline/block distiction) the parsing is determined by the content of the tiddler (includings the pragmas).
Mat: IMO defining multiple macros, or macros in a tiddler containing other stuff, is not true to tiddler philosophy. There mere fact that a macro is defined indicates that it should be an individual tiddler.
Jeremy: I actually find “local macros” (ie macros defined and used within the same tiddler) to be an essential tool for organising the content within a tiddler, and so I would want to see them as part of TWX. The current thinking about shifting the tiddler store to be a stack of tiddler store widgets gives us a natural way to implement them.