News for hackers. Stuff that matters.
Re:The Wyvern Programming Language by dom96 on Friday August 08, 2014 @02:55AM (#8151791)
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). 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.
Re:The Wyvern Programming Language by chrismorgan on Friday August 08, 2014 @11:23PM (#8156123)
Rust 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.
Re:The Wyvern Programming Language by dom96 on Saturday August 09, 2014 @10:33AM (#8156955)
Nimrod has that too and as far as I know it's a lot more straightforward to use in Nimrod than it is in Rust.
Re:The Wyvern Programming Language by cyrus_ on Friday August 08, 2014 @10:52AM (#8153016)
(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).
Re:The Wyvern Programming Language by dom96 on Friday August 08, 2014 @07:01PM (#8155543)
I 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). Macros can then be used to create DSLs for HTML generation, and they already exist (http://build.nimrod-lang.org/docs/htmlgen.html).