News for hackers. Stuff that matters.
Re:Jsonnet – A data templating language by isuckatcoding on Saturday June 23, 2018 @03:57PM (#17383111)
Of course not to be confused with https://jasonette.com/

Naming things is the hardest thing...

:)

Re:Jsonnet – A data templating language by DonHopkins on Saturday June 23, 2018 @07:57PM (#17384140)
Reminds me of Marimba's product Castanet (which went with Bongo). Named by the same genius who came up with the name "Java" -- Kim Polese.

https://www.wired.com/1996/11/es-marimba/

http://www.suck.com/netmoguls/96/10/18/front.html

http://www.suck.com/netmoguls/96/10/18/back.html

Kim said: "It was fun naming stuff back then. You could actually get the trademark/website!"

Re:Jsonnet – A data templating language by tylorr on Saturday June 23, 2018 @05:41PM (#17383607)
And then there is Json.NET https://www.newtonsoft.com/json
Re:Jsonnet – A data templating language by ckluis on Saturday June 23, 2018 @05:08PM (#17383452)
jasonette has always seemed like something that could be amazing
Re:Jsonnet – A data templating language by nv-vn on Saturday June 23, 2018 @06:26PM (#17383789)
Thought so too until I tried it. Once you get started with it, it quickly becomes clear that it's all built on top of hacks that won't scale past a 1 page app. It's not a bad choice for prototyping, but I'm not convinced that it's any easier than prototyping with a real framework like Flutter.
Re:Jsonnet – A data templating language by ropeadopepope on Saturday June 23, 2018 @06:39PM (#17383833)
Too many {} and "" for rapid prototyping for me. I've always considered forking it to use yaml instead.
Re:Jsonnet – A data templating language by murukesh_s on Saturday June 23, 2018 @07:00PM (#17383919)
For me (I believe few others) the {} and "" are ok as they provide a clear and consistent separation of structure and type at a quick glance, but the comma? That should have been avoided as even in JavaScript semicolons are increasingly being abandoned..
Re:Jsonnet – A data templating language by chrisweekly on Sunday June 24, 2018 @09:53AM (#17386557)
> "even in JavaScript semicolons are increasingly being abandoned"

Disagree. In my experience the trend is in the opposite direction: ASI is broadly acknowledged to cause problems, CoffeeScript turned out to be a trainwreck, and popular defaults for linters tend to enforce semicolons.

Re:Jsonnet – A data templating language by DonHopkins on Saturday June 23, 2018 @07:42PM (#17384078)
Here's a question I've been trying to answer:

Q: How can you conveniently and compactly represent, view and edit JSON in spreadsheets, using the grid instead of so much punctuation?

I’ve come up with a simple format and convenient conventions for representing and editing JSON in spreadsheets, without any sigils, tabs, quoting, escaping or trailing comma problems, but with comments, rich formatting, formulas, and leveraging the full power of the spreadsheet.

It's a work in progress, and I have posted a few messages about it on HN. I'm in the process of writing it up now on Medium (but I'll publish it now so you can read it). I welcome any feedback, criticisms and suggestions, please!

https://medium.com/@donhopkins/representing-and-editing-json...

https://news.ycombinator.com/item?id=17309132 https://news.ycombinator.com/item?id=17360071 https://news.ycombinator.com/item?id=17360799 https://news.ycombinator.com/item?id=17360883

Here's an example spreadsheet -- check out the examples in the different sheets (the tabs along the bottom):

https://docs.google.com/spreadsheets/d/1nh8tlnanRaTmY8amABgg...

Here's a sample implementation, that runs in the browser, node.js, as a Google Spreadsheet extension, etc:

https://github.com/SimHacker/UnityJS/blob/master/UnityJS/Ass...

As well as parsing JSON structures out of raw spreadsheet data, that code also returns a tree of scopes that you can use for syntax coloring or error message feedback, because I'm integrating it with Google Sheets (but the parser is independent of the particular spreadsheet, and just operates on 2D array of strings).

It would be nice to develop it into a macro templating engine for JSON (or higher level structures that happen to be represented as JSON). Kind of like Genshi (the XML/Python templating system that I’ve used a whole lot and love for its simplicity).

https://genshi.edgewall.org/

Re:Jsonnet – A data templating language by chrisweekly on Sunday June 24, 2018 @10:08AM (#17386606)
Cool! This should be a top-level "Show HN" post.
Re:Jsonnet – A data templating language by mnr on Saturday June 23, 2018 @06:48PM (#17383868)
Right? One time my boss asked me to do something in JSON but I explained to him I simply couldn’t work with JSON because of the braces and quotes. JSON is practically unusable.
Re:Jsonnet – A data templating language by heavenlyhash on Saturday June 23, 2018 @07:45PM (#17384096)
Good lord, wait until someone shows you computers. All the ones and zeros. A real mess we all can agree.