News for hackers. Stuff that matters.
Re:The Wyvern Programming Language by chrismorgan on Friday August 08, 2014 @02:30AM (#8151745)
Compile-time HTML parsing, &c.? Absolutely. This sort of thing is part of why I came to Rust; while it doesn’t make these sorts of things as easy as it looks like Wyvern does, it does make them readily possible (the pragmatic side of me also selected it as it’s ). I will be featuring some of the ideas of these sorts of things in my talk at Strange Loop next month (https://thestrangeloop.com/sessions/fast-secure-safe-the-web...), and a brief look at this suggests that I’ll be mentioning Wyvern.
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).

Re:The Wyvern Programming Language by mrec on Friday August 08, 2014 @08:55AM (#8152533)
> (the pragmatic side of me also selected it as it’s )

I think you accidentally a word.

I'm also very interested in Rust. Still has a lot of rough edges, but it's the first new language I've seen in a long term that really feels ambitious. Ambitious as in raising the state of the art (memory-safety without GC is a big deal); ambitious as in aiming at big scary problems. The fact that your language can express quicksort or Fibonacci nicely isn't that interesting. The fact that you're planning to build a portable, performant, secure web browser in it tells me you're serious.

Re:The Wyvern Programming Language by chrismorgan on Friday August 08, 2014 @11:16PM (#8156111)
Oh yes. It selected it as it’s gaining popularity and looks to me likely to reach a critical mass for mainstream usage.

There have been plenty of great languages in which you can express things marvellously well, but for the most part they remain obscure. Although Rust is not the most powerful language around for some of the things I want to do, it’s sufficiently powerful and backing what already looks to be a winner means that the ideas will actually get used.