User loginNavigation |
archivesLooking for an auto-lifting language.I have been looking for a language that includes the following form of resolution, but have not yet come to one. Given a function f: a -> b, and a list l: [a], I would like for the language to consider "f l" a valid expression. In particular, I would like it to automatically "lift" f to be typed as f:[a] -> [b] by rewriting "f l" as "map f l". In general, given a functor F : a -> F a, a function f : a -> b, and value v : F a, I would like for the expression "f v" to be rewritten as "F(f) v : F(b)". In addition, a multivariable method such as + : double -> double -> double, would lift based on the types of its arguments. Examples: I understand that all of this can be done by augmenting the code to be written in terms of do notation (almost, these are just plain functors, not monads), but I want a language that does that for me: do x < - a, y <-b, return $ x + y (is equivalent to) a + b. If such a language doesn't exist, can I get suggestions on best/easiest ways to accomplish this. I have considered using a preprocessor/modifying the type resolution process to include the additional code generation for an existing language, but I am not sure if there are other options/which is better. I wrote the above in Haskell notation just for communication purposes. OO languages would be appreciated as well. Many thanks, How to do E/DSLs successfully?It seems to me that there are some E/DSLs which work well (well enough, sometimes debatable) such as Makefiles. Then there are situations where people have E/DSLs that maybe even sound good, but end up not really working out as intended; the abstraction cannot fail to be come leaky but fast. I wonder if "business rules" tend to fall into the latter category. Might anybody have thoughts on what tells you when an E/DSL can work? Or what approach one should take given the nuances of a particular situation? Or at least what are the aspects involved? There are some situations where you really can hand it over to non-programmers and live to tell the tale, and others where doing so is a quick route to doom. Thanks for any thoughts. Ada, C, C++, and Java vs. The SteelmanDavid A. Wheeler: Ada, C, C++, and Java vs. The Steelman
|
Browse archivesActive forum topics |