6 ms·
I always wonder with this kind of posts, is it minimalistic or is it an alternative?
by Uchikoma 13y ago
I always wonder with this kind of posts, is it minimalistic or is it an alternative?
- RyanZAG 13y agoIt's technically an alternative, but since it performs worse and has less features you would probably never actually use it as an alternative. It should probably be described as 'an easily embeddable and extendable(?) option for hosting your golang web app'.
- oakaz 13y agojust updated the title now
- jacques_chester 13y agoThe point is that it's written in language-du-jour and therefore fascinating and novel. In fairness though, json will probably wind up being a common configuration format anyhow. And the idea of programmatically configurable system software is nice. I liked the Mongrel2 approach of having it in SQLite.
- harrytuttle 13y agojson is fine until your config system needs accurate numeric values.
- shuzchen 13y agoNothing in the json spec requires that numbers are limited to those internally representable in a javascript runtime. With the right tooling, you can encode/decode very accurate numeric values. I'm not familiar with the go libraries, but python's simplejson has a use_decimal flag that interprets floats using python's Decimal module. That said, I can't think of any reason a web server needs super accurate numbers. All the config options I can think of require nice round ints. Maybe specifying weights to individual backends to proxy to (so all the weights sum up to 1.0)?
- harrytuttle 13y ago99% of sites are CRUD apps, but we're math heavy financial software. We store a lot of reference data in configuration for performance reasons. This needs to be decimal format. JSON is a subset of the ECMA JavaScript standard which declares only floating point. Do "100!" on wolfram alpha and find me a parser that will load that as an example.
- shuzchen 13y agoworks for me: https://gist.github.com/sirpengi/609711 https://gist.github.com/sirpengi/609711
- harrytuttle 13y agoI get a 404. ?
- shuzchen 13y agoBad copy pasta (missing 3 at the end): https://gist.github.com/sirpengi/6097113 https://gist.github.com/sirpengi/6097113
- stock_toaster 13y agoor until someone wants to put in a comment that documents a change they made at 3am to a production system. I think I would prefer toml take off as a config language.
- harrytuttle 13y agoGood point. We use XML (still after 10 years). For all its warts, at least parsers and deserializers work properly.