Jump to content

Query: Comparable Functions/Programs Across Programming Languages

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
katking

katking

    Newbie

  • Members
  • Pip
  • 3 posts
Hi,

I'm doing a linguistic analysis of programming languages, and I would like to collect examples in 4 - 5 languages to analyse using a linguistics framework called Functional Grammar (suggestions for the languages have been Perl, Java, C+, php), for each of which I would only be analysing perhaps the equivalent of a few A4 pages of printed code (formatting intact).

My question is, in order to keep my results reliable, I would like to be analysing code which would execute either the same or a similar function/program across all 4/5 languages. Not being familiar with programming languages myself I'm not aware of what common things they can do. It could be a very basic thing - is there something you get taught to do in all languages when you first start to learn them?

I would be very grateful for any recommendations, and happy to answer questions if I haven't been clear enough - essentially I want to look at how several different programming languages would do the same thing. It would be helpful if the code was accessible/downloadable.

Many thanks for any advice :)

#2
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,118 posts
99 Bottles of Beer | Browse category A maybe?
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#3
katking

katking

    Newbie

  • Members
  • Pip
  • 3 posts
Wow, that is certainly a step in the right direction, thank you! That is exactly the kind of thing I am looking for -
only problem is the text is generally too short! I guess I need a more complex function?
Are there any similar websites where people have tried to address the same problem or issue
using different languages?

Cheers :)

Edited by katking, 11 September 2010 - 05:39 AM.


#4
Momerath

Momerath

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 243 posts
Rosetta Code

#5
katking

katking

    Newbie

  • Members
  • Pip
  • 3 posts
Oh, that's amazing, thanks! I see that I may have to do multiple comparisons, because again some of them are quite short... It seems the volume of text I was thinking of is more akin to a whole program or website isn't it!

Thanks for that link, that looks massively helpful :)

#6
paddy3118

paddy3118

    Newbie

  • Members
  • Pip
  • 7 posts
This task on RC has larger examples: Knapsack problem/Unbounded - Rosetta Code