Live data from Hacker News

Lisp-like html as a replacement to bbcode/markup/textile

94.249.190.129

31–40 of 83 posts

Re: Lisp-like html as a replacement to bbcode/markup/textile

#31
post #28

Nice experiment. There's an issue with curly braces { }. When typing in Russian (and in other Cyrillic languages) you need to switch keyboard layout before and after each curly brace. It quickly becomes tiresome to do: type-in-russian, switch-layout, type-{, switch-layout, type-in-russian etc. This problem also exist in Markdown too: square brackets [ ] and curly braces { } both live on the same keys as Russian 'Х' a…

Out of curiosity, do Russian developers permanently use an English layout, or just map these keys elsewhere?

Pretty much all programming languages out there were designed with QWERTY layout in mind. You see, who in his right mind would make brackets more easily reachable than parenthesis?

Hence, many many developers use a US layout instead of their native one, even if their native one is somewhat similar to the US one. This is true for pretty much all European layouts and certainly for more foreign ones.

Its a mess, basically.

Re: Lisp-like html as a replacement to bbcode/markup/textile

#32
post #28

Nice experiment. There's an issue with curly braces { }. When typing in Russian (and in other Cyrillic languages) you need to switch keyboard layout before and after each curly brace. It quickly becomes tiresome to do: type-in-russian, switch-layout, type-{, switch-layout, type-in-russian etc. This problem also exist in Markdown too: square brackets [ ] and curly braces { } both live on the same keys as Russian 'Х' a…

Out of curiosity, do Russian developers permanently use an English layout, or just map these keys elsewhere?

I'm Bulgarian, not Russian. But developers here all use standard US-English layouts. In fact, everybody I know just uses a US-English layout by default, you can't really do anything except write Cyrillic text with a Cyrillic layout.

Re: Lisp-like html as a replacement to bbcode/markup/textile

#33
post #28

Nice experiment. There's an issue with curly braces { }. When typing in Russian (and in other Cyrillic languages) you need to switch keyboard layout before and after each curly brace. It quickly becomes tiresome to do: type-in-russian, switch-layout, type-{, switch-layout, type-in-russian etc. This problem also exist in Markdown too: square brackets [ ] and curly braces { } both live on the same keys as Russian 'Х' a…

Out of curiosity, do Russian developers permanently use an English layout, or just map these keys elsewhere?

Switching layout is not an issue when typing code. You just type in English because keywords and API are obviously in English. The problem exist only for markup languages where you type prose.

Still (in addition to English letters) these are hard to type in Russian layout: { } ' @ # $ ` (and more - depends on a keyboard and operating system).

Update. I've just noticed square brackets [ ] on my (Cyrillic) Mac keyboard. They are on a key with tilde ~ and backtick `. Before this very comment I didn't know I could type square brackets in Cyrillic layout... This should make Markdown much easier!

Re: Lisp-like html as a replacement to bbcode/markup/textile

#37
post #18

This would never replace bbcode. The best thing to replace that is markdown. People don't really grok tags very well at all. BBCode only works because of WYSIWYG editors that do the work for the user. That and the wide acceptance meaning that sites like Flickr produce BBCode embed statements. Markdown works well for people just typing in plain text but still getting something formatted without trying to tag things. I…

Err, replacement is maybe too strong a word. I should have said alternative. I don't have any such ambitions, but I plan to use this instead of bbcode on all my personal sites from now on. There's a lot of room for convenience in the form of transformations like I did with the tables. I could use this for my blog editor and add a {coffeescript ...} and {dart ...} tag for example, or automatically pass closure on js code. For users, it's really powerful because it can let them use style tags safely on elements.

Re: Lisp-like html as a replacement to bbcode/markup/textile

#38
post #2

Looks a lot like TeX, which is a good thing. In fact this might even be better. I'm tired so I might be missing an obvious weakness but to take the analogy a bit further here are some comparisons between this suggestion and a more TeX-like version. The author's suggestion: {b {i This is in italics and bold.}} {Henny+Penny We can use google fonts anywhere if we just import them first with the google-font code} {macro…

Main problem with author's suggestion is that he mixes everything together, so he'll get into the markup version of DLL-hell. E.g. How do I use relative links? Is {subdir Hello world} a relative link, a font-name, or a new and yet unsupported tag? Html handles this: versus versus ... Oh, and why support font names and colors directly in tags in 2012? He should support class names instead! Why is "fontname from URL" h…

you can use the _style attribute with any element. For example {b_style="font-size:20;font-family:Courier New" content}. I intended it to work with other html attributes, so using multiple attributes would look like this {b_attr1='asdf'_attr2="asdf" content}. It would be just like html almost except for the quirky syntax. I only allow syntax for now because it's intended to be safe and I didn't want to allow things like onclick or anything javascript. Allowing a class attribute is also easy, but for now I didn't want to because the site I will be adding it to soon could use a previously defined class that's width 600 or something. Right now style is well controlled if you try to make things too wide or use something like display:none

Re: Lisp-like html as a replacement to bbcode/markup/textile

#39
I think that this is an interesting experiment, and reminds me of Clojure's hiccup[1] library.

In hiccup, you model html to be rendered as nested vectors and maps, such that

    bar
becomes

    (html [:span {:class "foo"} "bar"])
Where this is a real win is when you realize that it's just data:

    (html [:ol
            (for [x (range 1 4)]
              [:li x])])
Lisps are well suited to model html.

[1] https://github.com/weavejester/hiccup

Re: Lisp-like html as a replacement to bbcode/markup/textile

#40

I don't get how people likes Lisp syntax so much, for me it looks horrible. I would prefer markdown as a replacement for BBCode

Line by line parsers are much much more limited. This can support syntax transformations and html attributes. This is more of an html-alternative in terms of capability. Markdown links are ugly and you need double space instead of single space for every space you input. I could do something like replace things nested in as italics but I'd rather have normal characters not turned into formatting. Lisp might look ugly in comparison to python, but not html and bbcode.
Post reply on HN