Complete newbie to lisp/arc here (coming from python). I'm pretty happy with my python tools, except for html templating. I'm using Jinja2 for templates, and while its great compared to django's templates, (and most other <% templates %>), one thing about it does annoy me. If I want to create a macro, I'd have to type: {% macro name(....) %}
... html stuff ....
{% endmacro %} This is too much boiler plate for me. Why can't the `endmacro` just be a closing brace/parenthesis? That's where I started thinking that something like arc could be a natural fit with what I want to do with my day-to-day html templating. Then I thought, well if I'm to do html in arc, why not do javascript in arc as well? (note: I'm not doing html in arc yet, I'm just thinking about it) I saw the arc->javascript experiment, and the idea seems rather nice. I don't quite like the javascript syntax. But in javascript, I need to do things like: jQuery("#content").hide();
How would something like that look like in arc?I can try: (jQuery "#content")
and that would correctly produce `jQuery("#content")`, but how do I get at the `obj.method` syntax?That's not really my question though, I mean I'm clearly thinking in javascript here, not in lisp. In your experience, is writing javascript as arc a feasible idea? or even a good one? If you were to do it, would you try to write javascript in arc syntax, or would you entirely ditch all the available javascript libraries (such as jQuery) and write pure arc that "compiles" to javascript as if javascript was some sort of an assembly language and you rarely (if ever) would look at its output? I mean, clearly Javascript enteracts with the dom and the browser a lot, so you can't ignore everything. So .. How would you do it? How would you approach it? Right now, I'm trying to write a simple app in python using jinja2 templates, then I'll have a look at the template and try to come up with a more pleasant way to write it (with arc's syntax in mind). Addmittedly, that'd be like thinking in html/jinja/python while using, and in my experience, it's not a very good idea to approach a language and start working on it as if it was X, your X is your other favotire language that you're most familiar/comfortable with. |