News for hackers. Stuff that matters.
Re:Beautiful mini language for outputing HTML in Python by capablanca on Tuesday December 29, 2009 @08:31AM (#1020425)
I no longer fall for languages that only change the syntax for something the author thinks it's cuter...
Re:Beautiful mini language for outputing HTML in Python by snprbob86 on Tuesday December 29, 2009 @05:34PM (#1021477)
What are your thoughts on HAML and SASS? They aren't simply "cuter" they are a full-blown templating and stylesheet meta language. I've been using SASS in a Python project and love it. The more I use SASS, the more envious I grow of people who get to use HAML.

I was intending on eventually writing my own HAML-type language in Python, but it looks like with SHPAML, I won't have to. Because SHPAML supports raw HTML and doesn't do anything with the {} characters, I can use SHPAML in conjunction with my existing Jinja2 templates. This will enable me to convert my templates organically. The intermediate HTML/Jinja representation doesn't need to appear on disk, so this really looks like an easy way to add "cute" HTML syntax to and existing Python text templating language.

Re:Beautiful mini language for outputing HTML in Python by pgbovine on Tuesday December 29, 2009 @11:56AM (#1020743)
i use Markdown (http://daringfireball.net/projects/markdown/) regularly rather than directly writing HTML. like this thing, it's also just syntactic sugar, but it's well-designed and makes it so that i can concentrate on writing and not on formatting syntax. my raw text files are much more source-control friendly, since the diffs are clean.
Re:Beautiful mini language for outputing HTML in Python by silentbicycle on Tuesday December 29, 2009 @02:59PM (#1021149)
Markdown is different, though. Rather than trying to cram HTML into a yet another pseudo-programming syntax, it tries to generate HTML that matches common plaintext-formatting conventions. You might not guess Markdown-formatted text was written with a formal markup language in mind.

FWIW, there's a C implementation of Markdown called "discount" (http://www.pell.portland.or.us/~orc/Code/discount/) which is crazy fast, easy to embed, and has a couple nice extensions.

(Also, "SHPAML"? Gross.)

Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @05:54PM (#1021510)
First of all, sorry about the name.

SHPAML is not a pseudo-programming syntax. It is purely a markup language, so there are no programming constructs.

SHPAML very deliberately tries to be a lightweight abstraction on top of HTML, unlike wikis and Markdown, which operate at a higher level abstraction. I am a huge fan of wikis, so I value the higher level abstraction at times, but I also see the need for an in-between solution.

I have not used Markdown much, but I see its merits as well.

Re:Beautiful mini language for outputing HTML in Python by silentbicycle on Wednesday December 30, 2009 @07:57AM (#1022349)
That came off more harsh than intended. It sucks to post something you're excited about and have lots of people digging into it.

I'm not being critical of your tool in particular so much as wary of the flock of thin syntax transformers that have come out lately. They're fun projects, but adding yet another mutually incompatible data format is probably only a net gain under relatively specific circumstances (small teams, for starters). I like Markdown in this regard because it's downwardly compatible with how people would write anyway. You're right that it's at a different level of abstraction, though.

And about the name - I'm really tired of hearing the same Monty Python jokes all the time, but that's my problem.

Re:Beautiful mini language for outputing HTML in Python by showell on Wednesday December 30, 2009 @09:26AM (#1022435)
I understand the objection to having too many mutually incompatible data formats, but I don't understand how Markdown is exempt from that concern. It achieves the goal of looking like what "people would write anyway," but at a higher cost in terms of departing from HTML semantics. For example, how do you indicate semantic structure via Markdown to allow for CSS styling or Javascript manipulation of the DOM?
Re:Beautiful mini language for outputing HTML in Python by wensing on Tuesday December 29, 2009 @11:17AM (#1020657)
Is it just cuter if it means less typing?
Re:Beautiful mini language for outputing HTML in Python by timdorr on Tuesday December 29, 2009 @12:23PM (#1020797)
The difficulty of programming isn't from having to type too much, it's from solving problems.
Re:Beautiful mini language for outputing HTML in Python by samdk on Tuesday December 29, 2009 @12:33PM (#1020820)
The difficulty of writing HTML is mostly having to type too much. Writing HTML isn't programming.
Re:Beautiful mini language for outputing HTML in Python by omouse on Wednesday December 30, 2009 @05:12AM (#1022243)
HTML isn't meant to be written directly. It's an output form, like Postscript or PDF.
Re:Beautiful mini language for outputing HTML in Python by alan_p on Friday January 22, 2010 @03:30AM (#1069340)
Gravedigging a bit here, but WTF dude?

I've started authoring websites in 1996 with just Notepad and I still hand-write my HTML on a daily basis.

The problem with HTML has been (and will be, for a long time) that there is no WYSIWYG editor that can offer quite the same quality as handwritten HTML.

In fact, if you're dealing with HTML from a WYSIWYG perspective, you're most likely ignorant of the language. The distinctions between divisions and paragraphs, between links and spans, are not something that is adequately reflected by an input editor purely concerned with visuals.

Just as the purpose of CleverCSS or it's Ruby predecessor is making it easier to write CSS by cutting down on the redundancy (and even by increasing the level of abstraction a fair bit), the purpose of SHPAML is making it easier to write HTML by cutting down on the redundancy of closing tags, angle brackets and the verbosity of divs, spans, ids and classes, thus letting you express more directly what you mean.

You don't have to like it. It's mostly a stylistic choice, but it means little overhead and can help HTML authors a lot by cutting down on the usual boilerplate. Just like frameworks and syntactic sugar make it easier for programmers (though the argument could easily be applied to them as well -- how dare they find it easier to code with less boilerplate if the actual writing is the smallest part in creating a functioning program).

Re:Beautiful mini language for outputing HTML in Python by irrelative on Tuesday December 29, 2009 @08:39AM (#1020438)
I agree. Nor do I call them beautiful.
Re:Beautiful mini language for outputing HTML in Python by olalonde on Tuesday December 29, 2009 @04:56PM (#1021406)
Right. I don't see any use case for this syntax especially that modern IDEs offer auto completion .
Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @05:26PM (#1021462)
Modern IDEs inject close tags and angle brackets into the source document. The SHPAML preprocessor injects that syntax into the target document. The use case applies to the person who wants clean syntax in the source document and executable syntax in the target document.
Re:Beautiful mini language for outputing HTML in Python by silentbicycle on Wednesday December 30, 2009 @08:07AM (#1022356)
While it's less significant for HTML than code, verbose languages are problematic during reading as well as writing.

While generating stub code for class declarations, getters, setters, etc., can help with writing boilerplate-y OO code quickly, anyone trying to read it to decipher its intent will still have to deal with all the clutter. That's more likely to cause problems in the long run.

Re:Beautiful mini language for outputing HTML in Python by nir on Tuesday December 29, 2009 @10:46AM (#1020604)
Why are most comments here negative? HAML already shown this technology does have value to a significant amount of people. Someone took the time to write this, seems to have done a pretty nice job and is releasing it for anyone to use. I can't see why anyone would feel the need to put it down in the comments. If you don't like, just don't use it.
Re:Beautiful mini language for outputing HTML in Python by njharman on Tuesday December 29, 2009 @10:56AM (#1020619)
Because;

1) by posting link to it on discussion site you are assumed to be soliciting opinions.

2) it was called "beautiful". A claim so false as to require immediate and forceful contradiction.

Re:Beautiful mini language for outputing HTML in Python by nir on Tuesday December 29, 2009 @11:07AM (#1020642)
1) As an HN submission, it's certainly better than most. Anything with code in it beats "Startup lessons from J-Lo".

2) Beauty is a matter of taste. It might not be the Bar Rafaeli of languages, but I wouldn't think it's so ugly as to require "forceful contradiction".

Re:Beautiful mini language for outputing HTML in Python by wensing on Tuesday December 29, 2009 @11:14AM (#1020650)
I like what I see of the DSL, but I don't believe meritorious beauty is a matter of taste.

Coke vs. Pepsi - taste

Python vs. PHP - not-taste

For a better explanation, see: http://www.paulgraham.com/taste.html

Re:Beautiful mini language for outputing HTML in Python by nir on Tuesday December 29, 2009 @12:46PM (#1020851)
I think we're in agreement. My distinction is:

Beautiful vs Nice - taste.

Beautiful vs Ugly - not taste.

So, since it's obvious this DSL isn't ugly, being less than beautiful doesn't really merit HN's negative response.

In any case, the negative comments seem to be doing great, which is sad for HN. My experience is that people who actually produce stuff (in any field) aren't usually publicly critical of other people's work, since they can appreciate the effort involved, and don't want to be at the same spot when they release their own work.

Re:Beautiful mini language for outputing HTML in Python by scott_s on Tuesday December 29, 2009 @05:10PM (#1021434)
Criticism is not a bad thing.
Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @03:43PM (#1021268)
I did not post the link here, nor did I call anything "beautiful," but I presume that the reason the original poster posted the link on a "discussion" site was to solicit "discussion." Immediate and forceful contradiction does not equate to discussion, even when the claim is "so false" as this one.
Re:Beautiful mini language for outputing HTML in Python by dpatru on Tuesday December 29, 2009 @12:33PM (#1020821)
One of the primary benefits I get from HN is the pro and con discussion of technology, especially if it's something I might want to use. If there are good reasons not use a technology, then I would rather hear about them before I rediscover them from my own experience.
Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @01:10PM (#1020917)
As the author of SHPAML, I have no problem with all the negative comments about lightweight syntax abstractions, as I've seen all the same arguments written against HAML. Most of the critics of SHPAML have probably never actually used it, nor do I expect them to if they don't share the same pain points as I do. Nowhere do I make any claims that SHPAML is going to cure all problems. It does make producing HTML easier for me.
Re:Beautiful mini language for outputing HTML in Python by apgwoz on Tuesday December 29, 2009 @08:30AM (#1020422)
I'm not a big proponent of all of these new HTML replacers. They don't really buy you anything--this one just gets rid of angle brackets as far as I can see, and adds CSS style #id and .classname. Now, instead of angle brackets, we have to use tabs, or spaces, or some other delimiter (I saw | in there for continuing a line).

The best way I've found of representing XML/XHTML or even HTML for that matter, is with X-Expressions--a subset of S-Expressions. But, they are most useful in a language that fully supports S-Expressions, like Lisp, since you can then use standard functions to generate your markup for you.

Re:Beautiful mini language for outputing HTML in Python by davidw on Tuesday December 29, 2009 @08:35AM (#1020430)
Yes, I think that for HTML, "better tools" is the right answer. HTML is something that can be shared between people with various backgrounds, skills, and toolsets. I can write it in Emacs on Ubuntu, and send it to some guy who will work on it in Windows with Notepad, who can send it to someone else who will open it with Chrome on a Mac.

These things might be ok for small, tight teams, but I don't see them as buying that much in the long term, as opposed to tools that let you be more productive with HTML.

Re:Beautiful mini language for outputing HTML in Python by mtomczak on Tuesday December 29, 2009 @11:54AM (#1020737)
I believe that I see your point, and I would agree that the verbosity of HTML leads to sharability, and that is a strength.

But the verbosity is also one of its weaknesses for large projects; it adds a great deal of overhead in terms of keeping track of the tags, especially if the HTML needs to be re-arranged. And with no language-supplied rules for how much whitespace to use or where (beyond "all adjacent whitespace is compressed"), there is too much flexibility for a large team to work smoothly. My usage case doesn't mesh with your example, because I'm working in an environment with version control and multiple developers. The guy using Notepad will be told to get a tab-aware text editor, because his changes will mangle the whitespace in the file and lead to unnecessary noise when he commits.

When structure in your whitespace is already desired (to avoid making your version control noisy), you can leverage the fact that you are structuring the whitespace to make it a semantic element. This greatly decreases typing, makes the code easier to eye-scan, and allows details such as proper closing bracing to be left to the compilation tool and not to the developer. I agree with commenters who have noted that HAML has been proven useful for some developers.

I would categorize both SHPAML and HAML as tools that let you be more productive with HTML.

Re:Beautiful mini language for outputing HTML in Python by davidw on Tuesday December 29, 2009 @01:03PM (#1020901)
It's not the verbosity or lack of it that makes it shareable, it's the fact that it's a standard.

Some of these inventions are a bit nicer than the original thing, but not so much that I'd give up being able to share the code with pretty much anyone and everyone.

I can do HTML pretty quickly with Emacs' psgml mode, and I'm sure there are other people who specialize in it who can do it even faster with other tools. I think that's the place to look for improvements, rather than generating it like machine code.

Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @01:25PM (#1020956)
When you run SHPAML through the preprocessor, it produces HTML that you can share with other people. So it's not that big an issue. Your greater point is well taken, though--using SHPAML is particularly suited to small teams.
Re:Beautiful mini language for outputing HTML in Python by silentbicycle on Tuesday December 29, 2009 @03:12PM (#1021186)
Things can get messy if people sending you patches for something generated, rather than patches for the original source, though. Most such transformations aren't trivially reversible.
Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @03:28PM (#1021230)
I understand the use case, and if people are frequently sending you patches for your HTML, you probably want to make HTML the authoritative source. Do people frequently send you patches for HTML that you author? SHPAML does not allow you to trivially reverse HTML patches, but it does allow you to manually apply them without too much pain, as it lets most HTML pass through unmolested. I actually source control my HTML output to be able to see diffs on the HTML, for what it's worth.
Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @01:19PM (#1020941)
SHPAML replaces angle brackets and close tags with space-based indentation and pipes. The CSS sugar for #id and .classname is completely optional, and obviously if you know CSS, then the syntax should be familiar.

I agree that there are plenty of other useful ways to represent XML/HTML.

SHPAML does require or even support tabs. The "|" is not for line continuation; it is to separate markup from content.

Re:Beautiful mini language for outputing HTML in Python by Jim_Neath on Tuesday December 29, 2009 @08:56AM (#1020460)
I like HTML. I like the way it looks. I like writing it.

On the other hand, I don't like new DSLs for writing what is already a simple markup language.

Re:Beautiful mini language for outputing HTML in Python by eru on Tuesday December 29, 2009 @11:36AM (#1020697)
HTML is a bit verbose.
Re:Beautiful mini language for outputing HTML in Python by nicpottier on Tuesday December 29, 2009 @11:47AM (#1020719)
I kinda like it.. sure it is one more level of abstraction, and good editors will help with the tag balancing, but let's face it, (X|HT)ML syntax isn't exactly natural to write, and I say this despite having written it by hand for well over a decade.

This probably appeals more to people who have made the Python jump and like that whitespace means something, as that's what really makes it terse.

Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @01:37PM (#1020980)
SHPAML is definitely targeted at Python users and people who like meaningful whitespace (and associated terseness).

Glad you like it! I have also been hand writing HTML for well over a decade too (as well as other means of producing HTML), so my goal in SHPAML was simply to relieve pain points for an everyday task. It has worked for me.

Re:Beautiful mini language for outputing HTML in Python by amitu on Tuesday December 29, 2009 @01:32PM (#1020972)
One reason to use this would be to get well indented HTML.

Finding the potentially missing closing </div> tag has been a common problem I have seen some people face.

Re:Beautiful mini language for outputing HTML in Python by andrewcooke on Tuesday December 29, 2009 @08:39AM (#1020437)
this could almost be embedded, which would be much cooler i think. you'd have to define objects with names from html tokens and do some ugly hacking with python's operators. you'd also have to add something other than space between strings (a "+" might be ok).

but once you've done that, this could be very neat. no processors - just constructing html in python.

(i don't know if this sounds crazy or not, but you can see the same kind of approach in lepl, which i wrote. the main problem is operator precedence.)

Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @04:12PM (#1021330)
Other folks have tried to solve the problem of cleanly creating HTML from within Python itself, which I think is what you are alluding to. It's not a goal for me. To the extent that my markup is pretty static, but the content is dynamic, I try to use a templating language beneath SHPAML. If the structure of the page itself needs to be dynamic, then I probably want to serve up JSON to the browser, not HTML, and then let Javascript manipulate the DOM, taking HTML (and SHPAML) mostly or completely out of the equation. I think there are some cases when you want the power of the server-side programming language to help you build documents, but that is often a smell that your documents are overly complex, or that your templating language is weak, or that your UI is too complicated for browsers, or that your client-side code isn't pulling its weight, etc.
Re:Beautiful mini language for outputing HTML in Python by andrewcooke on Tuesday December 29, 2009 @09:51PM (#1021797)
so, if i understand right, you think it's better to implement it as a separate language to stop people doing things that you don't think they should do, or think they don't need?

apart from stopping people from doing things, are there any what you might call "positive" reasons - advantages - to doing it your way?

Re:Beautiful mini language for outputing HTML in Python by showell on Wednesday December 30, 2009 @09:13AM (#1022424)
If my post made it sound like I am trying to stop people from doing anything, then it just came out wrong. I do think there are legitimate reasons to mostly build documents within a full-featured programming language, and I wouldn't stop people from doing that. I prefer to build the markup itself in a markup language with lightweight syntax, because documents should be readable, and markup languages have syntax specifically tailored for document readability. Then I supply dynamic content via the templating language.
Re:Beautiful mini language for outputing HTML in Python by RyanMcGreal on Tuesday December 29, 2009 @09:57AM (#1020541)
> If HTML were truly awesome, then you would not have Wikipedia; you would have Htmlpedia.

I don't buy this. The problem with HTML is not that it isn't expressive enough or that it's too hard to use; it's that arbitrary user code can easily compromise the integrity of your website.

Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @01:41PM (#1020991)
I wrote the comment about Wikipedia only to illustrate that HTML, like any standard, is not perfect for every use case.

I find HTML expressive and generally easy to use. I wrote SHPAML in a way that I hope preserves the useful expressiveness of HTML, while eliminating some of the 1990s-style syntax.

Re:Beautiful mini language for outputing HTML in Python by wglb on Tuesday December 29, 2009 @10:03PM (#1021807)
Browsers care about how html looks. We should think of html and css as the assembly language--generated by some server-side process.
Re:Beautiful mini language for outputing HTML in Python by mattmcknight on Tuesday December 29, 2009 @11:17AM (#1020659)
I prefer XML Builder templates (in Rails or Groovy) to this approach. It's similar, but SHPAML just drops enough stuff to have to be learned. You basically already know how to write Builder, it's that simple.
Re:Beautiful mini language for outputing HTML in Python by prodigal_erik on Tuesday December 29, 2009 @04:08PM (#1021316)
I'm disappointed they resorted to a one-way preprocessor. Is it really not feasible to make a first-class domain-specific language like this in Python?
Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @04:30PM (#1021365)
The reason I made SHPAML a one-way preprocessor is that my use cases haven't yet given me a compelling reason to write a round tripper, and preprocessing is simple to automate.

I do not know what your criteria are for judging a "first-class" DSL in Python, so I cannot comment on the feasibility. My goal was to create a simple markup language that maps well to HTML and plays nice with templates. SHPAML does that.

Re:Beautiful mini language for outputing HTML in Python by prodigal_erik on Thursday December 31, 2009 @04:03AM (#1024061)
Sorry, I misread the title "Beautiful mini language for outputing HTML in Python" as a DSL to be embedded in Python code rather than a separate text file (which is actually language agnostic after the preprocessor is done).
Re:Beautiful mini language for outputing HTML in Python by showell on Thursday December 31, 2009 @06:38PM (#1025204)
No worries. I am actually curious to your thoughts about DSLs. I love Python, but it is not really optimized for DSLs. You can obviously implement a DSL in Python, but embedding it is another story.
Re:Beautiful mini language for outputing HTML in Python by teehemkay on Tuesday December 29, 2009 @02:05PM (#1021038)
The language may be prettier than HTML but the name looks rather ugly to me. Doesn't sound as bad though :-)
Re:Beautiful mini language for outputing HTML in Python by dan_sim on Tuesday December 29, 2009 @11:04AM (#1020635)
Is HTML that hard to write?
Re:Beautiful mini language for outputing HTML in Python by wensing on Tuesday December 29, 2009 @11:18AM (#1020662)
If you don't use something like TextMate snippets (or some other auto-completion), then it's definitely overly-time-consuming IMHO.
Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @01:27PM (#1020961)
The movitation behind SHPAML isn't necessarily just to make the markup easier to write; it also tries to make it easier to read.
Re:Beautiful mini language for outputing HTML in Python by olegk on Tuesday December 29, 2009 @01:14PM (#1020925)
Good HTML is hard to write. Look up HTML source of several major websites, and you will see how badly indented it is. 95% of them won't validate. Look at this page. It doesn't even have a doctype.
Re:Beautiful mini language for outputing HTML in Python by wensing on Tuesday December 29, 2009 @02:23PM (#1021071)
That's largely because it's hard to care.

Browsers don't halt when fed less-than-good HTML the same way an interpreter/compiler dies when fed bad syntax.

Re:Beautiful mini language for outputing HTML in Python by drhowarddrfine on Tuesday December 29, 2009 @08:31AM (#1020423)
There's just something wrong about creating a language with a language to produce about in a third language. As Brian Kernighan told Dustin Hoffman one time, "Learn to code!".
Re:Beautiful mini language for outputing HTML in Python by nopal on Tuesday December 29, 2009 @08:40AM (#1020439)
While your language^3 comment is technically true, this seems to be simply shifting one markup syntax to another, using a language to perform the translation.

In addition, using something like SHPAML requires knowledge of the final output syntax, so the person using it must already know how to code.

Edit: In reading my response, it seems too curt. I definitely see your point, but more so in contexts other than this.

Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @06:12PM (#1021541)
It is not a promise, or even a goal, of SHPAML that it will relieve you the burden of understand the final output syntax, whether that is HTML or HTML combined with some template language.

SHPAML users are expected to be literate in both HTML semantics and syntax. The semantics of HTML are not abstracted away at all. The syntax is only abstracted away where it is redundant.

As a couple folks have pointed out, HTML is a pretty simple language. The problem with HTML is not its lack of simplicity; it is its verbosity.

So, if you use SHPAML, you undeniably get the terseness of SHPAML and the powerful semantics of HTML. So the question then comes down to simplicity. Does SHPAML eliminate too much of the simplicity of HTML syntax in trying to achieve terseness?

Re:Beautiful mini language for outputing HTML in Python by tpyo on Tuesday December 29, 2009 @08:49AM (#1020451)
How did Hoffman and Kernighan meet?
Re:Beautiful mini language for outputing HTML in Python by julius_geezer on Tuesday December 29, 2009 @09:30AM (#1020509)
Pulling your leg. Hoffman, who had learned in the "method acting" schools, apparently stayed up all night to look properly harrowed for a scene. Laurence Olivier, playing opposite, is said to have told him something like "Why don't you try acting, my boy? It's so much simpler."
Re:Beautiful mini language for outputing HTML in Python by showell on Thursday December 31, 2009 @06:30PM (#1025187)
The Laurnence Olivier analogy is stupid, inaccurate, and irrelevant.
Re:Beautiful mini language for outputing HTML in Python by kashif on Tuesday December 29, 2009 @10:25AM (#1020580)
What is the problem with using one language to produce another? How do you think your primary programmin language gets converted to assembly and then to machine code?

As far as I am concerned this is a useful abstraction on a trivial problem.

Re:Beautiful mini language for outputing HTML in Python by mbreese on Tuesday December 29, 2009 @11:15AM (#1020655)
The problem is that this is a trivial problem. Why add an abstraction on top of something that is already so simple?
Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @01:51PM (#1021014)
My problem with HTML is not its lack of simplicity; it is its verbosity. SHPAML solves the (fairly) trivial problem of making HTML less verbose. The abstraction pays off for me insofar as I expect to use SHPAML for the next decade or so, and it's easy to remember the syntax, easy to share the output, etc.
Re:Beautiful mini language for outputing HTML in Python by mbreese on Wednesday December 30, 2009 @01:46PM (#1022933)
Yeah, but how many other people will be using it? You may be planning on using it for a decade, but you will be in a very small minority. And so to share the output (the very common and portable HTML), you need to add another step to your workflow to convert things. This just seems like too much effort for very little gain.
Re:Beautiful mini language for outputing HTML in Python by showell on Wednesday December 30, 2009 @02:21PM (#1023029)
If 0.001% of the world's population uses it, I think that comes out to something like 60,000 people.

You can see here that I've already solved the problem of sharing SHPAML output using HTML:

http://shpaml.webfactional.com/

You are right about it adding a step to my workflow. If only there was some kind of machine that could automate things for me...

Re:Beautiful mini language for outputing HTML in Python by timtadh on Tuesday December 29, 2009 @11:47AM (#1020717)
Well machine language is pretty simple especially when you use something like MIPS. It can even be pretty fun to code in if you assembler has good macro support. However there is value is adding an abstraction layer on top of machine code. I think what people are really trying to say in these comments is that this new mini language does not provide useful value vs HTML like C provides vs. MIPS. Cheers.
Re:Beautiful mini language for outputing HTML in Python by Confusion on Tuesday December 29, 2009 @02:26PM (#1021076)
Right, just like creating Python with C is 'just wrong' if you're going to be writing applications that produce HTML?
Re:Beautiful mini language for outputing HTML in Python by jmonegro on Tuesday December 29, 2009 @11:26AM (#1020677)
I don't see why I would use that over this: http://lab.xms.pl/markup-generator/ Not only does it have the same syntax (with some improvements), but it also gives me the CSS to work with. AND I don't have to install python. Hooray.
Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @01:48PM (#1021004)
You don't technically need to install python to use SHPAML. You can try it online:

http://shpaml.webfactional.com/tutorial/7

SHPAML is mostly targeted at Python users for now. If you are not using Python, but you like the idea of having a syntax layer on top of HTML, then you should consider other solutions like the markup generator or haml.

Re:Beautiful mini language for outputing HTML in Python by jmonegro on Tuesday December 29, 2009 @02:49PM (#1021120)
Still, the markup generator gives you CSS markup as well.
Re:Beautiful mini language for outputing HTML in Python by showell on Tuesday December 29, 2009 @03:05PM (#1021169)
Ah, that is indeed a nice feature. When I first looked at haml, I was all about the indentation (being from Python) and rather skeptical of the CSS sugar. But once I ported the CSS sugar to SHPAML, I found I started writing better markup. I haven't bothered to automate any CSS generation from SHPAML, not because I don't think it would be a useful feature, but because I have a lot less experience with CSS to know what the pain points are. (I have pain points with CSS, but they are either just due to my own ignorance or problems not easily solved.)