4 ms·
If that is something that you are interested in then you should definitely take a look at Nimrod (if you haven't already; http://nimrod-lang.org http://nimrod-l
by dom96 12y ago
If that is something that you are interested in then you should definitely take a look at Nimrod (if you haven't already; http://nimrod-lang.org http://nimrod-lang.org). Nimrod's compile-time features are what makes it great, you can essentially run most Nimrod code at compile-time (ffi is limited but you can use staticRead if you wanna read your HTML templates). From a quick look at Wyvern it actually looks surprisingly similar to Nimrod, so much so that i wonder if Wyvern was perhaps a little bit inspired by it. I'm having a hard time figuring out what differentiates Wyvern from Nimrod in fact.
- cyrus_ 12y ago(I work on Wyvern) Nimrod is quite interesting to us too, though I don't know that it was at the forefront of our minds. Convergent evolution perhaps. I don't believe Nimrod supports type-specific languages or other sorts of extensible parsing (see first paper on the webpage).
- dom96 12y agoI unfortunately don't have the time to read the whole paper or even the knowledge to understand most of the things written in it unfortunately. But as far as I can tell these "type-specific languages" are possible in Nimrod. The most basic tool is probably the "distinct type" (http://build.nimrod-lang.org/docs/manual.html#distinct-type http://build.nimrod-lang.org/docs/manual.html#distinct-type). Macros can then be used to create DSLs for HTML generation, and they already exist (http://build.nimrod-lang.org/docs/htmlgen.html http://build.nimrod-lang.org/docs/htmlgen.html).
- chrismorgan 12y agoRust doesn’t have regular straightforward CTFE (though I’ll admit freely it’d be nice to have), but it does have compile-time procedural macros, so that I can write a simple macro which will take HTML tokens in some DSL or as a string and with the help of the html5ever crate (which can be loaded as a dependency of this compiler plugin as well as of the resulting binary), produce the final tree, or for that matter do anything else with it that I like.
- dom96 12y agoNimrod has that too and as far as I know it's a lot more straightforward to use in Nimrod than it is in Rust.