Arc Forumnew | comments | leaders | submitlogin
2 points by rocketnia 4892 days ago | link | parent

Nope, you're not understanding me yet. XD I think the root of it is that when you ask whether a language that "targets a platform other than its runtime" is "the same as a language with a cross-compiler," you're misinterpreting what I mean by "target." Possibly "platform" too.

As for "platform," if there's something that's nontrivially programmable, I consider it to be a platform. The thing that establishes the identity of a platform is the range of programs that's possible staying within its own practical limitations and following its rules. Adding rules lets you make platforms that embody the features several platforms have in common, as when developing for multiple Web browsers. One platform can be a program running in another (like Arc in Racket), which means its space of possible programs is no bigger than its host's, but it may also have fewer limitations and rules than its host, thanks to new frameworks it introduces and new ways it implements its host's features. A platform can be another platform with extra assumptions made about its state, like the assumption that a particular other process is available to communicate with. This is a bit of a digression, and I'm sure I haven't found all the kinds of platform families, but I'll leave it here 'cause it's thought-provoking. :)

By the idea of a language "targeting" a platform, all I mean is for that language to be good for developing that platform's programs. For instance, a DSL in Arc might be better for writing JavaScript than JavaScript itself is, if only because of syntax differences. Generating a bit of code using that DSL is a good way for Arc to "target" JavaScript, but it isn't the same thing as compiling a whole Arc program into JavaScript.

However, given that DSL, it would be reasonable to develop JavaScript applications using nothing but the DSL, with just enough Arc code to handle importing the DSL library and outputting the resulting files. In this case, arguably, "the whole thing" is cross-compiled to JavaScript, with the DSL library acting as that that cross compiler. When doing this kind of programming, it's irrelevant whether Arc itself is a language with a cross compiler, 'cause we only need to run Arc on one machine, the development machine we're using to produce the JavaScript code.

But that kind of programming is exactly what the languages I'm talking about would focus on. The libraries would be syntax tools and compilers, and the applications would be written in mashed up DSLs. The techniques would apply to all these languages, regardless of how each of them was built internally.

(The techniques also apply to other existing languages, but the difference is that I think those languages have overall designs and philosophies that don't play well with this coding style.)