krfkeith / silver

Automatically exported from code.google.com/p/silver
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Revise namespaces (runtime/prelude) #12

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Provide an explanation of what the project should entail:

Silver is currently a bit lazy with Java namespaces, and this should be fixed.

Currently the runtime library is "common." and should be "silver.runtime."

The "core library" is just called "core." and probably should be 
"silver.prelude." (we also discussed "silver.lang." in keeping with JVM 
tradition, but Eric wants us to go be edgy and follow the Haskell tradition...)

For the time being, we'll leave alone the compiler namespace, but eventually 
we'll want to confine the compiler under "silver.compiler." too. This is just 
too noisy of a change to do during the hackathon.

Provide a concrete example of a problem this project will fix:

This should confine everything Silver language and Silver runtime related under 
the top level "silver." namespace on the Java side of things, keeping pollution 
to a minimum.

Provide a short guide on how to start this project:

Do it in stages. The runtime is under runtime/java/src/common. The core library 
is grammars/core.

There will be references to these names all over. Grep will be helpful...

grep -R "core" grammars/
grep -R "common" grammars/

Provide a rough expectation of what the set of patches completing this
project might look like:

1. runtime
2. prelude

Probable challenges in completing this project:

Bootstrapping silver is ALWAYS a good time! ALWAYS!

I suggest changing the runtime by opening the project in eclipse, and using the 
eclipse java refactorings to rename the package. That way, all of that should 
be taken care of automagically, at least in the Java side of things.

Then, you'll want to go find every reference to "common." and change it to 
"silver.runtime." in the silver translation strings.

Then, if you did everything perfectly, the deep-rebuild script should work fine.

For the core library, what you'll want to do is:
1. duplicate the core library as silver:prelude, but leave it alone. Rebuild.
2. Change all hard-coded references from core: to silver:prelude: in the 
compiler. Rebuild.
3. Remove core.

Otherwise you might be in for a world of hurt...

Additional Information:

Whenever doing anything related to bootstrapping, always backup your jars, 
because you'll probably screw up and need to replace them often.

mkdir -p JARS-BAK
cp jars/*.jar JARS-BAK/

Original issue reported on code.google.com by tux...@gmail.com on 13 Jan 2012 at 9:23

GoogleCodeExporter commented 9 years ago
Slight plans update:

The Silver runtime and "prelude" properly belong as one single package. So this 
change should probably be delayed until we have a package manager, and the 
ability for the compiler to find already-built grammar within jars.

What we probably want then, is something like 'core' renamed to 'silver:lang' 
and 'common' placed under 'silver:lang:runtime'.  This would allow us to 
distribute one jar ('silver.lang-version.jar') that owns both.

Original comment by tux...@gmail.com on 9 Dec 2014 at 9:34