3 ms·
Thank you! Did you notice this one? https://thebreakfastpost.com/2016/06/11/naming-conventions-in-standard-ml/ https://thebreakfastpost.com/2016/06/11/naming-c
by cannam 9y ago
Thank you!
Did you notice this one? https://thebreakfastpost.com/2016/06/11/naming-conventions-in-standard-ml/ https://thebreakfastpost.com/2016/06/11/naming-conventions-i... It's definitely a bikeshed moment, but I had meant to drop you a line to ask you why you chose This_Sort_Of_Naming for structures in Ponyo. It seemed a bit of an outlier.
I'm delighted to see you're still doing bits of work on Ponyo. I have a pleasant pipe-dream that, while frameworks and libraries for other languages rot because of language evolution, decades of random tiny personal SML library projects - written for a somehow still-modern language that never changes - eventually turn out to constitute a genuinely sound basis for new development work.
- eatonphil 9y agoHa! It's funny (and great!) to be featured there. The particulars of the naming convention are pure preference I suppose (and I recently simplified the naming of files [perhaps to the detriment of convention?]). I'm still trying to figure out proper naming conventions though and I'm not completely consistent. This makes the automated documentation generation I've tried to put in place hard... Anyway I'd like to point out that the namespacing exists at all because all structures in Standard ML are global by default. Some implementations have compilation managers that allow you to hide certain exports but Poly/ML does not. In general, if I define a String structure, I just overwrote the Basis String structure. (Ponyo exports a Basis structure up front that exports all overwritten Basis structures so you always have a way back). You could always overwrite these yourself, but _Ponyo_ itself prefixes all structures with their path for pseudo namespacing. But Ponyo also exposes them in a hierarchy for ease of use (the Ponyo structure embeds the Net structure which embeds the Http structure, etc.). But the original named structures are still accessible too. The worst part is signatures and functors. In the Standard ML standard, functors and signatures cannot exist inside of structures. This is a pain in the butt... And some non-standard extensions exist to support this (at least in SML/NJ maybe also in MLton). So in those cases you must ignore the structure access convention (Ponyo.Net.Http...) and use the full real name (Ponyo_Container_Dict). So in the worst case it's C-like (with only string/prefix "namespaces") and in the best case you can access and make shortcuts to intermediate structures (structure H = Ponyo.Net.Http).
- cannam 9y agoYes, it's disappointing that you can't just open a structure to wrap an entire other SML library or program. SML's module mechanism is usually very tidy but it has its awkward aspects, a pity for an otherwise so elegant language.