Hacker News new | past | comments | ask | show | jobs | submit login

took me a second to realize how important this is; my brain dismissed the final solution as 'so what, that's just like HTML'.

then I got it -- the ability to use code generation to be declarative is incredible.

having the ability to mix declarative (HTML / data structures) and imperative (javascript) is what makes react so powerful. The ability to do that almost-natively inside the language is amazing.




Yeah I think one of the main things that React offers is a DSL for trees (JSX) that can lexically close over and also splice in JavaScript. Languages that allow creating your own DSLs offer this for other realms such as shader coding, logic programming etc. within the metalanguage.


>Languages that allow creating your own DSLs offer this for other realms...

Rebol & Red are examples of this, there's a GUI dialect called VID [1][2] and in companion with this is a Draw dialect [3][4].

1. http://rebol.com/docs/easy-vid.html

2. https://doc.red-lang.org/en/vid.html

3. http://www.rebol.com/docs/draw.html

4. https://doc.red-lang.org/en/draw.html


Where do you see behavior mixing with presentation in wxnim's GenUI? The only thing that the macro is used for, besides saying what to draw and how, is to define events that the elements emit.


you're asking from an MVC perspective?

This approach lets you blur the lines between MVC responsibilities. If you wanted to create a widget that had some traditionally 'business-logic' role (like network sync or database interaction) you could do that. I'm not recommending that but there's value in flexibility.


I wasn't talking generally but I'm interested to hear about any purported benefits of conflated responsibilities.


Example:

The FB/google share buttons on websites totally break MVC. It's just a button but it has cookie & network traffic.

I hate those buttons, people often argue they 'break the web' because of weird privacy/performance side effects, but developers use them because it's convenient to 'drop in' the platform integrations.

By comparison -- integrating an android app with GMS requires modifying a bunch of files (xml layouts, java source, multiple build dependency files). You can't just 'drop it in'.




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

Search: