other-languages

teodorlu 2024-04-16T11:20:39.524119Z

I like using hiccup from Clojure. Does anyone Javascript library to recommend that “feels a bit like hiccup”?

Kirill Chernyshov 2024-04-16T11:49:10.024879Z

this one is the closest I know - https://mithril.js.org/

👀 1
Kirill Chernyshov 2024-04-16T11:49:34.677369Z

var root = document.body

m.render(root, [
    m("main", [
        m("h1", {class: "title"}, "My first app"),
        m("button", "A button"),
    ])
])

teodorlu 2024-04-16T11:52:24.416579Z

that looks nice! Thank you 😁

Kirill Chernyshov 2024-04-16T11:52:55.869979Z

beware that this one is ancient old by JS standards 🙂

teodorlu 2024-04-16T11:53:14.853609Z

Gotcha 😄

respatialized 2024-04-16T12:07:28.561099Z

https://docs.thi.ng/umbrella/hiccup-html/

👍 1
🤩 1
borkdude 2024-04-16T12:41:00.763749Z

why from JS if I may ask?

teodorlu 2024-04-16T12:54:17.027449Z

At $WORKPLACE, we have a certain long-living javascript codebases where the team maintaining the codebase is most comfortable with javascript. I don’t think me shouting “you guys should be programming in a different language” from the sideline would be too helpful …

borkdude 2024-04-16T12:55:27.913829Z

and those people can't find a hiccup-like library, or do you also work on this project?

borkdude 2024-04-16T12:57:24.388319Z

perhaps lit-html would also be nice to use: https://lit.dev/docs/v1/lit-html/introduction/

👍 1
teodorlu 2024-04-16T13:01:02.590919Z

those people are currently discussing that the code currently uses handlebars for html templating. My gut reaction is that the code is a bit “too magical” right now, interpolation happens at different places. I have a hypothesis that avoiding string templating and moving to explicit function calls (supporting goto definition and find references) would be helpful.

borkdude 2024-04-16T13:03:12.656119Z

yeah I think lit-html would fall into that category where goto definition etc would work

👍 1