Hacker News new | past | comments | ask | show | jobs | submit login
RosettaGit: Same projects in many programming languages (rosettagit.org)
257 points by tomcam on Dec 28, 2019 | hide | past | favorite | 34 comments



This is one of the most impressive things I've ever seen: a 128 language quine replay.

https://github.com/mame/quine-relay


I’m surprised Lisaac is in the list, I thought the author stopped developing the compiler.


Nice project. I like this dedication and the idea. But I think these comparison always lack experts in individual languages. When I read C# code in projects like this, it is seldom modern or realistic. The project already compares apples with oranges but additionally the oranges are "rotten".

I would prefer a smaller set of compared languages where the provided snippets are actually up to date. Take the Techempower Benchmarks. Here experts fight against experts for the performance crown. And they categorize what they compare.


Hi, I’m the author =). Glad this hit the top of HN, as any help would be highly appreciated! With your help this could become a really valuable asset. Looking forward to your merge requests ;-) Let me know if you have any questions!


The first link I clicked was the one leading to https://rosettagit.org/tasks/bitmap/ . The first link I clicked there was the one labeled "write ppm file" leading to https://rosettagit.org/tasks/write_ppm_file, which 404s. Was I exceptionally unlucky?


It is definitely a problem that contributing to Rosetta Code is only possible through a clumsy WikiMedia interface. This makes it difficult to test and maintain the solutions for a given language. I'm not convinced a fork is the best solution, however. A tool for synchronising on-disk files with the wiki contents would have been sufficient, and seems eminently doable.


There's a GitHub extension to transclude content from a GH repo into a MediaWiki page, allowing the code to be managed separately from the wiki presentation: https://github.com/JeroenDeDauw/GitHub#github-extension-for-...

There's an older, more generic git transclusion extension for MediaWiki that needs a maintainer and updates: https://www.mediawiki.org/wiki/Extension:Git2Pages

And approaching the problem from the other end, there's the git porcelain git-remote-mediawiki that translates git commands into MediaWiki API requests: https://github.com/Git-Mediawiki/Git-Mediawiki

Git-Mediawiki is also known as mw-to-git in git's `contrib`: https://git.kernel.org/pub/scm/git/git.git/tree/contrib/mw-t...


In particular re: the concerns raised by forgotpwd16 about losing history, Git-Mediawiki preserves the wiki's change history.


In Rosetta Code you can split the code and insert some text and formulas between them. Sometimes it makes the explanation easier. Also, the free form in useful to add different ways to solve the task and compare them.

The problem is that you must trust your cut&paste abilities to not break the code :).


Something that uses Repl.it or tio.run or klipse would be even better.


I‘m planing to add support for those platforms. E.g. providing a button to run the code on them for the beginning ...


I have a similar repository with about 150 different languages & combinations. It's a fantastic exercise!

https://github.com/octonion/recursion


Did anyone try to train a model to translate a code to other languages (i.e. Google translate for codes) using data in this site?


Lots of languages have different assumptions about which edge cases you must handle or are handled automatically for you, or what restrictions you have. How do you account for a language which allows memory management or not? One that has higher- vs. lower-level threading APIs? These can be handled, but consider the complexity necessary to do so for only a single language. Then, imagine the thousands of other things you can't call to mind until you hit them as a crazy edge case trying to do this. While it may be theoretically possible, this means such a model is probably not the best tool to do this.


That would be possible for purely funcional languages, but the mainstream ones allow side effects that you can't quite predict. Remember training a model is just teaching a machine to memorise statistical occurrences. Anything the model doesn't anticipate can be catastrophical.

I could see something like control engineers do, use machine learn to help tune a controller. In this case, use a model to generate an aproximation code translation with accompanying degree of precision.


Unfortunately this fork loses the changes history of the countless people that have contributed during the decade that RC exists. To say the truth RG looks more polished but not something that couldn't be done on RC.


I have a similar project, 94 tasks currently:

https://cup.github.io/autumn


Wow very impressive. Did you write all of these?

I clicked "Send Email" and scrolled down the page, curious what might help out my recent PHP rage.

And what to my wondering eyes should appear? A concise PHP example using several undocumented features!

Thanks!


Some are copy and paste, some are modified from other sources, some are made from scratch. If you have some suggestions I am open to adding more topics or languages.


What is the difference between this and RosettaCode? A tip for a feature, when I filter by language and I click in a solution I want to be presented automatically with the solution, an not having to search or scrolldown for it.


It literally says this in the link:

  The data was originally forked from rosettacode.org on 2019-10-22. In comparison to Rosetta Code, in RosettaGit all code is stored and hosted in a repository on GitHub instead of a MediaWiki. This has following advantages:

   * Code can be edited with proper text editors
   * Continous integration and delivery can be used to ensure a high code quality
   * All infrastrucuture for git (e.g. GitHub) simplifies further development
   * Faster load times as pages are only rebuilt after a change


The readable/properly-formatted version:

The data was originally forked from rosettacode.org on 2019-10-22. In comparison to Rosetta Code, in RosettaGit all code is stored and hosted in a repository on GitHub instead of a MediaWiki. This has following advantages:

* Code can be edited with proper text editors

* Continous integration and delivery can be used to ensure a high code quality

* All infrastrucuture for git (e.g. GitHub) simplifies further development

* Faster load times as pages are only rebuilt after a change


Is the Wolfram Programming Language/Mathematica still the most concise language? https://blog.revolutionanalytics.com/2012/11/which-programmi...


Wolfram Language has an absolutely huge "standard library" though which probably accounts for some of this.


Yes, but that's explicitly part of Wolfram's design philosophy: embed as much computational knowledge as possible into the core language.


I would believe so. Things like dynamic programming (memoization) takes only a few characters, not to mention a wealth of facilities already built in. It's what I use for prototyping math-y software.

If you discount its standard library however, I think it might not necessarily beat APL.


They need to benchmark Lua. Lua is ridiculously concise when it comes to implementing algorithms.

https://rosettacode.org/wiki/Category:Lua


It's not, though? For most tasks not solved by standard library, Lua is going to fall somewhere between JS and Ruby.


Within one language, a project can have numerous valid, qualitatively different implementations. How to ensure that the implementations in different languages are comparable? And if that's not the goal, how is this different from searching GitHub for "implementation of 2048 in Rust"?


Why is it important to ensure that the implementations are comparable? Why would someone contribute one that isn't? And if a language has to do something unusual because of specific quirks, I'd argue that's interesting by itself, and demonstrates how languages are similar and different (the stated goal of Rosetta Code).

Rosetta Code is specifically not a collection of library code. You're not supposed to take code from there, so it doesn't matter whether they all implement exactly the same thing.

The advantage over GitHub is that it's much easier to find what you're looking for, and the code you will find will (supposedly) be written explicitly for expository purposes.


I love this.

I have been trying to learn Racket and I already know a lot of other languages. This will give me a place to compare implementations of the same problem.


Related, recently featured on HN, 7GUIs, seven tasks for a GUI platform, with comparable implementations from many platforms.

https://eugenkiss.github.io/7guis/implementations


Sed looks like someone decided to make regex into a programming language.


I am saving this thread :)




Consider applying for YC's first-ever Fall batch! Applications are open till Aug 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: