Any feedback is greatly welcome. Both in areas I have wrong in the programming, and in general presentation. Thanks!
Any feedback is greatly welcome. Both in areas I have wrong in the programming, and in general presentation. Thanks!
- It seems like the difficulty level ramps up really quickly starting with the "So, what makes the lisp example different?" section. This was jarring enough that I pretty much glossed over it (too much effort required to process all the definitions at once).
As a more meta point, I wonder if symbolic differentiation is in fact a good example of highlighting lisp's differentiating features? One could write the same code in python/javascript with using lists and strings and recursion in a similar way, no?
Not that I have a better example to highlight lisp's differences, which I understand to be macros. I've read SICP and have written a fair amount of elisp and still have not once identified a good use case for writing a DSL nor even a macro for myself.
Then you're implementing a Lisp (just one with square instead of round brackets, and commas between list elements) within Python/JS.
Edit: to explain, you also need to either translate the result of the derivation back into Python/JS code (via stringification and eval or perhaps AST manipulation--i.e. a compiler of the list structures (Lisp) to Python/JS), or write an interpreter for the list structures (i.e. Lisp interpreter).
I think you could write something in other languages, but it would likely be incumbent to you to lex/tokenize the data. And then to convert back to a string to send back to eval.
You can also do something similar with annotation processing in Java. Or the macro languages in newer languages. Much more difficult to me, though.
For highlighting the features, I don't know of much. I like lisp because i find it fun. In large from the parsimony of the language. Though, i think it is layered in ways we often gloss over in that phrase.
That point is made in the article. You'd need to invent a language for writing the formulas as strings, and handle it with a scanner, parser (for which you pick an output tree format). Then do the differentiation on the tree format, and finally reformat the transformed code back to a string to be passed to the character-based "eval".
Regardless, did a quick rerun with a theme that should have been a bit more compatible. Will have to see about fully fixing up the general export some time. Again, thanks for the feedback!