Hacker News new | past | comments | ask | show | jobs | submit login
Hoplon: A Simpler Way to Program the Web (hoplon.io)
161 points by johnwalker on Jan 19, 2014 | hide | past | favorite | 49 comments



Looks like a great project.

Is it just me, or does it seem like cljs is making a big stir these last few weeks? After a few years with NodeJS, I've always wanted to do some more purely functional programming; I've seen a lot of buzz about Clojure/cljs and have started considering it for my next project.


ClojureScript specially has taken off. This project, then you have the extreamly cool (but a bit hard to understand) pedestal (https://github.com/pedestal/pedestal), the Om (https://github.com/swannodette/om) library has made a splash even in the JS community.

A lot of exitment around core.asnyc (witch allows CSP like Go) on the web.


I'm really looking forward to pedestal. From what I understand the team is vacationing, but that there are plans to integrate core.async. I do wish that its development were a bit more public, though.


I would probebly not bother with following the devlopment to closly, I will wait until they feel like it is realy for early testing.

Look at this talk, http://www.infoq.com/presentations/pedestal-clojure, I think it gives the most up to date ideas about pedastal and the next version.


LightTable is written in clojurescript and it's a first-class language for the IDE (The core devs prefering it I guess).

Id like to use LightTable but I'm more of a CoffeeScript guy and CS isn't built in yet. Apparently to add support you pretty much need to know ClojureScript to create a plugin, or something around that. I'll gladly write the CoffeeScript syntaxer, highlighter and a theme, as I run my own flavors in Sublime. Just need the integration to be there.

Someone help! (Please go learn ClojureScript and PR to LightTable immediately OP)

https://github.com/LightTable/LightTable/issues/458 :)


Light Table already has coffee-script syntax highlighting etc from CodeMirror. What's missing is support for evaluation and auto-completion.

Some people have written plugins in pure js (eg https://github.com/joshuafcole/).


I feel like despite the great things these projects are trying to achieve, in the end they are just hacks. I think its time we try to shift the web standards to meet modern needs rather than trying to build around the limitatns right now. The web is the future, and there's no point putting off the inevitable.


At the same time, developers need to ship using the tools that are currently available. I think a multi-pronged approach is inevitable. Of course, I say this as someone who avoids this sort of tool as a general rule, since it seems risky to use in production, so I definitely see what you are saying. On the other hand, this sort of thinking would probably have been an argument against jQuery several years ago, and despite the fact that it was a 'hack' over the awful js standard api, it became a de facto standard through brute force of popularity.


I think its time we try to shift the web standards to meet modern needs

But when we try that, everyone piles on about how it's out of scope for web standards, and complains about how it's being done, and...

Just makes you want to throw your hands up.


> Reload this page with JavaScript disabled and see how the content was "prerendered" at compile time.

To their credit, the page is not blank, unlike a lot of "web" authors out there. Unfortunately there are several links that point to invalid and nonexistent fragments like #/home/ instead of actual elements of that or some other document, which really means the framework is happy to make a siloed javascript app and does not ensure you are responsibly making all your content available as part of the world-wide web at some stable URL where third parties can reference it.

tl,dr: this encourages single-page apps which will be the death of the web.


> tl,dr: this encourages single-page apps which will be the death of the web.

The first sentence of the "Web Apps" section is Web ap­pli­ca­tions are not doc­u­ments. This is a motto that I believe a lot of people who think the way you do should take pause and reflect upon.

After years producing web apps, I came to the conclusion that non-js web apps are some of the craziest ideas ever. The browser without js is a tool to consume and, to some very minimal extent, produce documents. I consider most non-js apps on the browser to be huge hacks at best, that do what they can to circumvent the shortcomings of that technology. And heaven knows that shortcomings are a dime a dozen (lack of http method on anchors, limited to GET and POST, to only name a few).

If you do embrace building apps with js, then you need to stop thinking in the document-oriented paradigm, otherwise you'll be making some unnecessary compromises at the expense of your end users, and you'll be making your life harder as a developer. For instance, some actions that the standalone or native version of your application does with a single click might require 3 or 4 user interventions on the browser version, simply because you wish to remain true to some dogma.

A while back I've embraced the idea that web apps aren't documents. It freed me as an app developer to make choices that were otherwise unthinkable in a previous mindset. My APIs make more sense, my interfaces are more intuitive and my users are the happier for it.


"Web app" is usually a misnomer. The world-wide web is the linked universe of addressable documents (resources). An app which is not just some behavior added to that core architecture is not capable of becoming a part of the web. It's a ghetto of single-purpose data, exactly like the client/server apps from the 1980s, only this time with a deployment model that gets it past gatekeepers in IT. It shouldn't be called a "web app" simply because its installer is delivered via HTTP, and people working on such projects ought to be aware that the network they're building is competing with the web for content while being far more hostile to hacking and mashups.


>is not capable of becoming a part of the web. It's a ghetto of single-purpose data

Sorry, but with the exception of screen-scrapping, 99.9% of the web IS single-purpose data.

Some people imagine a magical unicorn world where webpages inter-operate etc, but that never was the case. And I don't want my Gmail data messing with my Adobe Kuler data, my Amazon data, or my eBay data anyway.

For inter-operation, we have RSS, REST, AJAX, JSON and co. Web pages themselves, as served to the end user, are not were it should be expected to be (and never was there in the first place).


I think the "web" in "web app" is for web browser app, not world wide web app. Whether it should or shouldn't be called differently is by now besides the point. It's certainly not the first concept to be allegedly ill named and it won't be the last. The most important thing is to understand the nuances when creating resources to be consumed or produced over http.

> people working on such projects ought to be aware that the network they're building is competing with the web for content while being far more hostile to hacking and mashups.

On the contrary, case in point APIs: they're often distributed using formats such as JSON or XML, which weren't designed to be particularly web friendly the way HTML is. They're still much more suitable to hacking and mashups, because they go beyond the conceptual limitations of the web to fully embrace the potential of HTTP.

The only thing required for any app, even js intensive ones, to be part of the web is to provide some urls that resolve to web friendly versions of their resources and that really isn't that complicated.


> The world-wide web is the linked universe of addressable documents (resources).

"Documents" and "resources" aren't even approximately equivalent. "Resources" are more "things that can be described by nouns" than just "documents".

A document may be a representation of a resource, but the two are not equivalent.


I think the problem is that most single page apps are badly designed.

Each resource must have a unique URI or the original web model (as envisioned by TBL) is broken.

This can be, and in many cases has been (google plus for instance), solved. It's just a matter of good design.


The HTTP protocol is designed to consume documents. I guess this is why it's so hard for people to get their head around web apps not being documents.


POST, PUT, DELETE are just as much part of HTTP as GET...


Those were all designed for posting, putting, and deleting discrete hypertext resources - which I am calling 'documents'.


> single-page apps will be the death of the web

What en earth makes you think that? Yeah, the current way of doing SPAs without fallback for non-js clients is horrible and the alternative of a two-way site too much work.

But the solution is obvious: if what you serve is of any meaning to anyone else, you also have some sort of content consumption API. Sooner or later we'll standardize some RESTy way of doing it for apps, and for blogs and magazines RSS/Atom feeds are already good enough content-consumption pseudo-APIs.

The API will be the Javascript-less version of all sites, and all sites will have an API. Then people will make UIs for the content consumption parts of these (pseudo-)APIs, and these UIs, even if they run themselves in browsers will become the new "browsers" and gain their own scripting level features, while "old browser apps" will become today's equivalent of desktop apps.

It's not "death" of the web, just "endless, infinite pain" for us developers working in its perpetual shifting front-end... it's way worse than death! :)


> Sooner or later we'll standardize some RESTy way of doing it for apps

We used to have that, and it was called HTTP and semantic HTML.


No we didn't.

Nobody used "semantic HTML" to do anything serious with cross-webpage interoperability (where nobody means less than 1% of web developers/pages). As for TBL's "semantic web" that was dead on arrival.


And that will be exactly what we end up getting back in the end; single page applications that treat a click as functionally equivalent to following a link.


Jack this out, its kind of a desin guide how to make a good client-side that is usable with many clients.

http://roca-style.org/index.html


> doing SPAs without fallback for non-js clients is horrible

Why? The number of customers that a) don't use javascript and b) would pay for a service only if they have a non-javascript version is incredibly small in my experience. If the service has value, non-javascript users will enable javascript to use it.


I prefixed it with the "the current way of".

I'm ok with a SPA as long as long you also have an API. I'm also ok with a SPA as long as your app is just a content consumption app, e.g. you don't publish original content that is not accessible through other sources. But since even aggregating or re-mixing content or comments can actually be seen as creating "new content", the distinction is blurry.

My point is that we should be able to consume data on the web without having the full-browser+javascript to be the lowest level interface we have to this data.

And about the clients' interests: well, I think it is our duty as professionals to be able to see past our clients' interest too, to try and shape the future of the field we work in to the right shape, at least after we provide the clients with with good enough solutions (and yes, we should remember to stop at "good enough", because there's no point polishing a short-sighted solution, instead of working more to reshape it into a more future oriented one) and ensure short term profitability. Now, we don't all have a common notion of this "right shape" of the future of the web, but I do my best to shape it as much as I can towards "my kind of people's right shape" and push our vision up as many people's throats as we can, hopefully helping us all escape from this hell of short-sighted short-term clients' interests based decisions that brought us the current overcomplicated mess that the web is right now.


> I'm ok with a SPA as long as long you also have an API

That would be great, but I have no faith that the same developers who are today shirking responsibility for shipping their content as HTML with transcluded resources at stable URLs, will someday start shipping their content in a stable schema and API. They think nothing of turning their data and URLs upside down and changing their client to match, because they have a blind spot around the very idea that theirs is not the only client.


Not entirely sure what you mean, unless you're suggesting pages should just spew a ton of JSON or XML for users who have Javascript disabled.


Why would they do that?


The "prerendering" function isn't for human consumption. It's meant to make the page spiderable by search engines. Since it's a single-page app all content is on the page so the #/home/ links aren't really something a search engine would care about.

I think the days when you'd put HTML documents on the web like emails with no dynamic behavior in them are over, and have been for quite some time now. If you have content you want people to read and act on, you're going to want to develop the user experience.


I don't think SPA's will be "the death of the web" exactly, but there is a big problem with this muddling of concerns... browsers get more and more confused with each passing year - is it for browsing hypermedia content, or is it a poor man's X server? Is the browser good at navigating, following links and rendering HTML, or is it good at becoming an application delivery platform? Or is it both? Why should it be both? Separation of concerns anybody?

Having content and apps on the web makes perfect sense to me, but I can't help but think we need to do something different in terms of delivering apps over the web. The problem is, the browser itself is the only "runtime" that's guaranteed to be available in all browsers on all platforms. Something like Java had tons of promise at one time for handling the "app" side, but Sun screwed the pooch by not shipping a JVM with reasonable startup times until years too late, and missing the boat on security. Now Java has a such a bad rep as a consumer-facing tech, that it would be just-short-of-impossible to revive it, even though it's probably still the best solution for "apps over the web" in many ways.

Maybe Google's NaCl / PNaCl will eventually help, but I'm not holding my breath.


I like to think that as web apps take off, we might see the emergence of one or more frameworks that specialize in rendering pure documents for the person who doesn't want to use javascript or wants minimal loading of assets.

The reason I suggest this might happen is that for years we've been trying to get away with munging the visual design while still preserving the notion of the document. Web apps take it to the extreme where documents are most often deliver as pure data (i.e. JSON). This move towards having all content as pure data is a great first step towards supplying the content for a pure text only framework.

I like this possible direction the world can take much more. Progressive enhancement was flawed from the start. Let interfaces be super rich, but supplied by content in pure data form that can also be delivered via the simplest interface ever, like basic semantic HTML.


I think you are getting tripped up on the difference between a webapp and a website.


It's a pitty they do not show how client server communication is done. Eg how, after a click on a button, do i query a db and display its result in the page.


Here's a simple example (in their repository) : https://github.com/tailrecursion/hoplon-uberwar


There's an examples Folder on GitHub with a client/server chat demo. That really helps figuring the RPC part out



Does this use react from Facebook? React is supposed to be the last missing piece for clojurescript.


Doesn't look like it. Additionally it appears to be conceptually heavy. It's hard to convince Clojure users to use anything but small libraries, even Noir (a Sinatra-like framework) was abandoned for this reason. This might be really good but the amount of buy-in required is a hard sell to the community.


it has its own impl of rp that doesnt seem as advanced as react. I think there have been some performance issues as well.


Hoplon's reactive model is quite different from React's. We think it's more advanced :). There are no "performance issues" reported lately (there was some confusion with an old proof-of-concept demo, but any recent version of Hoplon will provide acceptable performance).

Hoplon isn't optimized for "perf" in rendering things on the screen. Hoplon is designed to uncompromisingly optimize developer performance. I know that when my users are presented with a choice between more rendering perf and added features in the application it's a no-brainer. They just need good performance, but great features.

Hoplon presents a model in which web designers and programmers can coexist without friction, and it provides the underlying foundation for developing truly powerful abstractions (like components, for example) that are composable in ways that are impossible in other systems.



So what is the performance benchmark for Clojure / ClojureScript? I've seen a lot of buzz for Clojure as of late, but given how bloated the web is at the moment, until I see Clojure (or Haskell) make leaps-and-bounds better performance in return for the pain of learning the language (and the barrier to functional programming), how can we hope to mass-adopt this technology?


Performance isn't everything and in many cases not that important. Clojure and Haskell make leaps-and-bounds better performance than Python and Ruby which both have mass adoption.


Lost me at " Use a spread�sheet-like dataflow pro�gram�ming en�vi�ron�ment to man�age client state."


For those interested in the learning more about single language web applications the Links project (http://groups.inf.ed.ac.uk/links/) has been going for some time with quite a few research publications.


I like the name.


No.


The funny thing is that even with "Single-page applications, not documents" you still have a document... your "single-page".

Besides, that's NOT dataflow programming (see old papers for Fabrik, Prograph, InterCons, etc).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: