Live data from Hacker News

Fun - a new programming language for the realtime web

marcuswest.in

1–10 of 53 posts

Fun - a new programming language for the realtime web

#1
"What if you could build realtime web apps with the same ease as you build static web pages in PHP today? Without long polling, event handling and state synchronization, the engineering complexity of realtime web applications would drop by an order of magnitude. There would be a fundamental shift in the way we build the realtime web. This is the future of Fun."

Fun - a new programming language for the realtime web
marcuswest.in

Re: Fun - a new programming language for the realtime web

#5

What they are describing is essentially data binding at the language level. The thing to keep in mind is that "out of sight, out of mind" data binding can result in very slow code, but it's a fantastic pattern for UI dev.

The bottleneck with Fun is going to be the network latency.

Any piece of UI that needs extra care, e.g. a very long list of items, is implemented in javascript with appropriate lazy rendering.

Re: Fun - a new programming language for the realtime web

#7
This certainly is an interesting idea. It seems to me though that all of your application logic is jammed into a single file at the presentation layer. This might suffice for very small apps, and that's fine if it is your goal. I can't imagine that you just define all of your logic in one file.

How would you go about reusing code? Could you potentially separate out logic from your template?

I would also like to see how this could be done more unobtrusively. It would also be good to show what the output html looks like after it is compiled to html.

Re: Fun - a new programming language for the realtime web

#8

This certainly is an interesting idea. It seems to me though that all of your application logic is jammed into a single file at the presentation layer. This might suffice for very small apps, and that's fine if it is your goal. I can't imagine that you just define all of your logic in one file. How would you go about reusing code? Could you potentially separate out logic from your template? I would also like to see h…

Absolutely!

You can declare something akin to a function, which takes arguments and emits HTML. Imagine e.g.

    let taskTemplate = template(task) {
         
              task.title
         
    }

    for (task in tasks) { taskTemplate(task) }
I'm not decided on syntax yet.

You can definitely separate out logic from template this way.

Fun outputs javascript, not HTML - the javascript then builds the DOM.

Post reply on HN