Rosetta Code:Add a Language

From Rosetta Code
Revision as of 11:31, 13 October 2013 by Pbrowne (talk | contribs) (Undo revision 169076 by Pbrowne (talk))

Thanks to a system of templates, adding a language on Rosetta Code is fairly simple. To begin with, consider the name of the language; This will be part of the name of the page that represents your language.

After checking to see if the language is already on Rosetta Code, You're going to need a category page to list all the examples, a redirect in the main namespace to redirect to the category page, and, finally, an example or two.

Notice that, for the purpose of instruction, we call the language "Ayrch", but that's almost certainly not going to be the name of the language you're adding; Replace "Ayrch" with the name of your language.

Prerequisites

For inclusion on Rosetta Code, the requirements are reasonable: There should be an existing implementation of that language that is either mature or, at the very least, under active development. Language notability is unimportant; if the number of languages on the site grows enough to require distinction, they can be differentiated by example coverage.

Basic Information

CafeOBJ is a algebraic specification language. It has an executable sub-language which broadly similar to Haskell or ML. CafeOBJ has many advanced features including: multiple logics, flexible mix-fix syntax, powerful and clear typing system with ordered sorts, parametric modules and views for instantiating the parameters, and module expressions, and more. Many of these features are inherited from OBJ3 (http://en.wikipedia.org/wiki/OBJ3). For download and manual see: http://www.ldl.jaist.ac.jp/cafeobj/

Category Page

{{stub}}{{CafeOBJ}}

(CafeOBJ is a algebraic specification language.


Redirect

#REDIRECT [[:Category:CafeOBJ]]


Examples

=={{header|CafeOBJ}}==

<lang CafeOB> 
-- Here is a sample sorting program.
mod! SORTING-NAT {
pr(NAT)
[Nat < Strg ]
-- Simple list structure
op  nil : -> Strg 
op _._ : Strg Strg -> Strg { assoc id: nil }

vars N N' : Nat
-- A very short sorting program using transitions in POA logic, which is a type of rewrite logic
ctrans [swap] : (N . N') => (N' . N) if N' <= N .
}

**> Sorting natural numbers using exec command
open SORTING-NAT 
exec (3 . 2 . 1) .
**> Sorting natural numbers using search command
**> we can use (show path N) with this command, where N is the nuber of possible states.
red (3 . 2 . 1) =(1,1)=>* (1 . 2  . 3) .
red (3 . 2 . 1) =(1,2)=>* (1 . 2  . 3) .
red (3 . 2 . 1) =(1,3)=>* (1 . 2  . 3) .
**> search for any number of solutions at any depth
red (3 . 2 . 1) =(*,*)=>*  (1 . 2 . 3) .
**> print the transitions from initial to goal state
show path 5
eof
</lang>


Tasks Not Implemented

Records and full object style classes.

More Advanced

These aren't strictly necessary, but are generally a plus if you want to increase awareness and penetration of your language on the site.

User Boxes

You created a user page before doing your edits, didn't you? You don't have to, but it generally helps in identifying who created and contributed what.

In your user page (not your user talk page), try adding a user box. That generally looks something like this:

{{mylangbegin}}
{{mylang|Visual Basic|Active}}
{{mylang|BASIC|Very Very Rusty}}
{{mylang|Brainf***|Rusty}}
{{mylang|C++|Very Active}}
{{mylang|Perl|Very Active}}
{{mylang|PHP|Semi-Active}}
{{mylang|UNIX Shell|Very Active}}
{{mylang|C|Semi-Active}}
{{mylang|Java|Rusty}}
{{mylang|JavaScript|Active}}
{{mylang|SQL|Active}}
{{mylang|Visual Basic .NET|Rusty}}
{{mylangend}}

Of course, you don't have to use words like "Active" or "Rusty"; You can use "Expert", "Novice" or "Author" (or any other way you want to describe your proficiency), if you like. If the only language you really know happens to be Ayrch, then your language box is pretty simple:

{{mylangbegin}}
{{mylang|Ayrch|Replace this with something reflective of your experience level}}
{{mylangend}}

If you just copy and paste that, you'll probably get the idea fairly quickly.

Implementations

A language is only theoretical until it has an implementation. An implementation might be a compiler, an interpreter, or even a piece of silicon. It helps users tremendously if they can find implementations of the language you're trying to show them. One good way to do that is to create an implementation page.

Let's say you have a compiler named ayrchc, and you want to create a page for it. Click on the Search field on the left, type ayrchc, and click Go. Click "create this page", and give the page a body:

{{stub}}{{implementation|Ayrch}}

That's a start, but if you're this far, then you can go a step or two beyond that. Instead of using {{stub}}, give a couple lines of description about the implementation, and, preferably, a link to the official page for the implementation.

Conclusion

If you've done all that, there's only one more thing you really ought to do: Get more people familiar with your language to fill in more tasks. Remember that page you created for "Unimplemented Tasks"? Pass that around to interested parties, and things will generally start happening.

We'll be watching for you!