[LISP] [Web] Let's work on the new Lispweb! [Standard]
Name:
Anonymous2015-08-17 1:10
We're all sick of dealing with the verbosity of XML/SGML based languages, the inconsistency of CSS and the overall badness of Javashit. Transcompiling to any of these languages is just a half-assed try at sugarcoating a turd.
Post your ideas for syntax/semantic rules, document structure, protocols, rendering techniques or anything relevant to the topic.
Hopefully we will be able to create a basic clone of /prog/ using the newly designed languages. No need to work on retarded features like animations or ``single page applications'' because this project is aimed exclusively at EXPERT PROGRAMMERS.
Using Sexps is the obvious way to go until you realize ))))) is only marginally better than </div></div></span></div></html>. I propose we use FIOC. It can be easily edited by humans on any text editor without installing any plugins.
It would look like # This is a comment # Header name "/prog/ - Programming" # Content section title "Giant sea cucumber eats with its anus" text "This is a post" section
>>3 is stupid there is a problem with sexps though. Assuming you use strings e.g. (body (p "welcome to my `cool' website")) then you are fucked if you want to use " inside a string, yes you can \" escape it but what if you wanted to paste some large text from esle-where into a lispweb document. You need a special editor or something.
XML gets around this problem by .... wait no it doesn't fuck XML.
Anyway it might be useful to have triple quote """ strings which allow stuff like " inside it.
A stack for parenthesis, car and cdr are all you need to unambiguously parse this. (body (p welcome to my `cool' website)) works just as fine as long as your ``subset'' of S-exprs doesn't have a quote function (you don't need a full-fledged Lisp to describe and format text anyway).
Name:
Anonymous2015-08-17 7:05
>>5 If you are the owner of that host, would you like to host old /prog/?
))))) is only marginally better than </div></div></span></div></html>
This is wrong though, right parentheses don't contain information about what expressions they close, so there is no ambiguity or question about their function. In (HT|X)ML though, you must close your tag with the name of the tag you are closing, giving rise to a whole class of errors of the form <tag1><tag2></tag1></tag2>. The removal of this class of errors makes writing, reading, and parsing the language much easier for computers and humans alike. Have you ever had the misfortune of having to use a tagsoup-like XML "parser"? Sexps make them obsolete: since there are no closing tags, all sexprs with the right number of parentheses form valid trees.
Name:
Anonymous2015-08-17 20:22
>>11 It makes the document easier to parse, but it's still a pain in the ass to read by a human. This is why S-exprs are better but only marginally.
Name:
Anonymous2015-08-17 20:26
>>10 Escape them. (body (p Welcome to my `cool' website \(this is my example text\) ) (body (p Welcome to my `cool' website %(this is my example text%) )
Name:
Anonymous2015-08-17 21:54
What does /frog/ think of <http://haml.info/>? It's Ruby shit but it looks cleaner than Sexps.
Name:
Anonymous2015-08-17 22:22
>>13 so coming up with some weird new lisp syntax that no one else uses and hase unclear whitespace semantics and escaping brackets.. instead of using normal sexps and escaping quotes inside strings is somehow better? color me unimpressed
Name:
Anonymous2015-08-17 22:22
>>14 hipster/10, perhaps you would be more at home on hacker news?
Name:
Anonymous2015-08-17 22:26
How would Niggers (tongue) ``my anus''! be expressed in this s-expression based language?
Using quotes: (b "Niggers " (u "(tongue)") " " (i "``my anus''")) "!" Drawbacks: - That silly " " between the (u) and the (i) - Quote overload. If the language allows single or double quotes for delimiting strings, we end up with the '""' and "''" crap used in Bash and FIOC. If only one type of quotes is allowed, it would be necessary to escape any other kind of quotes.
Typing the text straight a la BBCode: (b Niggers (u \(tongue\)) (i my anus))! Drawbacks: - Ugly escaping - Any whitespace after the function name can't be used as a delimiter anymore. This means (b Niggers(u \(tongue\))(i my anus)) ! would output Niggers(tongue)my anus!. This means whitespace is now significant.
Anything else?
Name:
Anonymous2015-08-17 22:27
>>15 In the case you allow strings to be escaped, how would you nest tags like in BBCode and HTML?
Name:
Anonymous2015-08-17 23:08
Let ((( be an escape sequence for [[[ and [[[ an escape sequence for (((.
Name:
Anonymous2015-08-17 23:10
>>17 What if the parser is aware of tags that have text arguments. It could read until the next balanced closing non-escaped paren.
>>23 You would not be able to represent unbalanced {} inside of a {}. But inside of a [] you could escape [,] with backslashes, and backslashes need to be escaped. Arbitrary text would be serialized safely inside of a [] with [,],\ escaped. Most hand written documents would have balanced brackets and could be written inside of {} without worry about escaping any characters.
With backslashes if they were not balanced. Backslashes need to be escaped with more backslashes. In most text they are balanced, so someone writing a document wouldn't need to worry about backslash hell with {}.
HTML already escaping < > and &, though it's phenomenally worse by requiring the shitty longhand < > &. Having a single backslash here & there like better languages is an improvement.
Fuck, just do sexprs with angle brackets: <b Here is my text, but 2 \< 3 still needs an escape>
Name:
Anonymous2015-08-18 11:51
Fuck all y'all's fixed definition of delimiters.
The first two space-delimited symbols of the document should declare the opening & closing delimiters. Inside the document, a "delimiters" tag can specify new ones within its scope.
( ) (b Hey, it's plain sexpr with real parens!) \(but we don't want to have to do this \(escaping shit\)\) (delimiters << >> <<p So why not <<b (switch (it (up)))?>>>>)