Building a Programmer's Rosetta Stone
Did you ever run into the problem where you knew how to do something in one programming language, but really needed to do it in another? That's what Rosetta Code is all about. A variety of programming tasks are solved using as many languages as possible. You can examine existing tasks, or create your own.
But would you mind if I submitted it to Technocrat?
SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
Whatever was keeping me out is either gone or something, but I have access now. Since I am attempting (yet again) to teach myself coding I am very excited about using the site and will be voting you up in the hose;-)
If brevity is the soul of wit, then how does one explain Twitter?
You're itchin' for a fight with Cupertino, is that it?
"Win treats sysadmins better than users. Mac treats users better than sysadmins. Linux treats everyone like sysadmins."
A lot of the tasks assume imperative programing, e.x. assigning values to an array. This should be about algorithms that we can all implement, not code fragments that assume a particular style of programing.
Inventions have long since reached their limit, and I see no hope for further development.-- Frontinus, 1st cent. AD
Did you ever run into the problem where you knew how to do something in one programming language, but really needed to do it in another?
There are also programs that can be compiled or run by several different compilers/interpreters:
"A door is what a dog is perpetually on the wrong side of" - Ogden Nash
Of course there are also cases when you will need to port the solution to a different language. This may be the cause when the project specifications requires a specific language like Ada.
As with all programming; your mileage may vary.
If builders built buildings the way programmers wrote programs, then the first woodpecker would destroy civilization.
I'm not sure the right idea is to "know how to do something" in a particular language. If programmers are encouraged to learn algorithms specific to a particular language, how will they ever adapt once their pet language sinks? (By using an algorithm repository to re-learn rote code?)
At any rate, I think this site has already encountered a problem which is only going to escalate as it grows: code isn't cross-indexed properly at all. For example, there are many "programming tasks" with solutions in C, but there is nothing on the C page. I think this problem stems from the fact they used MediaWiki.
MediaWiki's great for something like... well, Wikipedia. But it doesn't support a cross-referenced database like this. The wiki concept is good for this site, but the server needs to be running some software designed better to the task.
Also check out 99 bottles of beer and Hello World Collection.
"How to bring a hooker back to life" Damn, I really neede....I mean, was interested in how you would do it in Perl, for curiosity's sake....
Monstar L
The site has absolutely no real content. There are only a couple of pages on the whole site. The most advanced thing found there is something along the lines of how to open a file with mIRC scripting (no C/C++/Java) and that bash scripts (usually) start with #!/bin/bash. Oh, please. Should I be impressed?
I demand the Cone of Silence!
It's already been done. Planet Source Code does this already, and it's been around for ages. You can find code examples and complete projects.
Then for projects in the .NET set there are a number of online translators that do C#VB.NET. Very good for moving code between different types of projects.
Now, something that would be truely useful would be a service that would do translations from a wider variety languages.
Politics is the art of looking for trouble, finding it everywhere, diagnosing it incorrectly and applying the wrong fix.
> to having a psuedocode compiler!
And what standard for psuedocode are we going to use? I once worked for an old-fart IMB 360 assembly language programmer turned CTO, and for a while he had us (I'm not making this up) using a program that used a psuedocodish language to produce flowcharts, which could then be used to document programs written in a 4gl (Progress). He did not see the irony or humor in this.
No folly is more costly than the folly of intolerant idealism. - Winston Churchill
http://jody140.dsl.frii.net/SWE/ProgEvol
I had to get it started. My hope is that other people will contribute with languages (and tasks) that they know.
tasks(723) drafts(105) languages(484) examples(29106)
Any piece of code for which you can do a literal enough translation that looking at the mapping would help you, is trivial anyway. Any larger piece of Haskell would probably take huge amount of, say C, and the translation wouldn't make it one bit easier to understand.
The only help the service will be is for beginning programmers who need to learn the syntax, but really, how long does learning a language's syntax take anyway?I was looking for some code to help me load-balance a busy server that was just posted on Slashdot ... all I found was code for this old Applesoft BASIC wiki server.
Although the idea seems nice, it still has a long way to go. The site currently only contains a few mIRC and bash scripts.
Anyway, I'm looking forward to when it's filled with code from different languages.
PS: an applet or an IDE plug-in like those from Koders would be really cool.
Did you even bother looking at the site first? Perhaps not as it's slashdotted. The idea isn't bad, but it's just a nearly empty wiki. Not many languages, and looking at some tasks, most of the stuff wasn't very useful. For example, I looked at the file I/O task, and there were no versions for C, C++, Java, C#, VB (not that I'd want that), PHP (idem) nor anything like that - but there was a mIRC scripting version...
Might be worth posting somewhere once there's actual useful content, but just not now.
But then again, I'm sure the editors didn't even look at it either before posting. There's nothing news worthy or interesting there - yet.
Strikes me that the "Rosetta Stone" should concentrate on algorithms and not religious solutions ... "99 Bottles" is good because it allows so many variants on a simple task .. a little like a "meta-hello-world" ...
How may ways do *you* know to solve the "Hello World" problem?
This may be all fine and well for writing a program, but what about maintaining the code... for anyone else trying to do anything with the code, it would be a huge headache... especially once the original programmer left. Completely unmanageable for projects of any decent size.
Nice idea, some concepts (string functions, (associative) arrays, file I/O) may be portable across some languages and in these cases rosettacode will be useful.
But I think the actual problem is not given due value. Sometimes performing the same task in the same language requires different code on different platforms. Examples: Reading a file bigger than 4 Gigabyte in gnu-flavored C++ on mac, linux, windows; figuring out the total number of sectors on disk, etc.
Also, we should accept that not all languages can do everything. Try creating an array of functions in VBA. Or (also in VBA) even simply breaking out of a loop, for that matter. Try exceptions in ANSI pascal or ANSI C. Try using pointers in Java. Try writing a GUI windowed interface in ANSI Pascal (no, Turbo Pascal doesn't count). Try recursion in GWBasic (this is actually possible).
I see this ending up as an effort to shoehorn concepts unique to one language to another language (building web sites in COBOL *shiver*). Rather than using the wrong tool, it will pay off to actually learn the other language.
Visit http://ringbreak.dnd.utwente.nl/~mrjb/growingbettersoftware to download your free copy of the book
Sourceforge has hosted to Programming Language Examples Alike Cookbook project for a while now. It does something similar, filling out "Perl Cookbook" recipes for a fairly wide range of languages...
http://pleac.sourceforge.net/
One project that deserves a look here is the LiteratePrograms project. The goals are somewhat different from Rosetta, with more emphasis on teaching of algorithms and the ability to run code directly from the wiki.
As one who has worked on a couple of multi-language problem sets (SICP in other programming languages and OO Shapes), I can appreciate the amount of work it takes. We can always use more sites that teach programming in various unique fashions.
Knowing how things are done in one language and seeing how they're done in other languages, gives you a perspective on those other languages. You can see how some other languages are similar to ones you already know, or you can see how totally messed up some languages are.
Aside from that, I hope to have a programming encyclopedia grow around all of the incidental links. (Each programming example links to a local wiki page about each of the software tools used, be they compiler, interpreter, library or platform.)
tasks(723) drafts(105) languages(484) examples(29106)
We are always reinventing the wheel, recreating frameworks and libraries from codesnippets. software has failed, if it succeeded then we could just "connect" together from a library of existing "components" / "objects" but no, we have too much fucking ego so we have to always "create" something, must create must create, how about no? Just "BUILD"!
/Rant
Are you really afraid to accept that software is a BLUE COLLAR job today? I think that is why we MUST (re)CREATE something every fucking time.
It is like an arms race, proliferation of code.
Implement it once and reuse it many times. Yes I know it is the holy grail but this is not a TECHNICAL problem, it is more of a POLITICAL problem. This is why software will continue to suck.
I didn't look at the site (/. effect) but the Shootout sounds like a good place to get a list of tasks implemented in several languages. You even get arbitrary, but still usefull, metrics like the line-of-code count, run time and memory usage. If someone has time to waste coding trivial tasks in his favorite language, he should contribute to the shootout. I did and I must admit I got a kick when a few well placed suggestions cranked the performance of my entry. Today Common Lisp is faster than Pascal and OCaml, tomorrow we beat Fortran and C++!
http://code.icarusindie.com/
The tutorials there show how to do software rendering in Javascript, PHP, C++ and Java. In Javascript, C++ and Java it gets into advanced raycasting. All three languages have a wolf3d clone.
Work Safe Porn
I called it ScriptNexus: http://www.scriptnexus.com .htaccess files and write quick proposals from time to time. It's still a feasible idea though. Someday...
I wanted it to literally do things in "real-time" too.
My mind wandered though, so I mostly use it to do
HELLO WORLD examples (you can use the drop-down menu to change languages):
http://www.scriptnexus.com/code/all/hello/text
I'll add a link to your site, if you like. Really, though, I'd like to see your code and tasks included on RC.
tasks(723) drafts(105) languages(484) examples(29106)
I have no problem with criticism. It tells me how I can improve.
The exposure has pointed me to several other sites and projects with similar aims. I won't rip code off, but I will be investigating how they run their projects.
tasks(723) drafts(105) languages(484) examples(29106)
Once you get beyond syntax you start delving deep into the particular style of a language, which frustrates attempts to compare. A very good 'Rosetta stone' for programming languages already exists:
s yntax-across-languages/
http://merd.sourceforge.net/pixel/language-study/
But all Real Programmers know all languages! At least that's what Slashdot keeps telling me...
AC: Stupid article, the guy could have used Haskell and solved his problems
BB: But maybe he didn't know Haskell?
AC: Then he deserves get fired!
Don't blame me, I didn't vote for either of them!
I like this site! The following page comes up when I try to access the site
It's called The Slashdot Effect, and it happens from time to time. Try again later.
Seven puppies were harmed during the making of this post.
For example:
for loop
Since some languages have the same token for different tasks, you would need cross-references in various positions. E.g. in perl:
for (i=0 ; i<n ; i++) or
for $var (@array), this would translate to foreach in other languages
The way I picture it, is a mainmenu where you select the languages you want to compare. Then you get a list of the statements side by side. Or you can search for a particular token.
Does anyone know if such a site exists?
For now, please add a link. In the future, I'd like to cooperate more.
I'll contact you by email.
Please correct me if I got my facts wrong.
Forbidden
/.
You don't have permission to access / on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
So much for THAT idea...courtesy of
Richard Steven Hack - This sig is TOO GODDAMN SHORT TO DO ANYTHING USEFUL WITH! MORONS!
You get a 404? I get only a 403! That's unfair! :-)
The Tao of math: The numbers you can count are not the real numbers.
I'm waiting for DNS to propagate to our new server. :-/
tasks(723) drafts(105) languages(484) examples(29106)
for the site to come back, you can use this.
"Beware of he who would deny you access to information, for in his heart he dreams himself your master."
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/mike/public_html/includes/Exception.php on line 139
That's one thing I want to see rewritten in several different languages.
Just so I can make sense of the damn thing and I won't look at my call to ITPLBV() and wonder, "What the fuck does THAT do?"
grey wolf
LET FORTRAN DIE!
There is the PLEAC (Programming Language Examples Alike Cookbook) which uses (or should use) the same examples for many programming languages.
Many languages are close to complete the provided examples.
I read somewhere that Microsoft actually has an internal version of SourceSafe that does, in fact, attempt to treat VB.net and C# as two different presentation layers of the same underlying code, and allows you to work on a file using whichever of the two languages you prefer. In other words, two developers can check out the "same" code from the repository -- one, as VB.net, the other, as C#. If #1 commits changes, VSS semi-compiles it to intermediate code and treats the VB.net code as nothing more than a presentation layer. When #2 updates his copy, it decompiles the code on the server to C# and updates HIS copy.
.1%, but the combo was lethal anyway). That, and the fact that VSS is kind of brittle to begin with & likely to be replaced by something else as soon as Microsoft can figure out what to replace it with...
Unfortunately, Microsoft discovered that it's a lot easier to describe on paper than do in real-life, because the devil's in the details. Apparently, the system had to make changes to code at commit time (officially, things like formatting), and those changes botched things up *just* enough to destroy its users' confidence in the system (in reality, it unnerved developers 99% of the time, and really screwed something up about
This idea makes sense, (even if the site sounds like it's empty and poorly designed), but only if you are comparing similar languages. For web scripting, I learned PERL first, and recently made the switch over to PHP for most of my new website stuff. Due to the old stuff still needing periodic work, I'm constantly going back and forth between the languages, and a cheat sheet showing me the syntax diffrences and basic fundamentals is invaluable for me.
Even if this site was fully fleshed out, you would still never get past the initial learning curve of a new language with just a list of ways to do all the particular tasks. It would be useful while learning it, but you still have to learn the new language.
ChuckyG
While I haven't been able to take a look at the Rosetta Stone project, it seems like it might be similar in spirit to the Code Codex.
Firehosing refers to the new "Firehose" feature available to subscribers here at Slashdot to recommend journal entries for front page status.
Technocrat.net is another site that FOSS geeks hang out at, starte by Bruce Perens for the discussion of governmental policy related to ham radios and computer topics.
When you learn to use a computer, let us know.
SJW: a person who perceives an injustice, and while correcting it, commits a greater injustice.
It's been up for a couple days now. Take a peek.
tasks(723) drafts(105) languages(484) examples(29106)
I created a page that lists all the similar sites that Slashdot users mentioned in their replies.
tasks(723) drafts(105) languages(484) examples(29106)
Thanks for the info. I already took a peek earlier, and even did some edits), although I didn't yet create an account. BTW, when I do, it will not be named "maxwell demon" - I tend to keep my identities somewhat separate (although I tend to use the same identity on several Wikis; I'll likely re-use my Wiki identity on Rosetta when I create an account).
The Tao of math: The numbers you can count are not the real numbers.
The real attraction of 99 Bottles of Beer ... and the reason it is so unhelpful if you just want to compare languages is that the examples often use exotic uses of the programming language in question. More a "lets use the weirdest way possible of writing this program that we can in the given language". So we see examples like, Java using no loops or ifs just throwing exceptions and printing stack traces to get the effect, or the C++ version doing it *all* in template meta-programming .... or my favourite the perl example (who said perl is hard to read?). Very amusing, but not a real comparison of languages .. as they are actually used.
Bitter and proud of it.
I did a simple look-up of one of these waay back when: http://mike.dewolfe.bc.ca/rosettastone.asp