Earlier quoted context omitted.
Not to be pedantic, but Fortran 1-based array indices are from Fortran 66 and earlier. Fortran 77 and on include the ability to index from any arbitrary integer, including negative ones. You can declare a 21 element array indexed from -10 like so: real x(-10:10) So hopefully anyone familiar with Fortran isn't hung up on 1-based indices.
> "N̶o̶t̶ to be pedantic, [...]"
Julia, I Love You
41–44 of 44 posts
Re: Julia, I Love You
#42Earlier quoted context omitted.
Disclaimer: I don't know anything about Julia, except from reading a couple simple programs just now, and seeing that it uses syntax that looks somewhat like Algol. I don't think there's any inherent contradiction between the two, depending on what you mean by "the power of homoiconicity" (1). Homoiconicity doesn't mean you need to use lists: you could make a language like C but with native structures to hold all of…
A DOM would give the benefits of homoiconicity, though the quote is We want a language that’s homoiconic . As an example, recent versions of Java include the compiler in Java, and therefore the classes for the AST (though undocumented). That's a DOM; you can use it to implement macros. (There's also ANTLR and BCEL to do AST twiddling - just consider them part of the standard classes of a Java variant). But I think to…
public class HelloWorldApp {
public static void main(String args[]) {
System.out.println("my class name is: " + HelloWorldApp.Ast.Name);
System.out.println("i have " + HelloWorldApp.Ast.Methods.Length + " method(s)");
}
}
then I would consider that "homoiconic": the things I'm defining are objects in the language itself. It doesn't sound like Java does that. My guess is that the AST is only available for text you pass to the compiler at runtime.That's a problem, in Java: the compilation model is so constrained that even if you could write this, I don't think you could use it to make macros, since there's no way to control "read-time" versus "compile-time" versus "run-time" as you can in Lisp. So perhaps homoiconicity isn't enough: you need that, plus something like EVAL-WHEN.
Re: Julia, I Love You
#43Earlier quoted context omitted.
A DOM would give the benefits of homoiconicity, though the quote is We want a language that’s homoiconic . As an example, recent versions of Java include the compiler in Java, and therefore the classes for the AST (though undocumented). That's a DOM; you can use it to implement macros. (There's also ANTLR and BCEL to do AST twiddling - just consider them part of the standard classes of a Java variant). But I think to…
Good point. I guess I'd agree that it "has to be those symbols", but not that it has to be a Lisp. I don't know Java's new AST classes, but if I could say something like: public class HelloWorldApp { public static void main(String args[]) { System.out.println("my class name is: " + HelloWorldApp.Ast.Name); System.out.println("i have " + HelloWorldApp.Ast.Methods.Length + " method(s)"); } } then I would consider that…
You're right that the AST is available only for passed text; I hadn't thought of that as a limitation, but you're right. I was thinking of macros, that you define and manipulate within a program: the limitation doesn't affect this use case. Doing it this way, you also get control of {read,compile,run}-time.
I think it's fair to say there are degrees of homoiconicity; you can get some of the benefits by having just a subset of the features. I conject that "a language with full homoiconicity" is identical with "a lisp" - but it doesn't really matter, if we're interested in benefits.
Re: Julia, I Love You
#44I'm actually especially interested in taking the [web server]( https://github.com/chzyer/JuliaWebServer ) and building out a lean-and-mean MVC framework. Though it's designed as a scientific language, their goals of having C-like speed and yet Ruby-like beauty make it the perfect target for such a project. Anyone else interested in trying it out with me?
The idea of a dynamic Ruby-like language with C-like performance reminds me of Avi Bryant's talk "Bad Hackers Copy, Great Hackers Steal" : http://vimeo.com/4763707 He explains that dynamic languages are not inherently slow. It's their current implementation that's slow. Java is not fast thanks to static typing, it is fast thanks to the Hotspot VM, which builds upon the StrongTalk VM implementation. Quote taken around…