from Hacker News

dōmo: Markup, style, and code in one language

by jedschmidt on 11/9/12, 4:44 PM with 75 comments

  • by jedschmidt on 11/9/12, 5:36 PM

    Hello there, author here.

    I'm still working on how to get the message across, but the idea is this:

    We all know CSS. We all know HTML. Most of us agree that neither is powerful enough to build modern web apps, hence the explosion of CSS-preprocessors and templating engines.

    If we're going to build tools to improve browser technologies like CSS and HTML, let's build them using another browser technology: JavaScript. Instead of adding incompatible extensions to CSS and HTML, let's first port them as-is to JavaScript syntax and then do the extending there, where at least the tools we build will interoperate.

    Instead of learning increasingly arcane/proprietary/underpowered syntax for looping or doing arithmetic or writing functions, let's just use the tools we already have. Not to mention this gives us a streamlined development process and lower cognitive overhead for free.

    Feedback welcome.

  • by duked on 11/9/12, 5:15 PM

    While I appreciate the effort and the work of the author, I really don't think it's a good idea. Decoupling makes things easier. Nevertheless good work
  • by ashray on 11/9/12, 7:09 PM

    This looks very complicated to me. HTML and CSS have separate structures because they do different things. It's like roads and the lines on a road.

    I took a look at the examples and I'm sure that this style of coding would solve some problems. But how many would it create ?

  • by ConstantineXVI on 11/9/12, 5:55 PM

    In a similar vein, I've found ClojureScript and Crate[0]/Hiccup to be a rather potent mix for solo web dev in Clojure. It's a liberating feeling to be able to effectively write your backend, frontend, and layout in the same language.

    [0] https://github.com/ibdknox/crate

  • by antonpug on 11/9/12, 5:11 PM

    NO. NO. NO. This is exactly why styling in HTML failed. Things work great when they are broken down anatomically into specific functions. Let's not try to put all of our eggs in one basket.
  • by IsaacSchlueter on 11/9/12, 5:35 PM

    This reminds me a lot of fab. I dig it.

    Other comments on this page so far show predictable HN-style "Hate anything new" bias. The page is pretty easy to understand what's going on, and all of the objections don't make any sense. Good work. Ignore the bozos.

  • by jasonkostempski on 11/9/12, 6:19 PM

    But I've spent the last 11 years of my life trying to separate them!
  • by shaunxcode on 11/9/12, 5:11 PM

    Reminds me of http://coffeekup.org/
  • by strictfp on 11/9/12, 8:48 PM

    Wait a sec. Wasn't css invented in order to separate style and structure? Now we have frameworks and libs trying to marry them back together. Why not just use old style html?

    It's also funny that there was such a strong movement which tried to separate the view from the code, and now everyone just accepts that you need to code to make ui. Crazy times, makes me think of all those wasted efforts.

  • by Semaphor on 11/9/12, 5:15 PM

    Please read the lines at the top: "alternative to template engines and CSS pre-processors".

    It's not supposed to be used instead of HTML and CSS overall.

  • by JoelMcCracken on 11/9/12, 5:28 PM

    I really like this. The inability to share information between the server, stylesheets, and javascript is problematic.

    Imagine, for example, using this to semantically declare the frontend elements that your website uses, and thus allowing your server to render them, your css to style them, and your javascript to render/manipulate them, all using the same, DRY data. I much prefer something like elements.user_login_form.class_name to needing to remember / deal with naming conflicts.

    edit:

    I'd love to see someone mix in some http://lispyscript.com/ with this

  • by njharman on 11/9/12, 6:16 PM

    > markup, style, and code

    Sounds like PHP, ColdFusion and other similar great ideas from the past.

  • by akdetrick on 11/9/12, 6:14 PM

    The looks like a joy to write, and a nightmare to maintain. I may be old fashioned, but I still see content, style, and behavior as best expressed as separate concerns in source.
  • by amix on 11/9/12, 8:15 PM

    I have used something similar since 2007 ( http://amix.dk/blog/post/19199 ), I only use it on client side to generate DOM elements and generally it's a nice approach (I like this much better than constructing HTML via innerHTML). The general idea for this is from MochiKit and I think they were inspired by stan (that ships with Nevow framework - - which seems to be dead now).
  • by anons2011 on 11/9/12, 5:04 PM

    Personally I see this as completely redundant.
  • by lemiffe on 11/9/12, 7:37 PM

    Some people like building good, simple things (CSS) Some people like making these things better (HTML5, CSS3) Some people like adding extra features and options, disregarding the loss of a bit of simplicity (LESS/SASS) And some people just like making things more complex for the sake of it (Domo.js)
  • by __david__ on 11/9/12, 8:45 PM

    Reminds me of perl's CGI.pm html generators.

    Also, these are similar, though not function based: http://www.jsonml.org/ and http://jsml.org/

  • by tseven on 11/9/12, 5:27 PM

    A glaring issue with this is SEO. The page/site will appear empty for most web crawlers.
  • by jeffreybaird on 11/9/12, 7:55 PM

    This seems like it could get unwieldy fast. If you are looking for a way to abstract web development to a single, concise language, why not check out http://elm-lang.org
  • by conorwade on 11/9/12, 6:12 PM

    Interesting idea, but I just don't like the implementation. Just a few points that jump out for me.

    - The all CAPS make me feel it will be a pain to type. - The CSS looks more verbose than SASS or LESS. The STYLE keyword each time seems like needless repetition. - I feel like the HTML templating is less readable than plain HTML or Slim or such tempting engines.

    Just my thoughts, I would love to know what others think.

  • by IWentToTheWoods on 11/9/12, 5:44 PM

    I think this is an intriguing idea, and I know this is a silly nitpick, but the all caps function names make me feel like I'm reading HTML from 1995.
  • by leeoniya on 11/9/12, 8:30 PM

  • by perfunctory on 11/9/12, 8:15 PM

    This is wonderful. The main challenge for this project will be not techical, but indeed getting the message accross. Wish you all the best.
  • by batgaijin on 11/9/12, 6:03 PM

    aka shitty sexprs
  • by v33ra on 11/10/12, 6:35 AM

    CAPITAL LETTERS!? SERIOUSLY?
  • by camus on 11/9/12, 8:31 PM

    where is the doc ? domo-js.com takes me back to the github repo , hard to understand what it is actually about.