4 ms·
This idea works quite nicely for "stdlib" sort of things. At least I've done this with JS - albiet using a very function / immutable style (so I don't know if t
by jfaucett 11y ago
This idea works quite nicely for "stdlib" sort of things. At least I've done this with JS - albiet using a very function / immutable style (so I don't know if this could work for OOP like languages).
Anyway, you end up with packages named "map" and "filter" or "toString" that export functions of the same name and are all very easy to require and consume/understand/test. Then on top of these you can build your libraries or apps.
"the only place where modules seem useful is to hide a letrec." - JS already has this via require you can easily choose what you want to export.
"The unique names bit is interesting - is this a good idea. Qualified
names (ie names like xxx:foo/2) or (a.b.c.foo/2) sounds like a good
idea but but when I'm programming I have to invent the xxx or the
a.b.c which is very difficult." - I agree 100% with Joe here, with a few developers it works beautifully without any namespacing for the sake of it, I can attest to this. You have a canonical "isTextNode" function for example which you can use when you want to know if a dom node is a text node, its simple and its much easier than remembering the whole namespacing of things like org.example.subrouter.MyRidicClass...
So in summary I really like this idea, I've really liked it for a while now in js, I just don't know how well it would work at a larger scale where "anyone?" (or who exactly) can plop funcs into the DB.