Earlier quoted context omitted.
Can you explain it? For instance in IntelliJ I can refactor and have it automatically replace only instances of the word "call" that are actually invocations of the function call(). That's structured editing, not text-based.
Yea, that's true, but your editor pane is a text editor non the less. The refactoring in this case is structured, even more so, its semantically accurate to a specific language. But your editor isn't. A structural editor does not allow you to make edits that would go against the syntax rules of your language.
Just what does “code as data” mean anyway? (2014)
171–178 of 178 posts
Re: Just what does “code as data” mean anyway? (2014)
#172Earlier quoted context omitted.
Can you explain it? For instance in IntelliJ I can refactor and have it automatically replace only instances of the word "call" that are actually invocations of the function call(). That's structured editing, not text-based.
Yea, that's true, but your editor pane is a text editor non the less. The refactoring in this case is structured, even more so, its semantically accurate to a specific language. But your editor isn't. A structural editor does not allow you to make edits that would go against the syntax rules of your language.
Re: Just what does “code as data” mean anyway? (2014)
#173Earlier quoted context omitted.
> So that every edit performed would result in valid syntax after they are performed. Valid syntax, not working code, not code that semantically make sense, just the syntax is valid within the syntax rules. As I said. Dumb tool for basic syntax manipulation is elevated to godlike status. After which you end up with dumb statements like these: - editor modes like paredit let you edit in terms of the structure of your…
All true and factual statements. It doesn't matter if you judge them dumb or not. > and other stuff that means exactly one thing: "our language doesn't have any other/proper tools, so we pretend our parens matcher is the best thing since sliced cheese" You're operating in the hive mind mentality of us vs them. I'm talking objectively about syntax families and types of editors. You'll probably keep being downvoted as…
Basically the stuff Lisp IDEs had in the 70s.
Re: Just what does “code as data” mean anyway? (2014)
#174One of the greatest lies that Lispers have is: "Lisp has no syntax". Syntax is defined as "the structure of statements in a computer language." What Lisp has, and is, is a syntax to describe an AST. If you get the syntax wrong, your program won't run. And even that syntax isn't uniform across the various Lisps (some will throw in weird chars and constructs here and there to make dealing with common structures easier…
It's wrong, Lisp has a lot of syntax.
> What Lisp has, and is, is a syntax to describe an AST.
That's wrong, too. Lisp syntax does not describe an AST.
> To me, it's a chain of 5 functions which are neither shorter to write nor better than Java's jOOQ [1]:
That's not the point, the Lisp version is on another level:
* it does not expose its implementation
* the macro allows to translate this code at something like compile time
The Java code is a bunch of function invocations which create a string. Usually at runtime.
Re: Just what does “code as data” mean anyway? (2014)
#175Earlier quoted context omitted.
All true and factual statements. It doesn't matter if you judge them dumb or not. > and other stuff that means exactly one thing: "our language doesn't have any other/proper tools, so we pretend our parens matcher is the best thing since sliced cheese" You're operating in the hive mind mentality of us vs them. I'm talking objectively about syntax families and types of editors. You'll probably keep being downvoted as…
> If you are curious, for example, given Clojure as the Lisp syntax language, Emacs does offer code refactoring and linting as well as structural editing. You can extract functions, auto-complete imports, rename variables, fold code blocks, have syntax errors highlighted, have certain code errors reported on the fly, jump to definition, see source and documentation, find all usage, auto-complete, snippets, auto-forma…
Re: Just what does “code as data” mean anyway? (2014)
#176Earlier quoted context omitted.
> If you are curious, for example, given Clojure as the Lisp syntax language, Emacs does offer code refactoring and linting as well as structural editing. You can extract functions, auto-complete imports, rename variables, fold code blocks, have syntax errors highlighted, have certain code errors reported on the fly, jump to definition, see source and documentation, find all usage, auto-complete, snippets, auto-forma…
I'm unfortunatly not old enough to know. But I've heard a lot of praise for the era of Lisp machines. It's unfortunate that most of that legacy has been lost. Common Lisp doesn't actually offer that much in terms of tooling, at least, in the free department that I've tried.
Generally Lisp still offers a lot, but if you don't know what to look for, you might not see it even if it is before your eyes. Even though the Clojure community reimplemented much of SLIME.
It also might not be important to you. Stuff like having a Lisp compiler written in Lisp, having an actual interpreter, being able to dump images, low startup times by default, break loops, readable stacktraces, type checking compilers, resumable error handling, embedding in C applications, whole-program compilers, compilers which can create C code, ...
Re: Just what does “code as data” mean anyway? (2014)
#177Earlier quoted context omitted.
That was just an example. In general, those representations are not the same. Structurally.
They're only not the same when one is in Lisp and the other isn't. E.g. you load "infix.cl" into your Common Lisp so that you then have the #I read macro that gives you #I( f(x, y) ), then they are the same. This just denotes (f x y). It would be suboptimal for that to be any other way: https://www.cs.cmu.edu/Groups/AI/lang/lisp/code/syntax/infix... Now let's think about how silly it is to try to write a let block us…
Re: Just what does “code as data” mean anyway? (2014)
#178Earlier quoted context omitted.
>>Sounds like your experience was with Emacs Lisp, a very clunky Lisp. Emacs lisp is actually a very practical, easy to use and fun lisp to do a lot of great work in. Richard Matthew Stallman notes: It was Bernie Greenberg, who discovered that it was (2). He wrote a version of Emacs in Multics MacLisp, and he wrote his commands in MacLisp in a straightforward fashion. The editor itself was written entirely in Lisp. M…
Please do not conflate MacLisp and Emacs Lisp, they are different languages. GNU Emacs is not directly derived from Multics Emacs, it's one of the many reimplementations of the original Emacs. The closest thing to MacLisp today is actually Common Lisp, and it's much more advanced than Emacs Lisp, which is not surprising considering that Stallman was not interested in creating a state-of-the-art Lisp implementation wi…
I think you could make the argument that Emacs Lisp is as close. Emacs Lisp has some major similarities with Maclisp that CL doesn't share (like in variable scoping and obarrays and such). Elisp and CL are both very close relatives of Maclisp; Elisp was designed as a mini-Maclisp for a text editor, whereas Common Lisp was designed as Maclisp's successor.