9 ms·
So this is literally Lisp, just with curly braces instead of parenthesis :). I don't understand this part of the readme: > The advantage of Mark over S-expres
by TeMPOraL 9y ago
So this is literally Lisp, just with curly braces instead of parenthesis :).
I don't understand this part of the readme:
> The advantage of Mark over S-expressions is that it is more modern, and can directly run in browser and node.js environments.
Does this mean I'm so out of date with JS that this syntax is actually legit JS? Or does Mark run its own parsers, at which point it's just like sexps, except it uses the "more modern" curly brace instead of "less modern" parenthesis?
- hepta 9y agoDoesn't seem like valid JS, you wouldn't need mark.js if that were the case.
- afandian 9y agoYes you would. JSON is valid JS, and executing JSON in a browser is a recipe for disaster.
- minitech 9y agoJSON isn’t valid JS – its representation of strings allows U+2028 and U+2029 to appear unescaped, but JavaScript string literals don’t. Not sure how else executing (valid) JSON in a browser would be a recipe for disaster? `eval` was the standard way to parse JSON from trusted sources for a long time.
- maxaf 9y ago"More modern" is a euphemism for "not made by someone who had a gray beard in 1975". It's just another form of ageism.
- orf 9y agoIt's sad that you feel that improving older, outdated technologies is a form of ageism.
- masklinn 9y ago"Mark" does not improve on anything.
- TeMPOraL 9y agoThe problem here is that "modern" is usually a justification for regression, relative to older technologies, usually done by people who never bothered to look at the old technologies before declaring them obsolete.
- Momquist 9y agoReminds me of a recent talk at FOSDEM based on this premise. The circuit less traveled. Investigating some alternate histories of computing: https://www.youtube.com/watch?v=jlERSVSDl7Y https://www.youtube.com/watch?v=jlERSVSDl7Y
- TeMPOraL 9y agoWow, that was a surprisingly insightful talk; thanks for linking! I'm intrigued in particular by the talk's conclusion about (I guess, again) disappearing distinction between volatile and non-volatile storage. To date, I've been a vocal advocate of hierarchical filesystems (not UNIX, but just as a unit of user-facing abstraction). The talk sent me on the way of reflecting whether I'm not just supporting another historical "wrong path". Lots of more thinking in front of me here. So thanks.
- maxaf 9y agoIt is sad that so much junior talent is wasted on attempts at improvement via blind reiteration. This is one possible consequence of a mentorship vacuum: bright minds look for challenges, even ones that have been adequately overcome long ago. Imagine the good that would come of directing such energy with a clear purpose.
- hobofan 9y agoThere is nothing sad in that. Yes, it might be non-optimal, but by trying out your own approach you will find out its limitations first-hand and understand the problem and reasoning behind alternate approaches much better. Junior talent doesn't become senior talent by just doing the right things, but by doing the wrong things and learning from them.
- masklinn 9y agoEven by that criteria, there's EDN, which is basically sexp with more built-in types (and extensibility).
- nfoz 9y agoThe only ageist thing here is that you assumed the author's age, or that it had anything to do with the claim of modernity.
- maxaf 9y agoYour statement is factually incorrect.
- henryluo 9y agoBeing 'more modern' means Mark takes a JS-first or web-first approach in its design. Whether we like it or not, JS has dominated the web. JSON is successful, partly because it takes a JS-first approach. Mark inherits this approach.
- dragonwriter 9y ago> So this is literally Lisp No, it's close to S-expressions, but it's not a programming language like Lisp. > just with curly braces instead of parenthesis Well, and more syntax than S-expressions: it's got both objects and arrays as fundamental structures instead of just lists, and it has commas as noise characters.
- masklinn 9y ago> Well, and more syntax than S-expressions: it's got both objects and arrays as fundamental structures instead of just lists Which can easily be added to sexps (see EDN).
- TeMPOraL 9y agoYeah, didn't mean it that literally. > it's got both objects and arrays as fundamental structures instead of just lists I'm bit sad that various lisps never standardized on a format for this; had they, then maybe we would have S-expressions as a popular data interchange format.
- nabla9 9y agoThey did. It's called Common Lisp.
- TeMPOraL 9y agoCommon Lisp doesn't have a standard representation of hash tables, unfortunately. Also, CL didn't clean up the Lisp space completely; right now, there are Schemes, there's Clojure, LFE, Hy, and bunch of other niche Lisps, each with their own idiosyncrasies around syntax.
- zeveb 9y ago> Common Lisp doesn't have a standard representation of hash tables, unfortunately. Ah, but you mentioned objects & arrays, not hash tables grin. Agreed that hash tables would have been nice, although that does then get into issues such as canonical representations (which matter e.g. for hashing). > Also, CL didn't clean up the Lisp space completely; right now, there are Schemes, there's Clojure, LFE, Hy, and bunch of other niche Lisps, each with their own idiosyncrasies around syntax. It would be nice if folks who want to use Lisp would use Common Lisp rather than reïnventing various forms of more-or-less round wheel. It's a remarkably well-engineered language (not perfect, of course: argument order, upcasing, pathnames & environments all leap to mind as problematic areas), and so far as I can tell quite a bit better than any of the alternatives. In particular, it'd be really nice to see people using Schemes for serious engineering work to use Lisp instead. It's just not well-suited to writing large systems, except by grafting on an ad-hoc, informally-specified, potentially bug-ridden subset of Lisp.
- k__ 9y agoI don't understand it either. Looks like s-expressions to me and it isn't legit JS.
- Bahamut 9y ago> Does this mean I'm so out of date with JS that this syntax is actually legit JS? Or does Mark run its own parsers, at which point it's just like sexps, except it uses the "more modern" curly brace instead of "less modern" parenthesis? It has its own parsing and stringify library it looks like: https://github.com/henry-luo/mark#markjs https://github.com/henry-luo/mark#markjs
- anon1253 9y agoPerhaps more like EDN since it doesn't have a runtime. But yeah, it's s-exps with curly braces. Which in my opinion, look worse than round parentheses … but that's opinion https://github.com/edn-format/edn https://github.com/edn-format/edn https://learnxinyminutes.com/docs/edn/ https://learnxinyminutes.com/docs/edn/
- dunham 9y agoI really like edn. I wish it were more widely used. It hits a sweet spot for me between yaml and json. Yaml is easy to type/read, but I feel it's a bit too complex on the parsing side. And json is a pain to type, so I'm reluctant to use it for human entered configuration files.
- odammit 9y agoIt runs its own parser. Which means mark is a big silly ol string until you parse it. var obj = Mark.parse(`{div {span 'Hello World!' }}`);
- raiflip 9y agoGenuine question, my impression is that Lisp is dynamically typed, but this uses type declarations. Would that make it different than Lisp?
- bjoli 9y agoLisp has strong typing, so 1 is 1, not "1" or #\1, which, unless mark has a built in way of annotating types doesn't give this any advantages over s-expressions.
- kazinator 9y agoLisp expressions also don't have any annoying type clutter that you have to have at every node in the syntax. Like (1 "1") is just a list of two things; we don't need the word "list" anywhere.
- kmill 9y agoDescriptions of typing are about as unevenly used as descriptions like "pass by reference." (So, practically useless.) In Lisps: - values have types (bool, symbol, number, list, array, structs, functions, ...) - variables have by default one type: union of all the above - in Common Lisp, you can restrict the types of values allowed in a variable > but this uses type declarations I must have missed this. If it's not just what struct-like entities are allowed in the markup, where did you see that?
- davidzweig 9y agoI would have rather said it's like QML language (which is used as the basis for Qt QML UI language). Can't find the link to the reference for plain QML. QML is like JSON, but with typed objects, and objects can have children in turn, so you can create tree structures from objects. It's actually very nice, I wish it had parsers for more languages.
- dustingetz 9y agoEDN, in addition to being simpler, also has an optimized transport abstraction, transit, which serializes to application/transit+msgpack (binary) or application/transit+json (often vastly faster deserialization than messagepack because which hits the language native JSON parsers for performance in web browser, python, etc). It surprised me how big a deal hitting native json parsers is, EDN was at the top of our profiler for 100kb payloads but transit+json is zippy. The abstraction also handles value de-duplication and has a human-readable verbose writer. http://blog.cognitect.com/blog/2014/7/22/transit http://blog.cognitect.com/blog/2014/7/22/transit http://cognitect.github.io/transit-tour/ http://cognitect.github.io/transit-tour/ cool project though, good to see s-expressions become more popular
- henryluo 9y agoFirstly, I highly respect Lisp personally, and I have no intention of downplaying it. As some have seen, the Lisp spirit is actually in the design of Mark. Secondly, to clarify what I mean by 'being more modern'. Of course, it does not mean changing from () to <> or {}, will make it more modern or something better. Being 'more modern' means Mark takes a JS-first or web-first approach in its design. Whether we like it or not, JS has dominated the web. JSON is successful, partly because it takes a JS-first approach. Mark inherits this approach. Being JS-first, means there'll be least adoption barrier in web. Being JS-first, of course does not mean JS-only. Mark is designed to be generic and used by other programming languages like JSON.
- KirinDave 9y agoIt's literally common lisp down to the use of pre-expressions with no binding as pragmas. It's like lisp someone dropped on a char and now all the parenthesis have a funny bump. But it's not literally lisp in the sense that the meta-syntactic stuff isn't there.
- aylmao 9y agoIt's a superset of JSON, which is valuable.