Live data from Hacker News

Show HN: Sinuous – Small, fast, reactive UI library

github.com

11–20 of 47 posts

Re: Show HN: Sinuous – Small, fast, reactive UI library

#12

I kinda don't get the whole "put html in template literals". Wouldn't there be no syntax highlighting? And the framework is either putting the string into the DOM with some regex manipulations, which would lead to some very confusing error messages, or it's parsing the string into a tree, which means it needs to implement what's essentially XML parsing, which would come with an overhead. And for what? Avoiding JSX? I…

My personal opinion is that tagged template literals are the worst addition to Javascript [1]

As HN user stevebmark said [2]:

--- start quote ---

…we’ve learned not to write code in strings. You’d think this would be a fundamental law of software engineering

Writing code, not strings, means you can do everything to it that you can do to code. You can type check code. You can lint it. You can optimize it, compile it, validate it, syntax highlight it, format it with tools like Prettier, tree shake it…

--- end quote ---

[1] https://dmitriid.com/blog/2019/03/tagged-template-literals/

[2] https://news.ycombinator.com/item?id=18511943

Re: Show HN: Sinuous – Small, fast, reactive UI library

#13
post #7

Kind off-topic but related: sometimes I wonder how web development would be if Lisp had somehow won as standard, since we can use to do everything the stack HTML+CSS+JS+Backend-language does, in addition to standardized syntax and standard everything. Oh, standards. Standards.

From Racket [1]:

    #lang web-server/insta
    (define (start request)
      (response/xexpr
       '(html
         (head (title "My Blog"))
         (body (h1 "Under construction")))))
[1] - https://docs.racket-lang.org/continue/index.html

Re: Show HN: Sinuous – Small, fast, reactive UI library

#14
post #7

Kind off-topic but related: sometimes I wonder how web development would be if Lisp had somehow won as standard, since we can use to do everything the stack HTML+CSS+JS+Backend-language does, in addition to standardized syntax and standard everything. Oh, standards. Standards.

We were so close. Twice, JavaScript had a chance to be Scheme; both times marketing reasons prevailed (first, to capitalize on the marketing spending of Java; later, to compete against Microsoft's JScript).

If Scheme was the language of the web, then HTML and CSS being represented as s-expressions would be the most obvious next steps, and we'd be like 15 years ahead in terms of progress.

Re: Show HN: Sinuous – Small, fast, reactive UI library

#15
post #7

Kind off-topic but related: sometimes I wonder how web development would be if Lisp had somehow won as standard, since we can use to do everything the stack HTML+CSS+JS+Backend-language does, in addition to standardized syntax and standard everything. Oh, standards. Standards.

We would probably just treat the html as data, that is normal lisp. So no syntax changes. Same for css I guess. Maybe in twenty years.

Next best thing today: https://github.com/weavejester/hiccup#syntax, https://github.com/noprompt/garden#syntax

Re: Show HN: Sinuous – Small, fast, reactive UI library

#16

I kinda don't get the whole "put html in template literals". Wouldn't there be no syntax highlighting? And the framework is either putting the string into the DOM with some regex manipulations, which would lead to some very confusing error messages, or it's parsing the string into a tree, which means it needs to implement what's essentially XML parsing, which would come with an overhead. And for what? Avoiding JSX? I…

My personal opinion is that tagged template literals are the worst addition to Javascript [1] As HN user stevebmark said [2]: --- start quote --- …we’ve learned not to write code in strings. You’d think this would be a fundamental law of software engineering … Writing code, not strings, means you can do everything to it that you can do to code. You can type check code. You can lint it. You can optimize it, compile it…

I think your blog post misses an important aspect of tagged template literals, which is that the first argument is an immutable object that is unique to the source location of the template. That doesn’t necessarily invalidate the rest of your argument, but it is a very powerful feature that is not really equivalent to anything else in JavaScript.

Re: Show HN: Sinuous – Small, fast, reactive UI library

#17

I kinda don't get the whole "put html in template literals". Wouldn't there be no syntax highlighting? And the framework is either putting the string into the DOM with some regex manipulations, which would lead to some very confusing error messages, or it's parsing the string into a tree, which means it needs to implement what's essentially XML parsing, which would come with an overhead. And for what? Avoiding JSX? I…

My personal opinion is that tagged template literals are the worst addition to Javascript [1] As HN user stevebmark said [2]: --- start quote --- …we’ve learned not to write code in strings. You’d think this would be a fundamental law of software engineering … Writing code, not strings, means you can do everything to it that you can do to code. You can type check code. You can lint it. You can optimize it, compile it…

> You’d think this would be a fundamental law of software engineering

Agreed, but not for the reasons you quoted.

It should be a law of software engineering because when you're writing code, you aren't writing strings, you're writing a serialized and prettified form of a tree. So when you have two pieces of code you want to join together, you should join trees, not strings.

Breaking this law is precisely why things like SQL Injection even exist in the first place.

Re: Show HN: Sinuous – Small, fast, reactive UI library

#18
post #7

Kind off-topic but related: sometimes I wonder how web development would be if Lisp had somehow won as standard, since we can use to do everything the stack HTML+CSS+JS+Backend-language does, in addition to standardized syntax and standard everything. Oh, standards. Standards.

Or PostScript.

Re: Show HN: Sinuous – Small, fast, reactive UI library

#20
post #2

I work in this space so I am curious how your library is different from its similar competitors. I read the docs, but I didn't find anything about the actual model for how it works, like whether the whole UI rerenders on any observable change or not. Maybe consider this paragraph a request for documentation. PS: A minor suggestion: the word "blazing" is so overused in the JS world at this point, when I see it I alway…

[deleted]
Post reply on HN