4 ms·
After learning lisp, I just feel like every other language is a weird set of macros. Looking at this AST confirms that. Wish I could live the rest of my life i
by yjgyhj 11y ago
After learning lisp, I just feel like every other language is a weird set of macros. Looking at this AST confirms that.
Wish I could live the rest of my life in Sexp-land.
- vmorgulis 11y agoThere is other interesting homoiconic languages like Rebol (brackets instead of parens and more whitespaces). I could add a stack-based language like Factor too.
- dang 11y agoBoy do I know how you feel. So many things that used to seem interesting and deep to me (often involving syntax or parsing or data formats) now feel like busywork and noise. Or like I'm visiting a land where everyone wears extra layers of heavy, stiff clothing and speaks in long circumlocutions. I feel claustrophobic and can't wait to get back to Sexp-land where I can breathe. Some of it's just habit, of course, but the lightness and simplicity also seem objective to me. It becomes hard to understand why everyone else keeps jumping through all those pointless hoops, you get ever more impatient and irritable with it all, and one day you fall prey to full smugweeniness.
- stormbrew 11y agoOf course, the sentiment in this reply could probably have been expressed with far less text and/or syntax (probably in less than a tweet even). IMO people prefer to communicate with some nuance and some degree of redundant expression. Terseness is itself even a kind of nuance when you're allowed to not use it. Drives for widespread purity in language never seem to pan out, in either human<->human communication or human<->computer communication. I suspect there are reasons for this that might be somewhat under-researched.
- yjgyhj 11y agoYour opinion is just as valid. Can't say syntax is _simpler_ than s-expressions though. But so is ASM.
- dang 11y agoWell, let me see. Conversation isn't code, natural language isn't programming language, I don't think I care about "purity in language", and I'm pretty sure I can make a case for everything in my comment needing to be there. I do agree that people often desire to make things more complicated than they need to.
- stormbrew 11y agoExplain in more detail why code isn't conversation? You are communicating a set of expectations about what a computer should do to both the computer and other humans who either read it or interact with it.
- dang 11y agoWhat I said is that conversation isn't code. Not a commutative statement! That is, you seemed to be arguing that there was redundancy in my comment, similar to what I called busywork and noise in code. An interesting point, but my comment was conversation—not code—so it struck me as a non sequitur. Your comment hints at an insight into why we make code overcomplicated. But the superfluous complexity I'm talking about rarely strikes me as nuance, i.e. valuable enhancement for humans. It's mostly boilerplate to satisfy machines. It's no accident that "Programs must be written for people to read, and only incidentally for machines to execute" is a line that came out of the Lisp mentality.
- yjgyhj 11y agoLook then at human languages - two of the giants are English and Spanish. Both pretty simple. Definitely they both are the most spoken as second language. They would not have that position if it was not for their simplicity, compared to other languages. Mandarin is an outlier in that comparison - but also not popular as a second language.
- mkehrt 11y agoEnglish and Spanish hold their positions as popular languages based on the fact they were both spoken in world spanning empires in the past, not because they are particularly simple. English, in particular, is known for being difficult to learn--it uses phones that very rare ("th" and the English "r"), it has a bizarrely large vocabulary, and, somewhat separately, its spelling is nonsensical.
- deleted 11y ago[deleted]
- JBReefer 11y agoYour are correct about the cause of dominance, but Spanish is absolutely the most simple language in large use.
- nickbauman 11y agoYeah, wow, such complicated! Brings to mind the Rich Hickey quote "There's no syntax you will ever devise that will beat pure data".
- dandrews 11y agoContrast with Bill Gosper's quote from Levy's Hackers: "Data is just a dumb kind of programmihg."
- chriswarbo 11y agoSeeing this "dump AST" option for Swift is truly refreshing. I've come to the opinion that when sending data in or out of software, it should always preserve as much structure as possible in an easily parseable form accessible to off-the-shelf parsers; e.g. s-expressions, JSON or, if it can't be avoided, XML. Even thrown-together debugging messages. Basically I should be able to reconstruct all of the structure in basically any programming language with something like one module import and a function call (or equivalent); I shouldn't have to define my own parsing rules, no matter how simple their author thinks they are. Not only this, but any format which, for some reason, cannot be represented in this way, e.g. programs in languages which consciously avoid s-expressoins, should pass through a layer which does convert to a structured form, and this form should be obtainable, e.g. by setting an environment variable or a commandline flag. That's why I commend this "dump AST" flag. It's basically the opposite of the many "Lisp-on-top-of-X" approaches. Instead of being able to write s-exprs which translate to some underlying language, like Swift, I should be able to translate any Swift into s-exprs to be manipulated. Why? Because there will always be strictly less code written in a Lispy language than there will be for the underlying platform as a whole. For example, there will always be less code written in Clojure than code written for the JVM. The benefits of s-expressions (and accessible AST structures in general) is that they can be inspected, transformed, manipulated, pulled apart, recombined, etc. This is of some use when programming, e.g. having macros manipulate our Clojure ASTs, but not a huge amount; after all, we could write our code in a different way which didn't need the macros (we could even, in principle, write it in Java!). In contrast, being able to manipulate code which isn't ours is much more useful; since we don't have the option of writing it a different way (since we didn't write it at all!).
- westoncb 11y agoInteresting. I've been thinking about an alternate way of structuring programming tools that's along these lines. I've written about it here: http://westoncb.blogspot.com/2015/06/how-to-make-view-independent-program.html http://westoncb.blogspot.com/2015/06/how-to-make-view-indepe...
- chriswarbo 11y ago