3 ms·
It would be cool to see a "layered" language. By this, I mean a language that has no typing at its lowest level, but you can add it as a library on top of the b
by amelius 12y ago
It would be cool to see a "layered" language. By this, I mean a language that has no typing at its lowest level, but you can add it as a library on top of the base level. Then you can add stuff like automatic resolution of calls, etc., as another abstraction level. Of course, you could also add other rules instead of typing. For example, you could pepper your programs with arbitrary proofs, etc., and this could be directed by yet another library on top of your program.
Perhaps I'm dreaming. But it sounds like useful to me, as there are so many languages that are almost similar, and yet are slightly different in the way they handle typing and things like polymorphism. It would seem to me that those languages could all share a common base.
- haifeng 12y agoI am not sure if typing can be added as a library. In terms of typed lambda calculus vs untyped lambda calculus, can we do this way? But the idea of "layered" language is nice. In Scala, many features are not really from language itself, but from libraries.
- rcsorensen 12y agoPerl is dynamic enough to support this. See http://search.cpan.org/~ether/Moose-2.1403/lib/Moose/Manual/Types.pod http://search.cpan.org/~ether/Moose-2.1403/lib/Moose/Manual/... and http://search.cpan.org/~ether/Moose-2.1403/lib/Moose/Manual.pod http://search.cpan.org/~ether/Moose-2.1403/lib/Moose/Manual.... Competing type systems, competing Object systems, and enough internal run-time rewriting to do whatever it is you want. See also http://search.cpan.org/~smueller/Filter-Simple-0.91/lib/Filter/Simple.pm http://search.cpan.org/~smueller/Filter-Simple-0.91/lib/Filt... for a simple rewriting filter, and the Acme namespace for all kinds of fancy experiments.
- ufo 12y agoOptionally typed programming languages are still a big research area and we are just now starting to see some of that research go more mainstream, with things such as Typescript. That said, I don't expect to see a language that does all the things you listed at the same time, since type systems are all about tradeoffs between expressivity and complexity and there is an upper bound in how much complexity a programmer can handle. There are also a lot of other tradeoffs that you need to think about: do unproved assertions get converted to runtime checks or to compile errors? Can you implement that efficiently? How will type inference work? Is it OK to design an unsound type system? etc etc. I can give you some pointers if you want to look for something more specific.
- kibwen 12y agoNoether is a "layered" language like you describe, as it's actually a set of seven languages arranged in a hierarchy where each layer adds a feature to the one below it, with the tradeoff being that as you add features you lessen your ability to reason about aspects of your code. See https://github.com/noether-lang/noether/blob/master/doc/presentations/StrangeLoop/noether.pdf https://github.com/noether-lang/noether/blob/master/doc/pres... and skip down the slide "Sublanguages and their symmetries".