Hacker News new | past | comments | ask | show | jobs | submit login

Text is the universal interface. It's the Way of Unix. As far as showing/hiding this kind of thing, vim at least can collapse function definitions, I'd be suprised if other editors could not.



Hypertext-like linking and hiding is so universal nowadays, why do we have to parse whatever language just to achieve it? That's a lot of complex programming work we could avoid, and channel that effort into making cooler tools.

(It's not just parsing. We have to write little tools to take the parsed code, then infer relationships within it. Why not just make explicit links?)


Are you trying to say that we wouldn't have to parse hypertext? I'm sorry, I'm not understanding your argument.


We'd only have to write parsers for the hypertext, not N different parsers for the various languages.

Think about what happens. Your IDE parses your source code so that it can do things like highlighting, identifying senders, code folding, etc. It does this so that you as a programmer can use those tools to more easily parse it in your head to understand it. Eventually, your code is interpreted or compiled, which involves another parsing.

Why not just have a direct representation of the program and its interrelationships? Languages where the compiler/interpreter make the AST available go a part of the way there. But too many of the interrelationships are implicit, requiring a program to do some sort of searching/indexing/parsing to make available. Why not just represent those directly, and have source code be a representation?

If we could make such a representation, we might even be able to transcend the tyranny of particular languages. (Multi language VMs are somehow related here.)


I'm not sure what advantages a language in this form would have. Why bother mandating that it be stored like this in some way? Storing programs as text like we do now would enable a tool to display code just as you suggest, just check out the many code-to-html tools that are available.

I'm also not sure why I'd care that my tool parses the code to do those things for me, nor why having my brain parse the code matters in particular. If you're arguing for Lisp's "code as AST" syntax, well, that's fine by me, but I don't think it's a neccesity. Macros work best with sexps, it's true, but I've never found, say, Ruby's metaprogramming to be wanting for Lisp-style macros.

Also, I'm firmly against the One True Language way of thinking. See, for instance, Python vs. Ruby as a great example of why nobody will ever be happy with One Language to Rule Them All. They're so close to each other, yet their small differences cause so much argument between the two camps.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: