Live data from Hacker News

HCSL: Hand coded stringy lisp

github.com

51–60 of 61 posts

Re: HCSL: Hand coded stringy lisp

#51
post #17
post #14

Earlier quoted context omitted.

Yet requesting the removal of a content only to satisfy one's emotional immaturity is an attempt to limit this freedom.

Not tolerating sexist jokes isn't emotional immaturity. Especially in a very sexist industry and in a sexist society where making these jokes about women is somehow seen as okay by way too many men. It's not funny. I have values (such as those of respect and equality) that stand in opposition to childish jokes like that one. You don't and that's okay, but don't go painting others as "immature" when you're unwilling t…

[flagged]

Re: HCSL: Hand coded stringy lisp

#52
post #49
post #3

[dead]

Why is it not appropriate? Genuine question. Is it because it's sexist? Would it be appropriate to write "unlike most men"? Unlike most people? Or is it because it's suggesting the author is better than other people???

It's not appropriate because it reinforces the idea that women are fragile and not interested in working for anything. Regardless of my intent when I wrote the readme (which was to suggest that I'm better than other people), it's still sexist in it's essence and delivery

Re: HCSL: Hand coded stringy lisp

#53
post #49

Earlier quoted context omitted.

Why is it not appropriate? Genuine question. Is it because it's sexist? Would it be appropriate to write "unlike most men"? Unlike most people? Or is it because it's suggesting the author is better than other people???

It's not appropriate because it reinforces the idea that women are fragile and not interested in working for anything. Regardless of my intent when I wrote the readme (which was to suggest that I'm better than other people), it's still sexist in it's essence and delivery

But surely the fact that you can't say it gives credence to the idea that women are 'fragile'. And I've never come across the idea that women aren't interested in working for anything.

This fuss wouldn't have been kicked up if it were the male equivalent. That to me is sexist.

Anyway, you've already deleted it, so it's moot now.

Re: HCSL: Hand coded stringy lisp

#54
post #19

While Lisp is my preferred normally my go-to language, tbh I think sed or awk are probably adequate and, already being installed, probably in some sense “better”. That being said, thanks for posting this; it made me think.

You're probably correct but this was more fun

I'm sure it was and I'm glad you submitted it! It was fun to read.

Re: HCSL: Hand coded stringy lisp

#58
There is a port of the CL-WHO HTML templater or TXR Lisp called TL-WHO.

It has a deftag macro for defining new tags.

  $ txr -i tl-who.tl
  If you get your macros hot enough, you get syntactic caramel!
  1> (in-package :tl-who)
  #
We can define :atag, which destructures the first two items of its body as url and class:

  2> (deftag :atag other-attrs (url cls . body)
       ^(:a :href ,url :class ,cls ,*other-attrs ,*body))
  #
Then use that in the definition of :page:

  3> (deftag :page () (url . body)
       ^(:atag ,url "pages" ,*body))
  #
So now that we have :page, wrap that in :li:

  4> (with-html-output (*stdout*)
       (:li (:page "./writing" "My writing")))
  My writing
TL-WHO, like CL-WHO, compiles the with-html-output form into something that uses constant string literals that are as long as possible. It closes all your tags, HTML-escapes what has to be escaped and can pretty-print with indentation.

Code can be freely used: attributes and tags are distinguished by virtue of being Lisp keywords. Anything that is not a keyword is evaluated as code.

Only when code produces a string is that string interpolated into the output, making it possible to write code with useful side effects and no HTML output, by not returning a string.

Side-effecting code can explicitly write into the HTML stream; the output will go to the right place in the generated HTML:

  5> (with-html-output (*stdout*)
       (:div :class "foo"
         (:pre (:code (sh "ls -l /etc/a*.conf")))))
  
-rw-r--r-- 1 root root 3026 Dec 16  2019 /etc/adduser.conf
  -rw-r--r-- 1 root root  433 Oct  1  2017 /etc/apg.conf
  -rw-r--r-- 1 root root  769 Apr  4  2018 /etc/appstream.conf
  
Note that the output of "ls -l" isn't being HTML escaped; this example just shows how something can write to the stream as an alternative to interpolation, not that it's a good idea to dump ls -l into that HTML stream.

Re: HCSL: Hand coded stringy lisp

#59

It's a good idea to reduce templating languages into a simpler form, I'll agree to that, but the issue here is that you still need loops and data input. For example, the test script has a 'li' function but s are list items and they reside, usually more than one, inside or elements. At the very least, there should be a way to take some form of data file (list of blog posts and nested metadata) an iterate over it. Othe…

Added a map function https://github.com/0x3444ac53/HCSL/commit/790ba4d8b18cd0fd6f...

Re: HCSL: Hand coded stringy lisp

#60
post #17
post #14

Earlier quoted context omitted.

Yet requesting the removal of a content only to satisfy one's emotional immaturity is an attempt to limit this freedom.

Not tolerating sexist jokes isn't emotional immaturity. Especially in a very sexist industry and in a sexist society where making these jokes about women is somehow seen as okay by way too many men. It's not funny. I have values (such as those of respect and equality) that stand in opposition to childish jokes like that one. You don't and that's okay, but don't go painting others as "immature" when you're unwilling t…

Fortunately there are big and significant parts of the civilised world, where the so-called cancel "culture" is considered a mental disease, and no amount of downvotes some of you will just try to apply will change that.

Even more, in some countries there is a discussion if the cancel "culture" is a part of totalitarian agenda, and if it will be considered as such, it would be prosecuted by a criminal prosecutor, as any other totalitarian stuff. Dodge that....

Post reply on HN