Arc Forumnew | comments | leaders | submitlogin
Making radical language changes and having backwards compatibility too (awwx.posterous.com)
1 point by aw 4716 days ago | 2 comments


1 point by rocketnia 4716 days ago | link

I agree with your approach here, and it's what I've been planning for Penknife too. It opens the door another issue though: If you end up making two instances of a language core or a library, what if you want a value from one to mean the same thing in the other, but that value's meaning depends on something each module generates for itself, like a gensym or a mutable data structure?

My vague plan for Penknife is to avoid having modules prepare their own dependencies (in the spirit of http://gbracha.blogspot.com/2009/06/ban-on-imports.html), and also to introduce "spoof" bindings in namespaces so that modules which would generate new globals would harmlessly do nothing at that point, instead continuing on using the value that was already there. It's kind of a kicking-and-screaming form of Common Lisp's 'defvar (which uses an existing definition if it exists)... and you know what, 'defvar is probably a better overall plan. XD

Anyway, my solutions may not be the best ones for you. ^_^ Just want to get you thinking about it.

-----

1 point by aw 4715 days ago | link

I think the question of configuration and dependencies is a very interesting one. I've also found that it can be too inflexible to have libraries declare their own dependencies (through the usual "import" or "require" statement at the top of the library). My new version of the hackinator (https://github.com/awwx/hack) isn't doing enough to be useful yet, but it's an attempt to describe dependencies between libraries in a declarative way outside of the libraries themselves.

It opens the door another issue though: If you end up making two instances of a language core or a library, what if you want a value from one to mean the same thing in the other, but that value's meaning depends on something each module generates for itself, like a gensym or a mutable data structure?

Without a more specific example I can only guess... that if you have two instances that both depend on the same thing, you can either have one instance import that thing from the other; or else factor out that thing into a third location that the two instances independently import.

-----