3 ms·
This came from a thought I had after posting https://news.ycombinator.com/item?id=18312529 https://news.ycombinator.com/item?id=18312529 Any feedback is greatl
by taeric 8y ago
This came from a thought I had after posting https://news.ycombinator.com/item?id=18312529 https://news.ycombinator.com/item?id=18312529
Any feedback is greatly welcome. Both in areas I have wrong in the programming, and in general presentation. Thanks!
- basil-rash 8y agoOnly tiny comment is that your syntax highlighting makes the names in function definitions almost impossible to read.
- taeric 8y agoThanks! I think it picked up the theme i had active at the time. Will pick a different one when back at that computer.
- taeric 8y agoTo circle back on this, I found that I have a bit of bad interaction between some overrides of the CSS I did and the "htmlization" of my buffers to make the output. 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!
- meken 8y agoGreat post! A few observations. - 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.
- fiddlerwoaroof 8y agoOne thing I’ve done recently in Common Lisp with macros was write a suite of macros to make working with objective-c in Common Lisp less burdensome: with a couple reader macros, I can almost copy-paste objective-c code samples into my Common Lisp program and have them work.
- fiddlerwoaroof 8y agoAlso, some of the biggest complaints about redux and other JavaScript libraries is the amount of boilerplate you have to write, leading to really complicated scaffolding and code generation utilities: Babel, for example, is essentially just a big macroexpander for JavaScript enabling, among other things, the use of language features as soon as they are standardized rather than having to wait years until a sufficient portion of the available browsers support the new feature.
- pflanze 8y ago> One could write the same code in python/javascript with using lists and strings and recursion in a similar way, no? 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).
- myWindoonn 8y agoThe homoiconicity is important. Python and ECMAScript (don't use "JavaScript", it's a trademark of Oracle's) are not homoiconic. Consider this Monte translation of OP's blog post: https://github.com/monte-language/typhon/blob/master/mast/fun/symbolic.mt.md https://github.com/monte-language/typhon/blob/master/mast/fu... The main feature present in Lisps and in Monte but not in Python nor ECMAScript is quasiquotation. ES has template literals, and Python 3 has f-strings, but neither language can use them for pattern-matching, only value-building.
- taeric 8y ago
- S4M 8y agoNot really a feedback, but I wrote something very similar a bit more than two years ago: http://eskatrem.github.io/Newton-Raphson.html http://eskatrem.github.io/Newton-Raphson.html
- taeric 8y agoThat is a much more comprehensive treatment! For anyone that is curious on how you could inspect a program in python, I think that is a great article to compare the two. (Indeed, I didn't know the syntactic tree api.)