digitalmars.D.announce - New Diet template engine almost complete, ready for comments
- =?UTF-8?Q?S=c3=b6nke_Ludwig?= (38/38) Jul 25 2016 The Diet template language is aimed at providing a way to define
- Stefan Koch (3/11) Jul 25 2016 This is great news.
- rikki cattermole (1/1) Jul 25 2016 Hmm, I wonder if it could be extended to also do json as well as xml lik...
- lqjglkqjsg (3/13) Jul 25 2016 I think I'm gonna test it to make my GH blog. It looks perfectly
- Karabuta (3/5) Jul 25 2016 Is there a way to get react JS to work with vibe.d in
- Sebastiaan Koppe (5/10) Jul 25 2016 Without a JS engine that is going to be pretty hard. Or ugly.
- Puming (8/16) Jul 25 2016 A feature I want the most for Diet is the ability to parse Diet
- Rory McGuire via Digitalmars-d-announce (15/31) Jul 25 2016 e <
- =?UTF-8?Q?S=c3=b6nke_Ludwig?= (13/29) Jul 25 2016 A real runtime solution would require a D runtime interpreter or JIT
- Rory McGuire via Digitalmars-d-announce (6/41) Jul 25 2016 d
- Rory McGuire via Digitalmars-d-announce (6/8) Jul 25 2016 and on Linux the Gold linker should be used for speed, but then it shoul...
- Puming (3/18) Jul 25 2016 Thanks!Shared lib reloading is good. Looking forward to it fully
- =?UTF-8?Q?S=c3=b6nke_Ludwig?= (4/8) Jul 28 2016 I decided against putting it into vibe.d and instead re-implemented it
- Chris (5/49) Jul 28 2016 Great stuff! Very much appreciated. Btw, the link to
- Rory McGuire via Digitalmars-d-announce (5/8) Jul 28 2016 Also:
- rikki cattermole (3/13) Jul 28 2016 Hehehehe, I was wondering when this would come up :)
- =?UTF-8?Q?S=c3=b6nke_Ludwig?= (3/54) Jul 28 2016 Oh, dang! Thanks for mentioning this. Fortunately I copy/pasted the
- WhatMeWorry (5/10) Jul 28 2016 Is "Diet template" a D/Vibe unique language? I can't find
- =?UTF-8?Q?S=c3=b6nke_Ludwig?= (5/14) Jul 28 2016 Yes, it started out as vibe.d exclusive (now it's properly decoupled
- Chris (5/5) Jul 29 2016 Talking about diets, will reShop[1] be available for Android an
- =?UTF-8?Q?S=c3=b6nke_Ludwig?= (8/12) Jul 29 2016 Yeah, diet/health tips are always a hot topic, I think we even talked
The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade <http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements, and everything that can be done at compile-time is done at compile-time. Vibe.d still contains the original implementation, which was written around the limitations of DMD's CTFE engine back years ago, and is basically a monolithic parser+generator with little flexibility and a number of convenience features missing, because of their implementation complexity. The new implementation has been rewritten cleanly, with separate parser, modifier and generator modules, working on a common DOM tree intermediate representation. The major new features/improvements are: - No external dependencies other than Phobos - Supports inline and nested tags syntax - Supports string interpolations within filter nodes (falls back to runtime filters) - Supports AngularJS special attribute names - Extensible/configurable with traits structures - Uses less memory during compilation (this one was a real surprise) - (Unit) tested from the start - Supports arbitrary uses other than generating HTML, for example we use it similar to QML/XAML for our internal UI framework The API documentation can be shown ba running DUB: dub fetch diet-ng --version=1.0.0-alpha.2 dub run diet-ng -b ddox You can try the library directly, or together with the latest alpha release of vibe.d (0.7.30-alpha.3). Simply add a dependency to "diet-ng", version "~>1.0.0-alpha.2". Vibe.d will automatically re-route render!(...) calls to diet-ng. A small example with just the most essential features is shown in the README: https://code.dlang.org/packages/diet-ng More complex real-world examples: https://github.com/rejectedsoftware/vibed.org/tree/master/views https://github.com/rejectedsoftware/ddox/tree/master/views Any comments/requests regarding the feature set or API are highly welcome!
Jul 25 2016
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade <http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements, and everything that can be done at compile-time is done at compile-time. [...]This is great news. diet-ng is so much cleaner!
Jul 25 2016
Hmm, I wonder if it could be extended to also do json as well as xml like.
Jul 25 2016
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade <http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements, and everything that can be done at compile-time is done at compile-time. [...] Any comments/requests regarding the feature set or API are highly welcome!I think I'm gonna test it to make my GH blog. It looks perfectly adapted.
Jul 25 2016
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:The Diet template language is aimed at providing a way to ...- Supports AngularJS special attribute namesIs there a way to get react JS to work with vibe.d in anyway(server-side)?
Jul 25 2016
On Monday, 25 July 2016 at 20:42:51 UTC, Karabuta wrote:On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:Without a JS engine that is going to be pretty hard. Or ugly. Basically you would be duplicating a lot of stuff. I would probably use node.js to do an initial render. And keep all the data/api endpoints in vibe.The Diet template language is aimed at providing a way to ...- Supports AngularJS special attribute namesIs there a way to get react JS to work with vibe.d in anyway(server-side)?
Jul 25 2016
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade <http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements, and everything that can be done at compile-time is done at compile-time. [...]A feature I want the most for Diet is the ability to parse Diet templates at RUNTIME instead of compile time with a switch, similar to Regex/CtRegex. In this way one can do quick turnarounds in dev mode, tweaking little corners of the pages, and then when a page is finished, it can be switched to compile mode for faster render time. Do you think this is feasible?
Jul 25 2016
On Tue, Jul 26, 2016 at 5:22 AM, Puming via Digitalmars-d-announce < digitalmars-d-announce puremagic.com> wrote:On Monday, 25 July 2016 at 09:29:38 UTC, S=C3=B6nke Ludwig wrote:e <The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jad=x.http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements, and everything that can be done at compile-time is done at compile-time. [...]A feature I want the most for Diet is the ability to parse Diet templates at RUNTIME instead of compile time with a switch, similar to Regex/CtRege=In this way one can do quick turnarounds in dev mode, tweaking little corners of the pages, and then when a page is finished, it can be switche=dto compile mode for faster render time. Do you think this is feasible?Hi Puming, You could use some sort of dialect of JS that is close to D, and then alter the diet template engine so that is doesn't evaluate the code sections with some sort of CT switch. Or you could use my Jaded templates which is basically the same but runs at compile time or runtime (at runtime you would again have to use a language with an interpreter.) I think if you took, vibe.d/diet-ng + arsd/jsvar as your compile time stack, you could find a common denominator so that you could use (node.js + webpack + pug) to do the fast (live) edits of the templates.
Jul 25 2016
Am 26.07.2016 um 05:22 schrieb Puming:On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:A real runtime solution would require a D runtime interpreter or JIT compiler. There would be an alternative solution based on compiling each template to a shared library and then dynamically recompiling/reloading those as required, but that currently doesn't work due to the alias parameter based interface of render!(...). However, what should work well is a combination of https://github.com/dlang/dub/pull/446 and https://github.com/rejectedsoftware/vibe.d/pull/1385 - I'll merge the latter one into vibe.d master today. It will require to store session information and similar things in an external store, and on Linux the Gold linker should be used for speed, but then it should be almost as good as a runtime solution.The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade <http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements, and everything that can be done at compile-time is done at compile-time. [...]A feature I want the most for Diet is the ability to parse Diet templates at RUNTIME instead of compile time with a switch, similar to Regex/CtRegex. In this way one can do quick turnarounds in dev mode, tweaking little corners of the pages, and then when a page is finished, it can be switched to compile mode for faster render time. Do you think this is feasible?
Jul 25 2016
On Tue, Jul 26, 2016 at 7:54 AM, S=C3=B6nke Ludwig < digitalmars-d-announce puremagic.com> wrote:Am 26.07.2016 um 05:22 schrieb Puming:dOn Monday, 25 July 2016 at 09:29:38 UTC, S=C3=B6nke Ludwig wrote:A real runtime solution would require a D runtime interpreter or JIT compiler. There would be an alternative solution based on compiling each template to a shared library and then dynamically recompiling/reloading those as required, but that currently doesn't work due to the alias parameter based interface of render!(...). However, what should work well is a combination of https://github.com/dlang/dub/pull/446 and https://github.com/rejectedsoftware/vibe.d/pull/1385 - I'll merge the latter one into vibe.d master today. It will require to store session information and similar things in an external store, and on Linux the Gol=The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade <http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements, and everything that can be done at compile-time is done at compile-time. [...]A feature I want the most for Diet is the ability to parse Diet templates at RUNTIME instead of compile time with a switch, similar to Regex/CtRegex. In this way one can do quick turnarounds in dev mode, tweaking little corners of the pages, and then when a page is finished, it can be switched to compile mode for faster render time. Do you think this is feasible?linker should be used for speed, but then it should be almost as good as =aruntime solution.!! nice, this is going to make my work life so much easier. Thanks S=C3=B6nke!
Jul 25 2016
On Tue, Jul 26, 2016 at 7:54 AM, S=C3=B6nke Ludwig < digitalmars-d-announce puremagic.com> wrote:[snip]and on Linux the Gold linker should be used for speed, but then it shouldbe almost as good as a runtime solution.Note on using Gold on linux. You can use lflags "-fuse-ld=3Dgold", to get d= ub to link your project using gold if you are using dmd.
Jul 25 2016
On Tuesday, 26 July 2016 at 05:54:39 UTC, Sönke Ludwig wrote:Am 26.07.2016 um 05:22 schrieb Puming:Thanks!Shared lib reloading is good. Looking forward to it fully working :-)[...]A real runtime solution would require a D runtime interpreter or JIT compiler. There would be an alternative solution based on compiling each template to a shared library and then dynamically recompiling/reloading those as required, but that currently doesn't work due to the alias parameter based interface of render!(...). However, what should work well is a combination of https://github.com/dlang/dub/pull/446 and https://github.com/rejectedsoftware/vibe.d/pull/1385 - I'll merge the latter one into vibe.d master today. It will require to store session information and similar things in an external store, and on Linux the Gold linker should be used for speed, but then it should be almost as good as a runtime solution.
Jul 25 2016
Am 26.07.2016 um 07:54 schrieb Sönke Ludwig:However, what should work well is a combination of https://github.com/dlang/dub/pull/446 and https://github.com/rejectedsoftware/vibe.d/pull/1385 - I'll merge the latter one into vibe.d master today.I decided against putting it into vibe.d and instead re-implemented it for diet-ng. It is available in 1.0.0-beta.1 now. See the README section for a description: https://code.dlang.org/packages/diet-ng
Jul 28 2016
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade <http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements, and everything that can be done at compile-time is done at compile-time. Vibe.d still contains the original implementation, which was written around the limitations of DMD's CTFE engine back years ago, and is basically a monolithic parser+generator with little flexibility and a number of convenience features missing, because of their implementation complexity. The new implementation has been rewritten cleanly, with separate parser, modifier and generator modules, working on a common DOM tree intermediate representation. The major new features/improvements are: - No external dependencies other than Phobos - Supports inline and nested tags syntax - Supports string interpolations within filter nodes (falls back to runtime filters) - Supports AngularJS special attribute names - Extensible/configurable with traits structures - Uses less memory during compilation (this one was a real surprise) - (Unit) tested from the start - Supports arbitrary uses other than generating HTML, for example we use it similar to QML/XAML for our internal UI framework The API documentation can be shown ba running DUB: dub fetch diet-ng --version=1.0.0-alpha.2 dub run diet-ng -b ddox You can try the library directly, or together with the latest alpha release of vibe.d (0.7.30-alpha.3). Simply add a dependency to "diet-ng", version "~>1.0.0-alpha.2". Vibe.d will automatically re-route render!(...) calls to diet-ng. A small example with just the most essential features is shown in the README: https://code.dlang.org/packages/diet-ng More complex real-world examples: https://github.com/rejectedsoftware/vibed.org/tree/master/views https://github.com/rejectedsoftware/ddox/tree/master/views Any comments/requests regarding the feature set or API are highly welcome!Great stuff! Very much appreciated. Btw, the link to jade-lang.org (don't click!) leads to a dodgy business homepage atm. The right address is http://jade-lang.com/
Jul 28 2016
On Thu, Jul 28, 2016 at 3:26 PM, Chris via Digitalmars-d-announce < digitalmars-d-announce puremagic.com> wrote:Great stuff! Very much appreciated. Btw, the link to jade-lang.org (don't click!) leads to a dodgy business homepage atm. The right address is http://jade-lang.com/Also: https://github.com/pugjs/pug/issues/2184
Jul 28 2016
On 29/07/2016 1:57 AM, Rory McGuire via Digitalmars-d-announce wrote:On Thu, Jul 28, 2016 at 3:26 PM, Chris via Digitalmars-d-announce <digitalmars-d-announce puremagic.com <mailto:digitalmars-d-announce puremagic.com>> wrote: Great stuff! Very much appreciated. Btw, the link to jade-lang.org <http://jade-lang.org> (don't click!) leads to a dodgy business homepage atm. The right address is http://jade-lang.com/ Also: https://github.com/pugjs/pug/issues/2184Hehehehe, I was wondering when this would come up :) They are only like 2.5km away from me.
Jul 28 2016
Am 28.07.2016 um 15:26 schrieb Chris:On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:Oh, dang! Thanks for mentioning this. Fortunately I copy/pasted the right link to the README.The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade <http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements, and everything that can be done at compile-time is done at compile-time. Vibe.d still contains the original implementation, which was written around the limitations of DMD's CTFE engine back years ago, and is basically a monolithic parser+generator with little flexibility and a number of convenience features missing, because of their implementation complexity. The new implementation has been rewritten cleanly, with separate parser, modifier and generator modules, working on a common DOM tree intermediate representation. The major new features/improvements are: - No external dependencies other than Phobos - Supports inline and nested tags syntax - Supports string interpolations within filter nodes (falls back to runtime filters) - Supports AngularJS special attribute names - Extensible/configurable with traits structures - Uses less memory during compilation (this one was a real surprise) - (Unit) tested from the start - Supports arbitrary uses other than generating HTML, for example we use it similar to QML/XAML for our internal UI framework The API documentation can be shown ba running DUB: dub fetch diet-ng --version=1.0.0-alpha.2 dub run diet-ng -b ddox You can try the library directly, or together with the latest alpha release of vibe.d (0.7.30-alpha.3). Simply add a dependency to "diet-ng", version "~>1.0.0-alpha.2". Vibe.d will automatically re-route render!(...) calls to diet-ng. A small example with just the most essential features is shown in the README: https://code.dlang.org/packages/diet-ng More complex real-world examples: https://github.com/rejectedsoftware/vibed.org/tree/master/views https://github.com/rejectedsoftware/ddox/tree/master/views Any comments/requests regarding the feature set or API are highly welcome!Great stuff! Very much appreciated. Btw, the link to jade-lang.org (don't click!) leads to a dodgy business homepage atm. The right address is http://jade-lang.com/
Jul 28 2016
On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade <http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements,Is "Diet template" a D/Vibe unique language? I can't find anything to contradict that view, but just wanted to sure. Every time I try and look it up on google, it takes me to weight loss stuff :) Good name though.
Jul 28 2016
Am 28.07.2016 um 20:07 schrieb WhatMeWorry:On Monday, 25 July 2016 at 09:29:38 UTC, Sönke Ludwig wrote:Yes, it started out as vibe.d exclusive (now it's properly decoupled from it). For Google it's probably not popular enough, atm, but I've registered diet-lang.org, which should help a lot once it gets filled with content.The Diet template language is aimed at providing a way to define procedurally generated HTML/XML pages (or other output formats), with minimal visual noise. Syntax and feature set are heavily inspired by Jade <http://jade-lang.org/>, but instead of JavaScript, all expressions and statements are D statements,Is "Diet template" a D/Vibe unique language? I can't find anything to contradict that view, but just wanted to sure. Every time I try and look it up on google, it takes me to weight loss stuff :) Good name though.
Jul 28 2016
Talking about diets, will reShop[1] be available for Android an iOS too? You could extend it by adding "health tips" (add fruit & veg automatically), a calorie counter (for single items and the whole list) ;) http://rejectedsoftware.com/products/reshop
Jul 29 2016
Am 29.07.2016 um 13:28 schrieb Chris:Talking about diets, will reShop[1] be available for Android an iOS too? You could extend it by adding "health tips" (add fruit & veg automatically), a calorie counter (for single items and the whole list) ;) http://rejectedsoftware.com/products/reshopYeah, diet/health tips are always a hot topic, I think we even talked about something like that at some point ;) Porting it to those platforms was the initial idea. But since both BB10 and WP are more or less dead now, the main feature of providing full cross-platform synchronization of the lists became a moot point (there are plenty of solutions for Android/iOS already). And then it also really was just a little test project anyway.
Jul 29 2016