Re: [fonc] Macros, JSON

2013-07-22 Thread Chris Gahan
Hey John, If you don't mind me asking, what's the higher level goal of this tool you're making? Are you interested in transforming JSON? Querying JSON? If you're interested in queries, Freebase has a very nice graph query system (called MQL) where the user gives it a JSON structure as a query

Re: [fonc] Macros, JSON

2013-07-22 Thread John Carlson
I was introduced to freebase by James Burke's (of Connections fame--highly recommended TV series) k-web project and played with it some. I am more interested in transforming JSON with macro-JSON, with the possibility of macro-JSON transforming itself. However if freebase has implemented some

Re: [fonc] Macros, JSON

2013-07-22 Thread John Carlson
Well, I also think querying is a good idea. I think I will need the equivalent of XPath or perhaps XQuery for indexing stuff in JSON. I think I'm targetting my stuff to replace XSLT, if that is possible. I'd like it to be done with end-user programming inside and between editors. Something

Re: [fonc] Macros, JSON

2013-07-21 Thread James McCartney
I thought about this briefly. One issue is how to distinguish literal strings from identifiers. On Sun, Jul 21, 2013 at 10:28 AM, John Carlson yottz...@gmail.com wrote: Hmm. I've been thinking about creating a macro language written in JSON that operates on JSON structures. Has someone done

Re: [fonc] Macros, JSON

2013-07-21 Thread Alan Moore
As an alternative to JSON you might consider EDN: https://github.com/edn-format/edn Alan On Jul 21, 2013, at 11:46 AM, John Carlson yottz...@gmail.com wrote: Hmm. I've been thinking about creating a macro language written in JSON that operates on JSON structures. Has someone done similar

Re: [fonc] Macros, JSON

2013-07-21 Thread Alan Moore
JSON is all well and good as far as lowest common denominators go. However, you might want to consider EDN: https://github.com/edn-format/edn On the other hand, if you are doing that then you might as well go *all* the way and re-invent half of Common Lisp :-)

Re: [fonc] Macros, JSON

2013-07-21 Thread John Carlson
You would have to create a JSON object which would have key (identifier), value pairs. On Jul 21, 2013 3:22 PM, James McCartney asy...@gmail.com wrote: I thought about this briefly. One issue is how to distinguish literal strings from identifiers. On Sun, Jul 21, 2013 at 10:28 AM, John

Re: [fonc] Macros, JSON

2013-07-21 Thread John Carlson
I think what would be more difficult would be identifying what is persistent and what is runtime values. Also, JSON doesn't contain pointers, so one would have to use strings for pointers. On Jul 21, 2013 3:22 PM, James McCartney asy...@gmail.com wrote: I thought about this briefly. One issue

Re: [fonc] Macros, JSON

2013-07-21 Thread John Carlson
Or numbers for pointers... On Jul 21, 2013 3:43 PM, John Carlson yottz...@gmail.com wrote: I think what would be more difficult would be identifying what is persistent and what is runtime values. Also, JSON doesn't contain pointers, so one would have to use strings for pointers. On Jul 21,

Re: [fonc] Macros, JSON

2013-07-21 Thread John Carlson
What makes this important is whether your running in stateless or stateful mode. If you only run the macro once no big deal. If you try to run on a server, you may find that you need to reset items like cursors to their original values. On Jul 21, 2013 3:43 PM, John Carlson yottz...@gmail.com

Re: [fonc] Macros, JSON

2013-07-21 Thread John Carlson
Hmm. Seems like someone has already done XMLisp. I thought s-expressions were the lowest common denominator. JSON is all well and good as far as lowest common denominators go. However, you might want to consider EDN: https://github.com/edn-format/edn On the other hand, if you are doing that

Re: [fonc] Macros, JSON

2013-07-21 Thread Casey Ransberger
Lisp is such a joy to implement. FORTH is fun too. I'm working on a scheme-alike on and off. The idea is to take the message passing and delegation from Self, expose it in Lisp, and then map all of that to JavaScript. One idea I had when I was messing around with OMetaJS was that it might

Re: [fonc] Macros, JSON

2013-07-21 Thread Casey Ransberger
Probably a more usable language would be arrived upon via some extensions to JSON. May I recommend OMetaJS? :) The lack of a unique atomic symbolic literal as distinct from a string is one of the things I'm grappling with right now. To get that I'd need to intern the atoms. Jury's out whether

Re: [fonc] Macros, JSON

2013-07-21 Thread Tristan Slominski
All this talk of macros and quotes reminds me that there is Kernel language where they are extraneous (if I understand it correctly). Operative and applicative combiners are used explicitly: http://www.wpi.edu/Pubs/ETD/Available/etd-090110-124904/unrestricted/jshutt.pdf On Sun, Jul 21, 2013 at

Re: [fonc] Macros, JSON

2013-07-21 Thread BGB
On 7/21/2013 12:28 PM, John Carlson wrote: Hmm. I've been thinking about creating a macro language written in JSON that operates on JSON structures. Has someone done similar work? Should I just create a JavaScript AST in JSON? Or should I create an AST specifically for JSON manipulation?