Live data from Hacker News

How to build cross-platform mobile apps with JSON

medium.freecodecamp.com

11–20 of 43 posts

Re: How to build cross-platform mobile apps with JSON

#11

So why JSON of all things? When I reached the "write a full declarative program in JSON" section I was internally screaming "but s-expressions!"

can you elaborate on s-expressions?

About four paragraphs in https://en.wikipedia.org/wiki/Lisp_(programming_language)

    "The interchangeability of code and data gives Lisp its instantly recognizable syntax. All program code is written as s-expressions, or parenthesized lists. A function call or syntactic form is written as a list with the function or operator's name first, and the arguments following; for instance, a function f that takes three arguments would be called as (f arg1 arg2 arg3)."

Re: How to build cross-platform mobile apps with JSON

#12

Earlier quoted context omitted.

can you elaborate on s-expressions?

About four paragraphs in https://en.wikipedia.org/wiki/Lisp_(programming_language) "The interchangeability of code and data gives Lisp its instantly recognizable syntax. All program code is written as s-expressions, or parenthesized lists. A function call or syntactic form is written as a list with the function or operator's name first, and the arguments following; for instance, a function f that takes three argument…

Oh yeah, I understand that part. I was just wondering what OP meant in his sentence.

Re: How to build cross-platform mobile apps with JSON

#13

Earlier quoted context omitted.

About four paragraphs in https://en.wikipedia.org/wiki/Lisp_(programming_language) "The interchangeability of code and data gives Lisp its instantly recognizable syntax. All program code is written as s-expressions, or parenthesized lists. A function call or syntactic form is written as a list with the function or operator's name first, and the arguments following; for instance, a function f that takes three argument…

Oh yeah, I understand that part. I was just wondering what OP meant in his sentence.

Meaning it's going far out of it's way to half-write a programming language in json rather than actually just using a lisp.

Re: How to build cross-platform mobile apps with JSON

#14
post #13

Earlier quoted context omitted.

Oh yeah, I understand that part. I was just wondering what OP meant in his sentence.

Meaning it's going far out of it's way to half-write a programming language in json rather than actually just using a lisp.

But why would you use lisp? I don't get it. No API returns data in a list format.

Re: How to build cross-platform mobile apps with JSON

#15

So why JSON of all things? When I reached the "write a full declarative program in JSON" section I was internally screaming "but s-expressions!"

can you elaborate on s-expressions?

Sure. S-expressions[1] are a notation for nested data structures. They can be used to spell out data as well as code. In fact both code and data look the same when expressed using s-expressions.[2]

When the article's author describes both code and data using JSON, it sounds a little strange to me. While JSON is capable to describing nested data structures, JSON's syntax is much more verbose than s-expressions. I feel that since s-expressions have been around for about 60 years that the author should be familiar with them and address why a JSON encoding is superior to s-expressions for this use case.

1 - https://en.wikipedia.org/wiki/S-expression

2 - http://wiki.c2.com/?DataAndCodeAreTheSameThing

Re: How to build cross-platform mobile apps with JSON

#16
post #13

Earlier quoted context omitted.

Meaning it's going far out of it's way to half-write a programming language in json rather than actually just using a lisp.

But why would you use lisp? I don't get it. No API returns data in a list format.

Lisps aren't limited to lists as data types, you can have anything you want.

Lisp interpreters tend to be dead simple to implement.

Re: How to build cross-platform mobile apps with JSON

#17
post #13

Earlier quoted context omitted.

Meaning it's going far out of it's way to half-write a programming language in json rather than actually just using a lisp.

But why would you use lisp? I don't get it. No API returns data in a list format.

EDN (s-expressions + Clojure's reader)[1] got a lot of attention when it was announced. It looks like it's garnered some use [2]. I was hoping to find a registered mime type "application/s-expr", but there are some uses out in the wild[3].

1 - https://news.ycombinator.com/item?id=4487462

2 - https://github.com/search?utf8=%E2%9C%93&q=%22application%2F...

3 - https://github.com/search?utf8=%E2%9C%93&q=%22application%2F...

Post reply on HN