News for hackers. Stuff that matters.
Re:Ask HN: LISPers, do you use homoiconicity (code-as-data)? by kehrin on Saturday January 23, 2021 @08:55PM (#25888214)
I'm new to LISP but the way Hiccup (https://github.com/weavejester/hiccup) in Clojure allows to embeds HTML in Clojure code feels really powerful.
Re:Ask HN: LISPers, do you use homoiconicity (code-as-data)? by jarjarbinks455 on Monday January 25, 2021 @12:04PM (#25905663)
Yeah I think HTML is a good exams of a domain spec language. Instead of putting HTML in a dead string it can be in a parsible lisp object can be manipulated with editor commands. Of course you can do the opposite and have HTML file with lisp code embedded. Ie like a jsp in Java. But with lisp all this is at your finger tips. You don't need to wait for a big billionaire company to make html syntax for you. Or unit test supported at the language level. Or whatever
Re:Ask HN: LISPers, do you use homoiconicity (code-as-data)? by db48x on Tuesday January 26, 2021 @12:11AM (#25912816)
Embedded SQL is also quite common.
Re:Ask HN: LISPers, do you use homoiconicity (code-as-data)? by harperlee on Tuesday January 26, 2021 @07:20AM (#25914977)
Yes but in my experience (with korma, which I don't like) I've not used a lot of programmatic modification of SQL queries. At the end of the day, I write a query for "a data question", and I add parameters to the question, but it is rare for me that I need to "create new types of questions" on the fly.

Even if I need to compose a query for a more flexible questioning than using a value parameters, this is something that typically could be done by combining 2 or 3 substrings, there is not typically the need to work queries as much as I do with HTML and hiccup.

So at the end I moved to HugSQL (the modern+popular "write your queries in SQL"-philosophy library) instead of YesQL (the modern+popular "write your queries in clojure"-philosophy library, similar in approach to korma).

Re:Ask HN: LISPers, do you use homoiconicity (code-as-data)? by db48x on Tuesday January 26, 2021 @07:43AM (#25915170)
Yes, sometimes that suffices. Other times you have to translate an ad–hoc query language encoded in the query parameters of a url into SQL queries, and then it would be really nice to have some way of manipulating them other than just string concatenation. That's a month of my life I’ll never get back.
Re:Ask HN: LISPers, do you use homoiconicity (code-as-data)? by harperlee on Wednesday January 27, 2021 @03:10AM (#25925560)
Ok, fair point, you don’t need it until you need it and you wish you had it :)